Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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 12:45 Go to next message
Alessio Pollero is currently offline Alessio Pollero
Messages: 65
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 15:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
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 16:11 Go to previous messageGo to next message
Alessio Pollero is currently offline Alessio Pollero
Messages: 65
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 16:36 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
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 51 times)
Previous Topic:XML Data Source
Next Topic:Asynchrony Testing
Goto Forum:
  


Current Time: Sat Jul 26 11:28:36 EDT 2014

Powered by FUDForum. Page generated in 0.02968 seconds