Skip to main content



      Home
Home » Archived » BIRT » Scripted DataSEt Parameters : script access
Scripted DataSEt Parameters : script access [message #162286] Thu, 18 May 2006 06:39 Go to next message
Eclipse UserFriend
Hi all,

Does anyone know the syntaxe to axes a scripted dataset parameter withing
the event scripts (open, fetch, etc.) ?
Is it something like params["param1"], this.params["param1"] or something
like this ? I don't succeed in retrieving them.

Thank for any suggestion or doc link, Thomas.
Re: Scripted DataSEt Parameters : script access [message #162294 is a reply to message #162286] Thu, 18 May 2006 06:49 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

I have recently rised the same question, but nobody responded :-/

To me it looks like the dataset parameters are not accessible from script.
Perhaps the implementation of this is not finished yet or something. I
checked the source code briefly and couldn't find a way to access params
easily. Dataset wrapper object does not seem to expose neccessary properties
at the moment.

Could anybody give closer info?

Thanks,
Tomas

==== posted on 21.4.2006 ====
"I am trying to figure out how DataSet parameters can be accessed from
javascript code written inside Scripted DataSet.

It's known that params["paramName"] refers to global report parameters. I
suppose DataSet parameters should be accessible similar way.

Tried to issue 'parameters["paramName"]' and 'this.params["paramName"]' on
ScriptedDataSet open event, but none of them worked for me.

Any hint or reference to relevant doc is welcome."

Thanks,
Tomas

"Thomas Escolan" <thomas_escolan@yahoo.fr> p
Re: Scripted DataSEt Parameters : script access [message #162336 is a reply to message #162286] Thu, 18 May 2006 07:36 Go to previous messageGo to next message
Eclipse UserFriend
The report preview fails from the moment I put parameters in the report
(not saying linking them to scripted dataset parameters : I removed them).

Surprise : with a default value of "05/16/2006 03:37:00 PM", a "Date Time"
parameter shows up to be "5 avr. 07 03:37" in tne "Enter Parameters" box...
Removing this parameter enables back the report's preview. Is there a bug
tracked for this ??

Recreating and linking the dataset's parameters to report ones (other than
Date Time), does not break the report's preview.
Recreating the "Date Time" dataset's parameter does not break the report's
preview. Notice that I did not link it to a report's one, as this report
parameter would break the preview.
Re: Scripted DataSEt Parameters : script access [message #162344 is a reply to message #162336] Thu, 18 May 2006 07:43 Go to previous messageGo to next message
Eclipse UserFriend
As a workaround, I created a "date" parameter with "string" type in the
report.
I then created a "Date Time" parameter in the dataset with
'Date.parse(params["date"])' as a default value. Nothing failed.

Since I don't know how to retrieve the dataset's parameters in my open
script (for example), I don't know which date I actually get in fine...

Still waiting for help, Thomas.
Re: Scripted DataSEt Parameters : script access [message #162368 is a reply to message #162344] Thu, 18 May 2006 08:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Instead of parameters pass in objects with the "addScriptableJavaObject"
method of the IRunAndRenderTask object.

Thomas Escolan wrote:
> As a workaround, I created a "date" parameter with "string" type in the
> report.
> I then created a "Date Time" parameter in the dataset with
> 'Date.parse(params["date"])' as a default value. Nothing failed.
>
> Since I don't know how to retrieve the dataset's parameters in my open
> script (for example), I don't know which date I actually get in fine...
>
> Still waiting for help, Thomas.
>
Re: Scripted DataSEt Parameters : script access [message #162402 is a reply to message #162368] Thu, 18 May 2006 09:38 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, Mark,

But what would a "no parameters" dataset serve for ?
As I understand your suggestion, one has to put variables in session when
integrating the report... This is no solution to me because I only need to
test BIRT in future perspectives.

What I can see is that, despiste its 2.x versionning, BIRT as to evolve
before pretending to get a "business profitable" status. I cannot imagine
the scripting functionalities to survive with so poor context access
helpers.

Maybe in v3.0, who knows ?
Re: Scripted DataSEt Parameters : script access [message #162426 is a reply to message #162402] Thu, 18 May 2006 10:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

My project currently has 71 reports and we don't use parameters.

You don't need to put variables in session to do this.

Thomas Escolan wrote:
> Thanks, Mark,
>
> But what would a "no parameters" dataset serve for ?
> As I understand your suggestion, one has to put variables in session
> when integrating the report... This is no solution to me because I only
> need to test BIRT in future perspectives.
>
> What I can see is that, despiste its 2.x versionning, BIRT as to evolve
> before pretending to get a "business profitable" status. I cannot
> imagine the scripting functionalities to survive with so poor context
> access helpers.
>
> Maybe in v3.0, who knows ?
>
Re: Scripted DataSEt Parameters : script access [message #162469 is a reply to message #162426] Thu, 18 May 2006 11:20 Go to previous messageGo to next message
Eclipse UserFriend
OK, Mark, so BIRT is fullfilling your needs : I'm glad for you

My needs require parameters and heavy scripting ; and I'm not quite sure I
can rely on BIRT for the moment. That's no big deal, it's promising and
I'm sure the open source model will, once again, make miracles.

It was no deep criticising, just a report on current usability.
regards, Thomas.
Re: Scripted DataSEt Parameters : script access [message #162542 is a reply to message #162469] Thu, 18 May 2006 12:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

> OK, Mark, so BIRT is fullfilling your needs : I'm glad for you

I was replying to your point of "But what would a "no parameters"
dataset serve for ? ". I'll admit BIRT is far from perfect.


> My needs require parameters and heavy scripting ; and I'm not quite
>sure
> I can rely on BIRT for the moment. That's no big deal, it's promising
> and I'm sure the open source model will, once again, make miracles.

Are you using the standard BIRT Viewer? Or are you calling the
viewer/generator from your own code? Are you using scripted datasources
or JDBC datasources?

>
> It was no deep criticising, just a report on current usability.
> regards, Thomas.
>

Maybe it is a cultural thing, but your comments seem highly
critical/criticizing. Not that they lessen the reality of what you are
saying.
Re: Scripted DataSEt Parameters : script access [message #162589 is a reply to message #162286] Thu, 18 May 2006 13:51 Go to previous messageGo to next message
Eclipse UserFriend
Thomas,

Data Set parameters, for scripted data set was pushed back to RC3 I believe.
I checked bugzilla and that was the last entry for this request. That said,
the GUI for RC2 obviously has the capability. I am checking more into the
status and will post here when I know.

Jason

"Thomas Escolan" <thomas_escolan@yahoo.fr> wrote in message
news:aba912de08df597a3a78100a763b218f$1@www.eclipse.org...
> Hi all,
>
> Does anyone know the syntaxe to axes a scripted dataset parameter withing
> the event scripts (open, fetch, etc.) ?
> Is it something like params["param1"], this.params["param1"] or something
> like this ? I don't succeed in retrieving them.
>
> Thank for any suggestion or doc link, Thomas.
>
Re: Scripted DataSEt Parameters : script access [message #162793 is a reply to message #162542] Fri, 19 May 2006 03:56 Go to previous messageGo to next message
Eclipse UserFriend
For the moment, as I am evaluating the technologie, I'm only working
within Eclipse, with scripted datasources. But the aim is to incorporate
it a web application and JDBC connection.

Let me just clear a point : my main critics are about the informations we
get (or not) : API doc, tutorials, demos. I never heard about BIRT before
it's second version, and the docs I got looks like a mess ; you hardly
know which versions are concerned, and the RC distributions contain such
appealing improvings that I cannot imagine working with previous "stable
releases".

Saying so, please note that I'm not (too much) complaining about found
around bugs. And I'm sure that the herein contributions (mine and other's)
will help detecting users needs and remaining bugs.
Once again, I'm putting many hopes on the short coming books and quick
evolving about BIRT.

Regards,
Re: Scripted DataSEt Parameters : script access [message #165323 is a reply to message #162589] Mon, 29 May 2006 05:18 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jason,

I got the RC3 and wondered if you finally had an answer about this pb as
you said you'll follow it.
Thanks in advance, Thomas.
Re: Scripted DataSEt Parameters : script access [message #165806 is a reply to message #165323] Tue, 30 May 2006 17:37 Go to previous messageGo to next message
Eclipse UserFriend
Thomas,

I have checked RC3 and it appears they didnt make it.
RC4 is out this week. I will update the thread if the feature is in.

Jason

"Thomas Escolan" <thomas_escolan@yahoo.fr> wrote in message
news:4082532bf4993140801a62e9ef437b57$1@www.eclipse.org...
> Hi Jason,
>
> I got the RC3 and wondered if you finally had an answer about this pb as
> you said you'll follow it.
> Thanks in advance, Thomas.
>
Re: Scripted DataSEt Parameters : script access [message #225865 is a reply to message #165806] Fri, 16 March 2007 09:52 Go to previous message
Eclipse UserFriend
Originally posted by: dberman.tamaleresearch.com

I'm confused by this thread. It's my understanding that this thread is
asking how you can access parameters passed to a scripted dataset from
within the javascript for the events for that DataSet. An example of
this would be a Master-Detail report where one dataset will have a value
in a row that will drive a nested sub-table. You can certainly do this
in BIRT:

1. Edit your dataset. Click on the Parameters tab on the left. Click
NEW to declare a new parameter. Make sure to assign a default value,
for a string use "".
2. Add your nested table (the master-detail relationship, otherwise
known as sub-table or correlated sub-query): Go to your report layout.
Add a Table for your first dataset (the Master). Inside your table
add a second detail row and drop another Table inside it. Associate the
second Table with your second (detail) dataset.
3. Define the relationship between master and detail records: Click on
the grid for your details dataset. In the property editor, select the
Binding tab. You should see that Data Set: has the name of your detail
scripted dataset selected. Click on the Dataset Parameter Binding
button. The DataSet parameter you defined in step 1 will appear. Click
on it to select it, then click the Edit button. For the value, enter
something like this: row["MasterTablePrimaryKey"] . Your nested
table is inside a parent table, so row["xxx"] will be replaced with the
value from the parent table in field xxx from the dataset associated
with the parent row.
4. Leverage the parameter in your scripted dataset:
/* In my script: */
PrimaryKeyFromParent = inputParams["NameOfDatasetParameter"];

Notice that DataSet parameters use the collection inputParams
whereas report parameters use the params set. Don't get them confused.


I beleive this does exactly what you want.

Jason Weathersby wrote:
> Thomas,
>
> I have checked RC3 and it appears they didnt make it.
> RC4 is out this week. I will update the thread if the feature is in.
>
> Jason
>
> "Thomas Escolan" <thomas_escolan@yahoo.fr> wrote in message
> news:4082532bf4993140801a62e9ef437b57$1@www.eclipse.org...
>> Hi Jason,
>>
>> I got the RC3 and wondered if you finally had an answer about this pb as
>> you said you'll follow it.
>> Thanks in advance, Thomas.
>>
>
>
Previous Topic:Alignment of multiple charts
Next Topic:RunReport.java example question?
Goto Forum:
  


Current Time: Sun Jul 27 14:30:57 EDT 2025

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

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

Back to the top