Report Scripting [message #249586] |
Tue, 24 July 2007 16:00  |
Eclipse User |
|
|
|
Originally posted by: amit.joglekar.gmail.com
Hi,
I want to execute certain methods in my Java class during report
generation process. There are different Java methods to be called at each
of the following stages, and the methods may share a common state (i.e.
set of variables)
1. on every row of data retrieved from the data set, before putting the
data in report document
2. before a group
3. after a group
2. on top of a page and end of a page, during generation phase i.e. the
method calls may affect whats printed on page headers and footers.
How can this be done using BIRT? In Jasper, one can use methods such as
beforeDetailEval, beforeGroupInit, beforePageInit etc. in report scriptlet
class. I am looking into BIRT event handling (scripting) to accomplish
this, but it does not seem as straight forward. Any pointers will be
helpful in determining whether I am heading in the right direction.
Thanks & Regards,
Amit
|
|
|
Re: Report Scripting [message #249649 is a reply to message #249586] |
Tue, 24 July 2007 18:21   |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Amit,
Birt uses Rhino for JavaScript events. Generally the available events
will be shown for a item when you select the script tab. Events can
also be written in Java.
Take a look at:
http://www.eclipse.org/birt/phoenix/deploy/reportScripting.p hp
Jason
Amit wrote:
> Hi,
>
> I want to execute certain methods in my Java class during report
> generation process. There are different Java methods to be called at
> each of the following stages, and the methods may share a common state
> (i.e. set of variables)
> 1. on every row of data retrieved from the data set, before putting the
> data in report document
> 2. before a group
> 3. after a group
> 2. on top of a page and end of a page, during generation phase i.e. the
> method calls may affect whats printed on page headers and footers.
>
> How can this be done using BIRT? In Jasper, one can use methods such as
> beforeDetailEval, beforeGroupInit, beforePageInit etc. in report
> scriptlet class. I am looking into BIRT event handling (scripting) to
> accomplish this, but it does not seem as straight forward. Any pointers
> will be helpful in determining whether I am heading in the right direction.
>
> Thanks & Regards,
> Amit
>
|
|
|
Re: Report Scripting [message #250212 is a reply to message #249649] |
Fri, 27 July 2007 14:08   |
Eclipse User |
|
|
|
Originally posted by: amit.joglekar.gmail.com
Hi Jason,
Thanks for sending link to the document. I went through birt's event
handling model and have a couple of questions related to using a single
event handler Java class for all the elements of a particular type e.g.
one class for Tables, another one for Rows, another one for Lables etc.
1. This approach of implementation would require use of some element
property to identify the exact element on which the event handler has been
called. I plan to use the 'name' property for this. But it seems that in
onPrepare(), using <type>.getName() (where type can be ILabel, ITable
etc.) returns the name appropriately, but in onCreate(), using getName()
on an instance like ILabelInstance or ITableInstance does not return the
name, it always returns null. Is this a defect? I am using birt 2.1.2
2. Since a row does not have a name, it can be identified using
getParent() to get the table and then using getName() on the table. But I
did not find a way to identify 'which' row in table it is i.e. whether it
is the table header/footer row, detail row, group header/footer row etc.
Any pointers about how to get this info in Java class that implements
IRowEventHandler?
Thanks & Regards,
Amit
|
|
|
Re: Report Scripting [message #250392 is a reply to message #250212] |
Mon, 30 July 2007 11:08  |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Amit,
The name is valid for the design element not the runtime creation of the
element. Is there nothing in the data to differentiate the objects?
Jason
Amit wrote:
> Hi Jason,
>
> Thanks for sending link to the document. I went through birt's event
> handling model and have a couple of questions related to using a single
> event handler Java class for all the elements of a particular type e.g.
> one class for Tables, another one for Rows, another one for Lables etc.
>
> 1. This approach of implementation would require use of some element
> property to identify the exact element on which the event handler has
> been called. I plan to use the 'name' property for this. But it seems
> that in onPrepare(), using <type>.getName() (where type can be ILabel,
> ITable etc.) returns the name appropriately, but in onCreate(), using
> getName() on an instance like ILabelInstance or ITableInstance does not
> return the name, it always returns null. Is this a defect? I am using
> birt 2.1.2
>
> 2. Since a row does not have a name, it can be identified using
> getParent() to get the table and then using getName() on the table. But
> I did not find a way to identify 'which' row in table it is i.e. whether
> it is the table header/footer row, detail row, group header/footer row
> etc. Any pointers about how to get this info in Java class that
> implements IRowEventHandler?
>
> Thanks & Regards,
> Amit
>
|
|
|
Powered by
FUDForum. Page generated in 0.04646 seconds