Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Show a preview of the report through runtime API(Show a report layout)
icon5.gif  Show a preview of the report through runtime API [message #750129] Tue, 25 October 2011 16:45 Go to next message
Alessio Pollero is currently offline Alessio PolleroFriend
Messages: 74
Registered: August 2011
Member
I want to show a preview of a report in a JEditorPane, usually i run the report and display it in a JEditorPane running an IRenderTask run method.

As preview i mean show only the report layout without any data ...

Is there a way to execute only a preview of the report without loading the data from the datasource ( without executing the query on the database), so the report should run faster ?
Re: Show a preview of the report through runtime API [message #750401 is a reply to message #750129] Tue, 25 October 2011 19:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can get a thumbnail of the report but I do not think this is what
you want. Take a look at the general properties and click on the ...
button next to the Thumbnail property. This will generate one for you.

Jason

On 10/25/2011 12:45 PM, Alessio Pollero wrote:
> I want to show a preview of a report in a JEditorPane, usually i run the
> report and display it in a JEditorPane running an IRenderTask run method.
>
> As preview i mean show only the report layout without any data ...
>
> Is there a way to execute only a preview of the report without loading
> the data from the datasource ( without executing the query on the
> database), so the report should run faster ?
>
Re: Show a preview of the report through runtime API [message #750473 is a reply to message #750129] Tue, 25 October 2011 20:11 Go to previous messageGo to next message
Alessio Pollero is currently offline Alessio PolleroFriend
Messages: 74
Registered: August 2011
Member
Ok, Thanks.

What are the size of the thumbnail image ?

Can i retrieve this thumbnail from engine API ?
Re: Show a preview of the report through runtime API [message #750519 is a reply to message #750473] Tue, 25 October 2011 20:36 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I believe it is 180x229 pixels. Look at an example one attached.
If you generate it as part of the design process you can get it at run
time like:

design = engine.openReportDesign("Reports/TopNPercent.rptdesign");
ReportDesignHandle rdh = (ReportDesignHandle)design.getDesignHandle();
byte[] ba = rdh.getThumbnail();
ByteArrayInputStream inputStream = new ByteArrayInputStream( ba );
Image image = new Image( null, inputStream );



try {
final BufferedImage bufferedImage = ImageIO.read(new
ByteArrayInputStream(ba));
ImageIO.write(bufferedImage, "png", new
File("c:/test/image2.png"));
} catch (IOException e) {
e.printStackTrace();
}

Jason

On 10/25/2011 4:11 PM, Alessio Pollero wrote:
> Ok, Thanks.
>
> What are the size of the thumbnail image ?
>
> Can i retrieve this thumbnail from engine API ?
  • Attachment: image.png
    (Size: 6.50KB, Downloaded 139 times)
Previous Topic:XML Data Source
Next Topic:Asynchrony Testing
Goto Forum:
  


Current Time: Wed Sep 25 14:57:01 GMT 2024

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

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

Back to the top