Jump to content

Jasper Report error when compiling


askme

Recommended Posts

Hi all,

            I am using an api to generate the jasper report. I am trying to export the data in the HashMap through jasper report to a .pdf file. I am getting the following error. 

--------------------------------
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. Too many constants, the constant pool for Product_Report_1262846848578_594569 would exceed 65536 entries
public class Product_Report_1262846848578_594569 extends JREvaluator
             <--------------------------------->
1 errors

    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:195)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)

----------------------------------

My code worked fine when i generated the report with less content in it (or) less values in the hashmap. Now i have more values in my hashmap and i am not able to generate the report and the .pdf file.

 

Please help me

Thanks

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi lucianc,

                     Thank you for your kind reply. I am very much new to jasper reports. I was trying to avoid writing a jrxml file which would set my jasper design. That's why i was trying to set my jasper design through the java code. I was able to generate the report when i had less content in it. But now when i have more datas coming in i get the resultant error. These are some of the functionalities which i implemented, i don't know whether this is correct. Please correct me if this is not a right approach.

 

I was setting the page height as a static data like "jasperDesign.setPageHeight(1000);". But i found that the data that i passed was not getting assigned as there was no sufficient page height. So i dynamically set the page height according to the length of data that i have in my HashMap. At times i could find the page height being set as 80,000-90,000. And the error gets popped up.

Actually i don't know how to set a page break, like when one page has about 10-15 rows of data in it, then create another page and set the remaining data in it and so on.

 

Lucianc, can you please help me with this.

I am also trying to write a .jrxml file which would help me in generating the report the way i want. I am also stuck here, don't know how to move forward.

Lucianc, i am starting a new thread for this with the subject 'Creating .jrxml file'. Please have a look into and help me generate my report.

 

Thank you for the help

Regards

askme

Link to comment
Share on other sites

Generating a report template with a height of 80,000-90,000 pixels doesn't sound right.

I understand that you have some data in a HashMap.  While I don't know what exactly you have to achieve, I think a more sane approach is to have a detail band in the report and use the HashMap as data source when filling the report.

Regards,

Lucian

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...