Skip to main content



      Home
Home » Archived » BIRT » Can BITR be used in standalone Swing application?
Can BITR be used in standalone Swing application? [message #152149] Sun, 09 April 2006 06:19 Go to next message
Eclipse UserFriend
Originally posted by: johnli121.gmail.com

Can BITR be used in standalone Swing app without application server and web
environment?

Thanks,
John
Re: Can BITR be used in standalone Swing application? [message #152158 is a reply to message #152149] Sun, 09 April 2006 10:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Yes, but you will need some way to view the report. More than likely a
pdf viewer.

johnli wrote:
> Can BITR be used in standalone Swing app without application server and web
> environment?
>
> Thanks,
> John
>
>
Re: Can BITR be used in standalone Swing application? [message #152245 is a reply to message #152158] Mon, 10 April 2006 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Mark
I'm looking for such a solution. Could you pls give an example?
Thanks.

Xiang

"Mark" <m@n.com> ??????:e1b41b$tbj$1@utils.eclipse.org...
> Yes, but you will need some way to view the report. More than likely a pdf
> viewer.
>
> johnli wrote:
>> Can BITR be used in standalone Swing app without application server and
>> web environment?
>>
>> Thanks,
>> John
Re: Can BITR be used in standalone Swing application? [message #152253 is a reply to message #152245] Mon, 10 April 2006 09:25 Go to previous message
Eclipse UserFriend
Originally posted by: m.n.com

Sure. Below is some code. We are using PDFViewer to display the app.
It does cost $, but wasn't too bad. If your app is open source there is
a GPL viewer from someone else. You can also use the JRex browser to
view the pdf - it will use Adobe Reader and requires native dlls.



public byte[] getReport(String reportName) throws ReportException {
IReportRunnable runnable;
try {
runnable =
ReportUtil.getEngine().openReportDesign(ReportUtil.getReport Home() +
"/reports/" + reportName + ".rptdesign" );
IRunAndRenderTask task =
ReportUtil.getEngine().createRunAndRenderTask( runnable );

IRenderOption options = new FORenderOption( );
options.setOutputFormat("pdf");

ByteArrayOutputStream out = new ByteArrayOutputStream();

options.setOutputStream(out);
task.setRenderOption( options );
task.run( );
if (out.size() <= 0)
{
throw new ReportException(new Exception());
}
return out.toByteArray();

} catch (EngineException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new ReportException(new Exception());
}
}

PDFViewerBean viewerBean = new PDFViewerBean();
viewerBean.loadPDF(new ByteArrayInputStream(getReport(reportName)));
//add the viewer to a JFrame or whatever.



Bao Xiang wrote:
> Hi, Mark
> I'm looking for such a solution. Could you pls give an example?
> Thanks.
>
> Xiang
>
> "Mark" <m@n.com> ??????:e1b41b$tbj$1@utils.eclipse.org...
>
>>Yes, but you will need some way to view the report. More than likely a pdf
>>viewer.
>>
>>johnli wrote:
>>
>>>Can BITR be used in standalone Swing app without application server and
>>>web environment?
>>>
>>>Thanks,
>>>John
>
>
>
Previous Topic:Adding fields
Next Topic:BIRT Developer guide down
Goto Forum:
  


Current Time: Sun Jul 13 22:05:26 EDT 2025

Powered by FUDForum. Page generated in 0.05654 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top