Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Different no of pages for pdf and docx reports
ravi11
<p>Hi,</p>
<p> </p>
<p>We have written the java code to generate a report in pdf and docx. But the problem we noticed is the number of pages for each format is different from each other.</p>
<p>For example if report generated in pdf is taking 92 pages then same report while generated in docx is taking 72 reports. Its about 20 pages. Is it possible to get same pages for different formats?</p>
<p>The below mentioned code is used to generate the report.</p>
<p> </p>
<p> Code:</p>
<p> EngineConfig config = new EngineConfig();<br>
Platform.startup(config);<br>
ReportEngine engine = new ReportEngine(config);<br>
IReportRunnable reportRunnable = engine.openReportDesign(reportDesign);<br>
IRunAndRenderTask runAndRender = engine.createRunAndRenderTask(reportRunnable);<br>
<br>
PDFRenderOption option = new PDFRenderOption();<br>
option.setOutputFileName(PropertyFactory.getProperty("PdfSavingPath")+reportName);<br>
option.setOutputFormat(reportFormatType);<br>
option.setOption(IRenderOption.HTML_PAGINATION, Boolean.TRUE);<br>
runAndRender.setRenderOption(option);<br>
<br>
HashMap<String,List<DataPage>> appContext = new HashMap<String,List<DataPage>>();<br>
appContext.put("ScriptedDataSetData", dataPages);<br>
runAndRender.setAppContext(appContext);<br>
<br>
runAndRender.run();<br>
runAndRender.close();<br>
engine.destroy();<br>
Platform.shutdown();</p>
<p> </p>
<p> </p>
<p>Thanks,</p>
<p>Ravi</p>
Find more posts tagged with
Comments
mwilliams
<p>There seems to be a larger row spacing in PDF than in DOCX. You could write some script to adjust the padding on the detail cells for the docx output to try to match them up. Or you could set a page break interval, but with the spacing in docx, you'd have a lot of space left at the end of each page.</p>
Małgorzata
<p>Hi,</p>
<p>I have the same problem. I use BIRT 4.3.</p>
<p>I export report to PDF and DOCX - in pdf is OK, but in docx document wrong.</p>
<p> </p>
<p>I use grid in my report . I set break page on the grid - after, interval = 1 (new topic start from new page).</p>
<p>I have the same <span><span>several </span></span>page numbers in my DOCX document (when describe one topic is on the <span><span>several</span></span> pages).</p>
<p> </p>
<p>I think paginating document in DOCX using BIRTs pages.</p>
<p> </p>
<p>I use IRenderTask too. I see the same page numbers that are in DOCX.</p>
<p>How to solve a problem?</p>
<p> </p>
<p><span style="font-size:14px;">Regards,</span></p>
<p><span style="font-size:14px;">Małgorzata</span></p>
mwilliams
<p>Can you provide an example that will show me your issue?</p>
Małgorzata
<p>In attachet two files (pdf, docx):</p>
<p>PDF - page number OK (7.)</p>
<p>DOCX - page number wrong (only 4.)</p>
<p> </p>
<p>
mwilliams
<p>Sorry. I meant a report design that I can run and test on.</p>
<p> </p>
<p>One thing you could definitely do is to set a page break interval. That would make sure the two outputs have the same number of rows per page. However, they would still look different. Modifying the padding when exporting to DOCX would probably be the best way to make them look the same.</p>
Małgorzata
<p><span>Thank you for your answer.</span></p>
<p> </p>
<p>My goal is create TOC in document Word :<br><br>
1. Id1 ........1<br>
2. Id2 ........3<br>
3. Id3 ........4<br>
4. Id4 ........8<br>
....<br>
67. Id67 ........78<br><br>
so I wanted create page number in BIRT.<br><br>
Require - each Id start from new page.<br><br>
Generate TOC in Word gets much time.<br>
In my report is to much Id items, for example 1000, so I should to mark each manually and next genererate TOC.</p>
<p> </p>
<p><span style="font-size:14px;">Regards,</span></p>
<p><span style="font-size:14px;">Małgorzata</span></p>
mwilliams
<p>To start each Id on a new page, you'd just need to page break after your ID group. As for TOC with page number, take a look at this old forum post for an explanation. If you need further assistance creating a TOC, let me know.</p>
<p> </p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/24632-toc-with-dynamic-page-numbers/'>http://developer.actuate.com/community/forum/index.php?/topic/24632-toc-with-dynamic-page-numbers/</a></p>
;
Małgorzata
<p>In attached files example rpt designe and docx.</p>
<p>I create TOC in table on label (don't use TOC from BIRT).</p>
<p>In this example see problem with the same number page on two page.</p>
<p> </p>
<p>Post from last answer (the link) contain:</p>
<p><strong>render.setRenderOption( options );</strong></p>
<p> </p>
<p>Variable options is type<a data-ipb='nomediaparse' href='
http://help.eclipse.org/indigo/topic/org.eclipse.birt.doc.isv/engine/api/org/eclipse/birt/report/engine/api/EXCELRenderOption.html'
title="class in org.eclipse.birt.report.engine.api"> EXCELRenderOption</a>/<a data-ipb='nomediaparse' href='
http://help.eclipse.org/indigo/topic/org.eclipse.birt.doc.isv/engine/api/org/eclipse/birt/report/engine/api/HTMLRenderOption.html'
title="class in org.eclipse.birt.report.engine.api">HTMLRenderOption</a>/<a data-ipb='nomediaparse' href='
http://help.eclipse.org/indigo/topic/org.eclipse.birt.doc.isv/engine/api/org/eclipse/birt/report/engine/api/PDFRenderOption.html'
title="class in org.eclipse.birt.report.engine.api">PDFRenderOption</a>/<a data-ipb='nomediaparse' href='
http://help.eclipse.org/indigo/topic/org.eclipse.birt.doc.isv/engine/api/org/eclipse/birt/report/engine/api/RenderOptionBase.html'
title="class in org.eclipse.birt.report.engine.api">RenderOptionBase</a>, but I create DOCX file.</p>
<p> </p>
<p><span style="font-size:14px;">Regards,</span></p>
<p><span style="font-size:14px;">Małgorzata</span></p>
mwilliams
<p>So, your report will contain VERY long strings that fill up multiple pages? This is what's causing the issue in this sample. It's definitely a bug, but one that I think has been reported. That said, you could always post it again. A way around it could be to process your incoming data into another data set (scripted data set) to break up the very long texts into chunks that will fit on a page.</p>
Małgorzata
<p>Problem with multiple pages occur only DOCX document when:</p>
<ol><li>report contain VERY long string</li>
<li>report contain to many rows with label name that fill up multiple pages</li>
</ol><p> </p>
<p>(My report have sometimes very long text and label name fill up multiple pages.)</p>
<p> </p>
<p>After export to PDF page numbering is correct (attached file).</p>
<p> </p>
<p>Thanks so much for your answer.</p>
<p>Best regards,</p>
<p>Małgorzata</p>