Skip to main content



      Home
Home » Archived » BIRT » FW: How can I add Dataset Parameters andReport Parameters
FW: How can I add Dataset Parameters andReport Parameters [message #25387] Thu, 07 April 2005 23:42 Go to next message
Eclipse UserFriend
Eric Chen Asked the following in the birt-report-designer-dev mailing list.
I went ahead and posted the answer here in case others are interested.

Hello,
I have a question about BIRT.
After data source and data set are established, how can I add Dataset
Parameters and Report Parameters to my report?
Could you please give me a step-by-step sample?
Your help is much appreciated!

Eric Chen
Surrey Technology

Eric,

To create a data set parameter, do the following:

* Open the Data Explorer
* Find your data set and double-click it
* In your query, put an SQL parameter into your statement:

WHERE custID = ?

* Go to the parameters page. Add a parameter definition for your parameter.
Perhaps name is CustIDParam. type is number.
* Provide a default value. (Temporary need until a bug is fixed.)

To add a report parameter:

* Open the data explorer.
* Go Select the Parameters node and select New Parameter.
* Fill in the information.

If you want the user to enter a parameter value, then pass it to your query,
do the following:

* In the data set parameter, set the default value to the following
expression:

params.yourParamName
or
params["Your Param Name"]

depending on whether the name you selected is a valid JavaScript symbol. The
parameter name above is your report parameter. What you're doing is setting
a "binding" between the data set parameter and the report parameter.

Caveat: this area has been a bit buggy, and may not fully work in the build
you are using. The development team is aware of the issues and working to
resolve them.

- Paul

Paul Rogers
BIRT PMC
Re: How can I add Dataset Parameters andReport Parameters [message #25472 is a reply to message #25387] Fri, 08 April 2005 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dizfire.comcast.net

Hello Paul,

I set-up the 5/4 stable build last night (with the necessary db drivers in
the viewer\drivers directory) and started testing it out. I was pleased to
see that the designer parameter setting components are now working as expect
(i.e., it accepts the placement of parameters and applies the default value
as defined in DataExplorer\DataSets\Parameters" tab....however, the birt
viewer is not correctly applying the default value or the value via the
Report Parameters dialog....my database query log confirmed:
When testing in DataSet\Preview results pane, the DB server receives
"...where [myParam] = [DataSet\Paramter\DefaultValue]"
When previewing or running within Tomcat server, the DB server receives
"...where [myParam] = " (meaning, the value is not beign inserted in the
construction of the prepared statement.

I've attached theTomcat error log which further confirms the error is
located in the data engine package.

{BTW this error was preceeded by the following; however, I got this error
even after I removed all of the parameter settings and successfully
generated data in the report, so not sure it's relevent to the parameter
issue:
Apr 8, 2005 11:35:47 AM
org.eclipse.birt.core.framework.server.ServerPlatform <init>

SEVERE: load plugin C:\Program Files\Apache Software Foundation\Tomcat
5.5\webappsdev\viewer\WEB-INF\plugins\drivers failed

Apr 8, 2005 11:35:50 AM
org.eclipse.birt.report.engine.content.impl.MasterPageConten t
initSimpleMasterPage

WARNING: The property HeaderHeight is not set yet!

Apr 8, 2005 11:35:50 AM
org.eclipse.birt.report.engine.content.impl.MasterPageConten t
initSimpleMasterPage

WARNING: The property FooterHeight is not set yet!

}

Also I attempted your suggestion below with no improvement (rather, the
Preview Result pane now responded with an error stating "'params' not
defined").

Hope this helps.

Scott

"Paul Rogers" <progers@actuate.com> wrote in message
news:d34uqa$bol$1@news.eclipse.org...
> Eric Chen Asked the following in the birt-report-designer-dev mailing
list.
> I went ahead and posted the answer here in case others are interested.
>
> Hello,
> I have a question about BIRT.
> After data source and data set are established, how can I add Dataset
> Parameters and Report Parameters to my report?
> Could you please give me a step-by-step sample?
> Your help is much appreciated!
>
> Eric Chen
> Surrey Technology
>
> Eric,
>
> To create a data set parameter, do the following:
>
> * Open the Data Explorer
> * Find your data set and double-click it
> * In your query, put an SQL parameter into your statement:
>
> WHERE custID = ?
>
> * Go to the parameters page. Add a parameter definition for your
parameter.
> Perhaps name is CustIDParam. type is number.
> * Provide a default value. (Temporary need until a bug is fixed.)
>
> To add a report parameter:
>
> * Open the data explorer.
> * Go Select the Parameters node and select New Parameter.
> * Fill in the information.
>
> If you want the user to enter a parameter value, then pass it to your
query,
> do the following:
>
> * In the data set parameter, set the default value to the following
> expression:
>
> params.yourParamName
> or
> params["Your Param Name"]
>
> depending on whether the name you selected is a valid JavaScript symbol.
The
> parameter name above is your report parameter. What you're doing is
setting
> a "binding" between the data set parameter and the report parameter.
>
> Caveat: this area has been a bit buggy, and may not fully work in the
build
> you are using. The development team is aware of the issues and working to
> resolve them.
>
> - Paul
>
> Paul Rogers
> BIRT PMC
>
>


Re: How can I add Dataset Parameters andReport Parameters [message #25515 is a reply to message #25472] Fri, 08 April 2005 18:48 Go to previous message
Eclipse UserFriend
Originally posted by: dizfire.comcast.net

Well, I just loaded the latest milestone release and found that parameter
handling is working (with the exception of the default handling, which can
be addressed via Paul's solution below....looks good. Thanks BIRT team!
Will allow me to move forward in my effort to integrate cleanly into a
Struts app...will let you know how it works out and whether I come up with a
clean way to work around the absolute file path issue.

Scott Dismeier
"Scott Dismeier" <dizfire@comcast.net> wrote in message
news:d36i65$jsa$1@news.eclipse.org...
> Hello Paul,
>
> I set-up the 5/4 stable build last night (with the necessary db drivers in
> the viewer\drivers directory) and started testing it out. I was pleased
to
> see that the designer parameter setting components are now working as
expect
> (i.e., it accepts the placement of parameters and applies the default
value
> as defined in DataExplorer\DataSets\Parameters" tab....however, the birt
> viewer is not correctly applying the default value or the value via the
> Report Parameters dialog....my database query log confirmed:
> When testing in DataSet\Preview results pane, the DB server receives
> "...where [myParam] = [DataSet\Paramter\DefaultValue]"
> When previewing or running within Tomcat server, the DB server receives
> "...where [myParam] = " (meaning, the value is not beign inserted in the
> construction of the prepared statement.
>
> I've attached theTomcat error log which further confirms the error is
> located in the data engine package.
>
> {BTW this error was preceeded by the following; however, I got this error
> even after I removed all of the parameter settings and successfully
> generated data in the report, so not sure it's relevent to the parameter
> issue:
> Apr 8, 2005 11:35:47 AM
> org.eclipse.birt.core.framework.server.ServerPlatform <init>
>
> SEVERE: load plugin C:\Program Files\Apache Software Foundation\Tomcat
> 5.5\webappsdev\viewer\WEB-INF\plugins\drivers failed
>
> Apr 8, 2005 11:35:50 AM
> org.eclipse.birt.report.engine.content.impl.MasterPageConten t
> initSimpleMasterPage
>
> WARNING: The property HeaderHeight is not set yet!
>
> Apr 8, 2005 11:35:50 AM
> org.eclipse.birt.report.engine.content.impl.MasterPageConten t
> initSimpleMasterPage
>
> WARNING: The property FooterHeight is not set yet!
>
> }
>
> Also I attempted your suggestion below with no improvement (rather, the
> Preview Result pane now responded with an error stating "'params' not
> defined").
>
> Hope this helps.
>
> Scott
>
> "Paul Rogers" <progers@actuate.com> wrote in message
> news:d34uqa$bol$1@news.eclipse.org...
> > Eric Chen Asked the following in the birt-report-designer-dev mailing
> list.
> > I went ahead and posted the answer here in case others are interested.
> >
> > Hello,
> > I have a question about BIRT.
> > After data source and data set are established, how can I add Dataset
> > Parameters and Report Parameters to my report?
> > Could you please give me a step-by-step sample?
> > Your help is much appreciated!
> >
> > Eric Chen
> > Surrey Technology
> >
> > Eric,
> >
> > To create a data set parameter, do the following:
> >
> > * Open the Data Explorer
> > * Find your data set and double-click it
> > * In your query, put an SQL parameter into your statement:
> >
> > WHERE custID = ?
> >
> > * Go to the parameters page. Add a parameter definition for your
> parameter.
> > Perhaps name is CustIDParam. type is number.
> > * Provide a default value. (Temporary need until a bug is fixed.)
> >
> > To add a report parameter:
> >
> > * Open the data explorer.
> > * Go Select the Parameters node and select New Parameter.
> > * Fill in the information.
> >
> > If you want the user to enter a parameter value, then pass it to your
> query,
> > do the following:
> >
> > * In the data set parameter, set the default value to the following
> > expression:
> >
> > params.yourParamName
> > or
> > params["Your Param Name"]
> >
> > depending on whether the name you selected is a valid JavaScript symbol.
> The
> > parameter name above is your report parameter. What you're doing is
> setting
> > a "binding" between the data set parameter and the report parameter.
> >
> > Caveat: this area has been a bit buggy, and may not fully work in the
> build
> > you are using. The development team is aware of the issues and working
to
> > resolve them.
> >
> > - Paul
> >
> > Paul Rogers
> > BIRT PMC
> >
> >
>
>
>
Previous Topic:Comments & case studies needed for article
Next Topic:Missing data in report preview, jdbc driver issue
Goto Forum:
  


Current Time: Sat May 10 15:38:31 EDT 2025

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

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

Back to the top