Jump to content
We've recently updated our Privacy Statement, available here ×

jackdawson

Members
  • Posts

    65
  • Joined

  • Last visited

jackdawson's Achievements

Enthusiast

Enthusiast (6/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Updates: I tried to use JRSwapFileVirtualizer now to see if that works. But, it does the same - throws an exception. Actually, the reports that are run are scheduled reports and 2 same reports but with different parameters are scheduled to run at the same time. And, this is only in this situation that the virtualizers are failing and not in other cases. And, if I don't use the virtualizers the reports run fine and have no problem. The only reason I use virtualizers is that there might be a case where the reports get larger and need page virtualization to complete. Here is the exception from this virtualizer: java.lang.NullPointerException at net.sf.jasperreports.engine.util.JRSwapFile.read(JRSwapFile.java:170) at net.sf.jasperreports.engine.fill.JRSwapFileVirtualizer.pageIn(JRSwapFileVirtualizer.java:110) at net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer.requestData(JRAbstractLRUVirtualizer.java:493) at net.sf.jasperreports.engine.base.JRVirtualPrintPage.ensureVirtualData(JRVirtualPrintPage.java:312) at net.sf.jasperreports.engine.base.JRVirtualPrintPage.getElements(JRVirtualPrintPage.java:304) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:595) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:539) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:313) at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdf(JasperExportManager.java:188) Can anyone figure out what is happening? I tried to figure out but cannot. Thanks.
  2. Thanks Lucian for responding. Here is the code snippet that deals with JasperPrint and JRGzipVirtualizer objects. After further investigation I found out that the culprit is the report filling statement. Because, when I include the JRGzipVirtualizer in the Map object that is passed to the jasper file to fill the report, the error pops up. And, when I exclude the virtualizer from the Map object then everything goes fine. There are few questions in my mind now: 1. Is it something related to number of virtualized objects I assign in the JRGzipVirtualizer constructor? I assigned 100 here. 2. Am I initializing the virtualizer correctly? 3. When the JasperPrint object is being exported into PDF format, I found that it is NOT null or empty. Now this makes me more confused. If this is NOT null or empty then why can't it being exported? Can anyone have a solution for this problem? Thanks. Code: public void fillDisplayReport(Map theUserEnteredParams){ String jasperFilePath = null; JasperPrint jp = null; byte[] reportObject = null; Map parametersToJasper = null; //Path to the jasper file jasperFilePath = ""; parametersToJasper = new HashMap(); parametersToJasper.putAll(getJRGzipVirtualizer()); //Puts the user entered parameters into the map to //be passed to the jasper file parametersToJasper.putAll(theUserEnteredParams); try { File jasperFile = new File(jasperFilePath); //Loading the jasper file into the jasper engine JasperReport jr = (JasperReport)JRLoader.loadObject(jasperFile); //Filling up the report jp = JRFiller.fillReport(jr, userParameters, ); //Exporting the JasperPrint to PDF format reportObject = JasperExportManager.exportReportToPdf(jp); if (reportObject.length > 0) { //Report is displayed } } catch (JRException e) { //Exception handling } } public final Map getJRGzipVirtualizer(){ JRGzipVirtualizer jrGzipVirtualizer = null; HashMap params = null; params = new HashMap(); if(jrGzipVirtualizer == null){ jrGzipVirtualizer = new JRGzipVirtualizer(100); jrGzipVirtualizer.setReadOnly(true); } params.put(JRParameter.REPORT_VIRTUALIZER, jrGzipVirtualizer); return params; }
  3. It's throwing the error when I try to export it to PDF format. byte[] reportObject = JasperExportManager.exportReportToPdf(getJasperPrint()); Does anyone has any idea why is this happeneing? Thanks.
  4. Hello all, I'm using the JRGzipVirtualizer for page virtualization for the jasper reports. The problem now I've with it is - it's throwing me a NullPointer Exception when I run it against the production database but when I run the report against the development database it runs fine. It does n't have any issues with the development database. Here is the stacktrace for this error: java.lang.NullPointerException: No data found for object with UID 29139395_0_1_-296108736 at net.sf.jasperreports.engine.fill.JRGzipVirtualizer.pageIn(JRGzipVirtualizer.java:104) at net.sf.jasperreports.engine.fill.JRAbstractLRUVirtualizer.requestData(JRAbstractLRUVirtualizer.java:493) at net.sf.jasperreports.engine.base.JRVirtualPrintPage.ensureVirtualData(JRVirtualPrintPage.java:312) at net.sf.jasperreports.engine.base.JRVirtualPrintPage.getElements(JRVirtualPrintPage.java:304) at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:595) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:539) at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:313) at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdf(JasperExportManager.java:188) I don't even understand what this isn't happy with the production database. If anyone can let me know what this needs I would really appreciate it. Please let me know if you need any further information on this. Thanks.
  5. One thing which puzzles me is - when a 1 day's report is generated the size of it is around 30MB. So, when I run for 2 days it should be around 60MB. I increased the JVM size from 760M to 1024M and that's the highest I could go.I'm sure JVM has enough heap space to accommodate the second one too. Then, why is it throwing Out of memory error? Post Edited by Jack Dawson at 03/20/09 19:57
  6. JRGzipVirtualizer worked great for a 1day report(around 25,000 pages). It was fast too. I'm not sure if it works for bigger date ranges. Everything (I mean all the procedures for generating large reports) converges at 'increase memory' step.
  7. Hello all, I looked at most of the other threads in this forum for finding a solution to generate a very very large report smoothly. My report has 3 subreports in it and when run for a single day produces around 25,000 pages. I hate to say this but there's a plan that this report would be run for 6 month period or even for larger periods. Can anyone let me what are the chances for this being possible? I don't think I could even save the JasperPrint object in the database as CLOB because I won't get it until it is complete and filled up. And, before it completes it's obvious for an 'Out of Memory' guy to show up. Thanks in advance. Post Edited by Jack Dawson at 03/18/09 17:19
  8. Your way might be little expensive. The easiest way to accomplish this is: Step 1: Run the query in the master report to fetch all the companies. Just companies. Step 2: Pass each company as a parameter to the subreports and run the queries using this parameter as a condition. So every time this subreport runs it has a different company and fetches the data relevant to it. Note: Use groups. It makes things easier. Hope it helps.
  9. Problem resolved. I had to use $V{COLUMN_COUNT} instead of $V{REPORT_COUNT}. Thanks.
  10. Problem resolved. I had to use COLUMN_COUNT instead of REPORT_COUNT. Thanks.
  11. I dont see my attachment. It's gone. I attached it twice. This is strange. Anyways, this is what the attachment should have: I think my problem has something to do with the page dimensions. So here are the details about them: Reports Information: =================== Report Page Height Page Width No. of Cols. Col. Width ------ ----------- ---------- ------------ ------------ Main(report1) 842px 595px 1 555 report2 200px 580px 1 580 report 3 200px 550px 4 135 report 4 200px 550px 4 135 Sample output: ============== Hour Count Hour Count Hour Count -------- --------- --------- -------- -------- ----------- 0 xx 6 xx 12 xx 13 xx 1 xx 7 xx 14 xx 2 xx 8 xx 15 xx 3 xx 9 xx 16 xx 4 xx 10 xx 17 xx 5 xx 11 xx 18 xx And, the rest of the data is printed on the next page one in each column. This is still more bizarre. Thanks again.
  12. Report structure: Main report(say, report1) has a subreport(say, report2) which again has 2 subreports(say, report 3 and report 4 respectively). The reports 3 and 4 have queries that fetch the data and fill the report. I will attach a sample out. Please check that out. Thanks again for your help.
  13. I tried to get the data in columns but I dont know why but this bizarre thing happens: 1.) 1st column has 6 records displayed. 2.) 2nd column has 6 records displayed 3.) 3rd column has only 1 record displayed. 4.) 4th column has 6 records displayed. 5.) the rest of the printing starts in the next page and the remaining 5 records are displayed in each column. It seems very strange. Why would 1st, 2nd and 4th columns display 6 records and not the 3rd column? Thanks again for your help.
  14. Hi, Even I have a similar kind of problem. I have subreports inside subreports. And, the specifications demanded the results in such a way that I had to use joins in almost each of the subreports. The report displays large data as well. Can you please let me know how did you get the JDBC get the data in chunks and also how did you get the FileVirtualizer work for you? I use FileVirtualizer, but it won't work. Thanks in advance.
  15. Oops!!! My master report has 2 subreports and the first one has 2 in turn. I could say a total of 3. Each of those 3 has a query including cross join and natural left join which is really degrading the performance as it has to fetch millions of records. Oracle don't like this and neither do I. So, is there any way around? Thanks.
×
×
  • Create New...