Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

RReport Faq's page 

Home

Index

We hope these faq's will answer most of your questions, if not, contact us.

 

Technical Support

RReport

  1. can I print reports in a web-based application (print from browser)?
  2. How to skip the printer dialog?
  3. Problems when printing
  4. Report.getAreaByName("header") returns null
  5. My area is not being printed. However it is being displayed in the Visual Builder
  6. How can I add barcodes or charts to my report?
  7. How do I activate colour printing
  8. About images(running from JBuilder ...)
  9. Out of memory
  10. Printing without preview
  11. Preview different from print out
  12. Cannot load *.rep file when calling RReportImp();
1. How to skip the printer dialog.

RReport is 100% jdk 1.1. It is not possible to do that in jdk 1.1. However you can very easily modify the source code to do that if you are using jdk 1.3.

See http://java.sun.com/j2se/1.3/docs/api/java/awt/JobAttributes.DialogType.html

 

2. 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 Virtual Machine. Some releases of Java have problems when printing.

3.can I print reports in a web-based application (print from browser)?

Applets are not allowed to print, this is a java 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 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).

4.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() ....

5 .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().

6 .How can I add barcodes or charts to my report?

In order to add charts or barcodes to RReport you have two possibilites:

  1. create the chart or barcode in a gif/jpg file and then add the image to the report using RPicture and RImageFile
  2. 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.
7 .How do I activate colour printing

you must use RPrintSetupJDK13:

RPrintSetupJDK13 rsetup = new (RPrintSetupJDK13);
rsetup.colorPrint=true;
myReport.setPrintSetup(rsetup);

 

8. 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.

 

9. Out of memory

the preview requires a large amount of memory, for this reason you should not make a preview of large amounts of data, but print or export directly.

 

10. 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();

11. 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.

12. 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");