Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic page level footer
Ramprasad
<p>Hi All,</p>
<p> </p>
<p>We are generating a report for dynamic footer at page level. When i run this report in <strong>Web Viewer and then export to pdf, </strong>it is functioning correctly. But when i run this using <strong>view Report as PDF, </strong>it is not functioning properly.</p>
<p> </p>
<p>Actually we are generating this report as <strong>PDF </strong>by using <strong>ExportReport.java.</strong> In this class we are using <strong>PDF RENDER OPTIONS. </strong>Our idea is, if we use <strong>Web Viewer Render options</strong>, the report will generate correctly.</p>
<p> </p>
<p>Can any one of you provide Java class coding for <strong>Web Viewer Render options, </strong>it helps us a lot.</p>
<p> </p>
<p>I am attaching the report and Java file. Please observe the difference between <strong>Web Viewer</strong> and <strong>View Report as PDF.</strong></p>
<p> </p>
<p> </p>
<p>Thanks,</p>
<p>Ramprasad.</p>
Find more posts tagged with
Comments
kclark
<p>At first glace, it looks like you need to take runandrender and separate it into two different tasks, run then render. I'll edit your code and let you know if I get it working.</p>
kclark
<p>Here's some sample code that worked for me with your attached report, let me know if it works. It could be cleaned up a bit though.</p>
<pre class="_prettyXprint _lang-">
public class ExportReport {
public static void ExecuteReport(String reportDesign,String reportName,String reportFormatType) throws Exception {
System.out.println("Running...");
EngineConfig config = new EngineConfig();
IReportEngine engine = null;
try {
config.setLogConfig(null, Level.FINE);
Platform.startup(config);
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);
engine.changeLogLevel(Level.WARNING);
}catch(Exception ex) {
ex.printStackTrace();
}
PDFRenderOption pdfConfig = new PDFRenderOption();
IReportRunnable design = null;
// Run
design = engine.openReportDesign(reportDesign);
IRunTask task = engine.createRunTask(design);
task.run("c:/Users/kclark/Desktop/temp.rptdocument");
IReportDocument rptdoc = engine.openReportDocument("C:/Users/kclark/Desktop/temp.rptdocument");
// Render
IRenderTask renderTask = engine.createRenderTask(rptdoc);
PDFRenderContext renderContext = new PDFRenderContext();
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("c:/Users/kclark/Desktop/" + reportName);
options.setOutputFormat("pdf");
renderTask.setRenderOption(options);
renderTask.render();
System.out.println("DONE!");
}
}
</pre>
Ramprasad
<p>Hi kclark,</p>
<p> </p>
<p>It is absolutely working. We have been waiting for 2 weeks, to solve this problem. Thank you very much.</p>
kclark
<p>You;re welcome! Let us know if you've got any other questions!</p>