PDA

View Full Version : JFreeReport work very slow or I have error in my code



Anonymous
02-23-2006, 07:41 AM
Hi, in my program I have problem with JFreeReport. Program write to console
INFO: Pixie library found. WMF file support will be available.
INFO: Registering fonts for the iText library; using a cached font registry.
INFO: Completed font registration.


and in debugger program stop in code

private JFreeReport createReportDefinition ()
{

JFreeReportBoot.getInstance().start();

final JFreeReport report = new JFreeReport();//here is stop
andI must kill my program. CPU is 10%, RAM my application 35MB, normal is 30MB.
In console in my IDE - NetBeans - is no write, any error.

To this functions I jump from

final TableModel data = createData();
final JFreeReport report = createReportDefinition();//here



Regards Vasek

Taqua
02-23-2006, 07:47 AM
Hi,

you are working with Windows and you do not have a printer driver installed. Therefore the JDK locks up when it tries to query the default page sizes.

Use the global report configuration "org.jfree.report.NoPrinterAvailable" and set it to "true".

Therefore either start your programm with the system property "org.jfree.report.NoPrinterAvailable" set to "true" or create a jfreereport.properties file and put the property there or by adding the following lines to your code:


JFreeReportBoot.getEditableConfig().setConfigProperty ("org.jfree.report.NoPrinterAvailable", "true");


The concept behind the report configuration is explained here: http://www.jfree.org/phpBB2/viewtopic.php?t=5789

Regards,
Thomas

Anonymous
02-23-2006, 08:26 AM
Thank you for your help me. I add your code to my functions

private JFreeReport createReportDefinition ()
{

JFreeReportBoot.getEditableConfig().setConfigProperty ("org.jfree.report.NoPrinterAvailable", "true");

JFreeReportBoot.getInstance().start();

final JFreeReport report = new JFreeReport();
report.setName(getDescription());

any code..........

but IDE show error non static method getEditableConfig() cannot be referenced from a static context
JFreeReport report is declared as final





Thank you

Taqua
02-23-2006, 09:06 AM
Hi,

sorry my fault: Use



JFreeReportBoot.getInstance().setConfigProperty ("org.jfree.report.NoPrinterAvailable", "true");


and it will work.

Regards,
Thomas

Anonymous
02-23-2006, 10:13 AM
I am sorry, but

cannot find symbol method setConfigProperty. In my GUI
is show only setUserConfig. It is this method?

Regards

Vasek

Taqua
02-27-2006, 01:19 PM
Hi,

sorry, the correct call is:



JFreeReportBoot.getInstance().getEditableConfig().setConfigProperty(String, String);


Regards,
Thomas

Anonymous
02-28-2006, 09:00 AM
Thank you very much