2002 JI Open Discussion Posted August 18, 2006 Posted August 18, 2006 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now