- Problems
when printing
- can
I print reports in a web-based application (print from browser)?
- Report.getAreaByName("header")
returns null
- My
area is not being printed. However it is being displayed in the Visual
Builder
- How
can I add barcodes or charts to my report?
- How
do I activate colour printing
- About
images(running from JBuilder ...)
- Printing
without preview
- Preview
different from print out
- Cannot
load *.rep file when calling RReportImp();
|
1.
Problems when printing |
If the print out
of the sampe application results on a blank page or in a black box instead
of images you should upgrade your version of Java[TM] Virtual Machine.
Some releases of Java[TM] Platform 1.1 have problems when printing. We
recommend you to use the RReportJ2 class instead of the RReport class.
|
2.can
I print reports in a web-based application (print from browser)? |
Applets are not allowed
to print, this is a Java[TM] platform security restriction. If you execute
a report within a browser you should create an applet but the browser
will never allow an applet to print unless you make a signed applet. This
is however very tedious.
The best solution
for this is to have a Java[TM] application in the server (servlet) that
exports the report to HTML or PDF format. This can then be displayed and
printed by the client (browser).
|
3.Report.getAreaByName("header")
returns null |
getAreaByName() can
only be used to retrieve normal areas. If you need to retrieve the report/pages's
header or footer you must use: getReportHeader(), getPageHeader() ....
|
4 .My area is not being printed. However it is being displayed
in the Visual Builder |
Visual Builder always
prints/displays at least 1 repetition of each area. However the runtime
behaviour of RReport is:
1. You must call
prepare(). This will print your report's header and all linked (nested)
areas.
2. You must print other areas that are not linked to the header by calling
report.printArea().
3. You must call endReport(), this will print the report's footer.
A common mistake
is to forget about step 2. Remember, if your are is not linked to the
header you must use report.printArea().
|
5 .How can I add barcodes or charts to my report? |
In order to add charts
or barcodes to RReport you have two possibilites:
- create the chart
or barcode in a gif/jpg file and then add the image to the report using
RPicture and RImageFile
- create the chart
or barcode in a java.awt.Image object and add it to rreport using RPicture.
The first solution is required if you are planning to export to HTML,
because HTML requires images to be in a file.
|
6 .How do I activate colour printing |
you must use RPrintSetupJDK13:
RPrintSetupJDK13
rsetup = new (RPrintSetupJDK13);
rsetup.colorPrint=true;
myReport.setPrintSetup(rsetup);
|
7.
About images (running from JBuilder ...) |
RReport is loading
images as Resources. This means, images can be in a directory or in a
ZIP/Jar file. The path/package used to load images is:
com/java4less/images
For example, if you
installed RReport in the d:\a directory. You will then get
d:\a\rreport.zip
d:\a\com\java4less\images\
If you use your IDE
to run the examples you must include rreport.zip and d:\a so that RReport
can find the classes and the images.
If you use JBuilder
you can do it like this:
Project->properties->required
libraries --> add -> new -> select rreport.zip
Project->properties->required libraries --> add -> new -> select d:\a
directory
Another possibility
is , to put the images in a zip file and include the zip file in the classpath.
|
8. Printing without preview |
In order to print
without the preview window you must remove the following lines from the
examples:
RReportWindow Win=
new RReportWindow(report,this);
Win.show();
|
9. Preview different from print out |
RReport uses the
screen resolution for the preview , however it uses the resolution of
the printer for printing. For this reason the preview might look slightly
different from the print out.
|
10. Cannot load *.rep file when calling RReportImp(); |
In order to read
*.rep file using RReportImp you must take into account the following:
Files can be loaded
using a relative or absolute path:
- Relative: for
example, if the CURRENT directory is "c:\myApplication" and the *.rep
is in the "reports" subdirectory, you could load the report using: RReportImp("reports\\yourReport.rep");
- Absolute: you
can also load the report using the absolute path: RReportImp("c:\\myApplication\\reports\\yourReport.rep");
|