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)
Deploying BIRT Report in Struts
ajayreddy
Hi,
I have a struts application. When i click on the "Generate Report" button, control is transferred to an action class that generates the report. Presently, i am able to generate a report by outputting it to a storage device (hard disk). The code for doing the following is ::
config = new EngineConfig( );
config.setBIRTHome("**********");
config.setLogConfig("*****", Level.FINEST);
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
design = engine.openReportDesign("****.rptdesign");
System.out.println("run and render");
IRunAndRenderTask task = engine.createRunAndRenderTask(design); HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("C:birtoutputreport1.xls");
options.setOutputFormat("xls");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
Now i wish to output the report to
a) birt viewer
or
b)present the user with a choice to save the report to his local disk.
Can someone please guide me as to how I can achieve the above things?
Help will be appreciated.
Thanks,
ajay
Find more posts tagged with
Comments
mwilliams
Hi ajay,<br />
<br />
The following post in the devShare may help you with this. It's an example of integrating BIRT with Struts and using emitters to get different formats of reports that could be saved, such as PDF and XLS.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/devshare/deploying-birt-reports/28-deploying-birt-with-jakarta-struts/#'>Deploying
BIRT with Jakarta Struts - Articles - BIRT Exchange</a><br />
<br />
This post may help a little as well:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/devshare/designing-birt-reports/424-integrating-birt-with-hibernate-and-struts/#'>Integrating
BIRT with Hibernate and Struts - Designs & Code - BIRT Exchange</a><br />
<br />
Hope this helps.