Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How can i change dynamically a dataset ?
How can i change dynamically a dataset ? [message #200510] Mon, 13 November 2006 08:36 Go to next message
Eclipse User
Originally posted by: esteban27.free.fr

Hi,

I need to change dynamically (by script) the dataset binding parameter of
a table ?

Someone can help me pls ?

Stephane
Re: How can i change dynamically a dataset ? [message #200576 is a reply to message #200510] Mon, 13 November 2006 11:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you give more information on what you are wanting to do?
You should be able to use the expression builder on the binding tab for the
parmater to enter an expression that dynamically changes the value.

Jason

"Stephane" <esteban27@free.fr> wrote in message
news:5b786df9cde58dd085519a46b2db5c6f$1@www.eclipse.org...
> Hi,
>
> I need to change dynamically (by script) the dataset binding parameter of
> a table ?
>
> Someone can help me pls ?
>
> Stephane
>
Re: How can i change dynamically a dataset ? [message #200603 is a reply to message #200576] Mon, 13 November 2006 12:27 Go to previous messageGo to next message
Eclipse User
Originally posted by: esteban27.free.fr

Hi Jason,
I have a table and i want to change the dataset binding to mytable,
compare to a report parameter !

So if my report parameter is true i want to bind my table to mydataset
else i want to bind my table to 'none' (i dont want to see mytable AND i
dont want to execute the dataset)!

This by script like :
if (my report parameter) {
this.setDataset("MyDataSet");
}else{
this.setDataset("NONE");
} in the oncreate event of my table

I know i can use the Visibility properties of my table with 'For specifics
outputs' but i dont want to execute the query of my dataset !

Thanks

Stephane
Re: How can i change dynamically a dataset ? [message #200611 is a reply to message #200603] Mon, 13 November 2006 15:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ok you can do this one of two ways. The first is the easiest.
1 - Simply put a piece of code in the beforeFactory like this:

reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "table1").drop();

Make sure you name the table.

2 - Create a duplicate dataset that returns no rows and put code in the
beforeFactory like this:
reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "table2").setProperty("dataSet",
"Data Set1");



Jason



"Stephane" <esteban27@free.fr> wrote in message
news:befda40f86a33b983ddce7e3bdaeed58$1@www.eclipse.org...
> Hi Jason,
> I have a table and i want to change the dataset binding to mytable,
> compare to a report parameter !
>
> So if my report parameter is true i want to bind my table to mydataset
> else i want to bind my table to 'none' (i dont want to see mytable AND i
> dont want to execute the dataset)!
>
> This by script like :
> if (my report parameter) {
> this.setDataset("MyDataSet");
> }else{
> this.setDataset("NONE");
> } in the oncreate event of my table
>
> I know i can use the Visibility properties of my table with 'For specifics
> outputs' but i dont want to execute the query of my dataset !
>
> Thanks
>
> Stephane
>
Re: How can i change dynamically a dataset ? [message #200793 is a reply to message #200611] Tue, 14 November 2006 11:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: esteban27.free.fr

Thanks Jason

Ok i see, i do it :
" reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "TableSco").drop();
in the beforeFactory"

but i have this error : "getReportRunnable is not a function"

"Caused by: org.mozilla.javascript.EcmaError: TypeError: getReportRunnable
n'est pas une fonction (<inline>#2)"

I forgot something ?

Stephane
Re: How can i change dynamically a dataset ? [message #200833 is a reply to message #200793] Tue, 14 November 2006 17:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

What version of BIRT are you running?

Jason

"Stephane" <esteban27@free.fr> wrote in message
news:23818e0a062f5e5867edcdc8c04dad0d$1@www.eclipse.org...
> Thanks Jason
>
> Ok i see, i do it :
> " reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "TableSco").drop();
> in the beforeFactory"
>
> but i have this error : "getReportRunnable is not a function"
>
> "Caused by: org.mozilla.javascript.EcmaError: TypeError: getReportRunnable
> n'est pas une fonction (<inline>#2)"
>
> I forgot something ?
>
> Stephane
>
Re: How can i change dynamically a dataset ? [message #200924 is a reply to message #200833] Wed, 15 November 2006 03:38 Go to previous messageGo to next message
Eclipse User
Originally posted by: esteban27.free.fr

Hi Jason

I have Birt 2.0.0

Thanks

Stephane
Re: How can i change dynamically a dataset ? [message #200993 is a reply to message #200924] Wed, 15 November 2006 12:42 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I dont think those functions where added until Birt 2.1.1

Jason

"Stephane" <esteban27@free.fr> wrote in message
news:9b11c4372b99a051e1019e18d5727f09$1@www.eclipse.org...
> Hi Jason
>
> I have Birt 2.0.0
>
> Thanks
>
> Stephane
>
Previous Topic:Converting counters to rates
Next Topic:configurable url
Goto Forum:
  


Current Time: Thu Jul 31 15:53:57 EDT 2014

Powered by FUDForum. Page generated in 0.02465 seconds