The Document has no pages ??

By: Oliver Toma - olivertoma
The Document has no pages ??
2003-07-21 23:50
Hi forum,

i am a novice to jasper, so please be patient...

i used iReport to design a simple report with only one static text field. then i wrote a simple main() which i supposed to print thes report to pdf. but as you can see in the subject i got the error "the document has no pages".

why? if i start the design viewer in main, i can see my static text field...

please help me, you can find my main() enclosed:
----------------------------------
JasperPrint jp = JasperFillManager.fillReport(jr, hash, new JRTableModelDataSource(new DefaultTableModel()));

JasperPrintManager.printPage(jp, 0, true);
-----------------------------------

i know there is nothing to fill, but how to print a static report? the hashMap ist empty...

thanks a lot,
oliver




By: Teodor Danciu - teodord
RE: The Document has no pages ??
2003-07-21 23:59

Hi,

Use whenNoDataType="AllSectionsNoDetail" if you
want the engine to generate something even when
you do not supply a data source or the data source
has no records in it.

I hope this helps.
Teodor





By: Marianna - marianna_kr
RE: The Document has no pages ??
2003-07-23 06:45
Another way is to pass new JREmptyDataSource() as a datasource.

Here the way I did this :

JasperRunManager.runReportToPdf(
"d:/reports/companytest.jasper",
"d:/reports/companytest.pdf",
new HashMap(),
new JREmptyDataSource()));


Marianna




By: Marianna - marianna_kr
RE: The Document has no pages ??
2003-07-23 09:34
it'e actualy runReportToPdfFile() in my post above. Sorry!!!

Marianna
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback
randomness