Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Dynamically set table name in onPrepare method
Dynamically set table name in onPrepare method [message #900927] Thu, 09 August 2012 06:37 Go to next message
Thomas Spencer is currently offline Thomas SpencerFriend
Messages: 1
Registered: August 2012
Junior Member
Hi all, newbie here looking for some assistance with dynamically naming a table in the onPrepare method.

I have a report which has a table embedded inside a group, thus for every instance of the group the table is repeated. If the user tries to export the contents of this table from the web viewer they are faced with a list of duplicated names for the table e.g. myTable, myTable_1, myTable_[x] etc...

I wish to be able to dynamically name the table in each group to differentiate each instance of the table in the report to provide the user some help in selecting the correct table to export the data from.

For this table I can rename statically in an onPrepare script with this.name = 'newTableName'.

What I'm struggling with is dynamically generating a name based on where in the report the table is displayed i.e. under which group. I appreciate that the onPrepare method has no data bound and thus cant access its eventual contents.

My questions really are these:

Am I missing a straightforward solution to this?

Can I access other elements higher in the Outline hierarchy to utilise their values or are these not bound either when evaluating the onPrepare script for the child table?

Alternatively should I be looking at setting a parameter in an onCreate method of a parent table or again will this occur after the onPrepare for the child table?

Thanks,

Tom

Re: Dynamically set table name in onPrepare method [message #901076 is a reply to message #900927] Thu, 09 August 2012 15:41 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You can access higher elements but the problem will be that all of the
reports onPrepares happen before the elements are created. The nested
table has only one onPrepare and many onCreates. One for each instance.
The only way I see to do this is to modify the extraction js files.

Jason


On 8/9/2012 2:37 AM, Thomas Spencer wrote:
> Hi all, newbie here looking for some assistance with dynamically naming
> a table in the onPrepare method.
>
> I have a report which has a table embedded inside a group, thus for
> every instance of the group the table is repeated. If the user tries to
> export the contents of this table from the web viewer they are faced
> with a list of duplicated names for the table e.g. myTable, myTable_1,
> myTable_[x] etc...
>
> I wish to be able to dynamically name the table in each group to
> differentiate each instance of the table in the report to provide the
> user some help in selecting the correct table to export the data from.
>
> For this table I can rename statically in an onPrepare script with
> this.name = 'newTableName'.
>
> What I'm struggling with is dynamically generating a name based on where
> in the report the table is displayed i.e. under which group. I
> appreciate that the onPrepare method has no data bound and thus cant
> access its eventual contents.
>
> My questions really are these:
>
> Am I missing a straightforward solution to this?
>
> Can I access other elements higher in the Outline hierarchy to utilise
> their values or are these not bound either when evaluating the onPrepare
> script for the child table?
>
> Alternatively should I be looking at setting a parameter in an onCreate
> method of a parent table or again will this occur after the onPrepare
> for the child table?
>
> Thanks,
>
> Tom
>
>
Previous Topic:BIRT pdf report print issue in pdf complete
Next Topic:Access dataset results during report initialize
Goto Forum:
  


Current Time: Sat Oct 12 09:13:12 GMT 2024

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

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

Back to the top