Home
Analytics
Output separate PDF files for each group
just1joe
Hello,
I have a large report that I have designed which contains several sub charts and tables. My plan was to output this to a .PDF file and then run a splitter to separate the output into separate .pdf files. There will end up being about 950 separate .PDFs when I am done. I have run into an issue where if I try to generate the full list I get the error that the file is corrupt. On looking at the forums this was an indication of a bug with the .pdf output running out of memory. It was suggested on that link to generate the output in another format like .ppt. I have tried that and let the process run overnight, it still has not completed over 10 hours later.
Is there a mechanism to either create a separate output file every time a group changes or is there a way to pass a report parameter in from a file automatically and have it process one record and upon completion get the next parameter record in the list and process that one until it goes through all 950?
- Joseph
Find more posts tagged with
Comments
kclark
If your groups are on pages by themselves then you could render each page to PDF using the __format parameter and loop through each page via the URL.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>http://localhost:8080/birt/frameset?__report=new_report_26.rptdesign&__page=3&__format=pdf</pre>
<br />
I think you could also set up your report to take a hidden parameter to know which group to render and then generate the PDF. Depending on what you want and how your report is setup that might be better. You could create an array with the information for each time the report runs and loop through it to render each PDF with some Java code.<br />
<br />
Could you tell me a little more about how your report is setup or attach the rptdesign?
kclark
I've attached an example with one way you could do this. I created an example report with a simple grouped listing. In my query I filter out everything that doesn't match the value of the parameter.
Then I created a small Java program that connects to the sample db and stores all the values of customernumber in an ArrayList. This is because I'm grouping on customernumber and passing it to the parameter.
Then I generate the report using a for loop to go pass each customer number to the sample report. Finally I output the PDF as groupNReport.pdf in a reports folder.
Let me know if this is what you were wanting or if you have any questions!
just1joe
Essentially the report processes a cover page and then subsequent detail pages until it starts the next main group where it generates the cover page again and all of the subsequent pages.
When I set up the design I limited the input to a couple of accounts and that generated an 80 page file with no issues. Manually running this a few accounts at a time will take quite a while.
just1joe
Thanks. Your post didn't display for me until today. I'll take a look at the java and see if I can get it to run. I am a little new at using the java components. I am getting an error the import org.eclipse cannot be resolved. I think I am having issues configuring the build path.
kclark
Have you added the jars from the runtime into the build path for you're project yet? If not you'll need to copy the jars into a folder in your project. Then you can highlight them all > right click > build path > add to build path. You can download the runtime <a class='bbc_url' href='
http://eclipse.org/birt/phoenix/'>here</a>
. I built that example using BIRT 4.2.2
just1joe
Thank you very much. This worked perfectly.
kclark
You're welcome, in you're first post you said that process took over 10 hours. How long did it take to complete using my example?
kallisjack
<p>how do i merge 10 different (.rptdesign) reports into a single report </p>
<p>ex. employee history(salary.rptdesign,details.rptdesign etc..).</p>
pricher
<p>Hi,</p>
<p> </p>
<p>Maybe this <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php/topic/29047-combining-multiple-rptdesign-multiple-datasources-to-produce-one-pdf/'>older
thread</a> will help.</p>
<p> </p>
<p>P.</p>