|
Re: How to use URL parameters in SQL query? [message #132364 is a reply to message #132037] |
Fri, 17 February 2006 16:19 |
|
First create the dataset with a query and dataset parameter.
select * from mytable where myfield = ?
Select the dataset parameter and verify the type.
Add a report parameter that matches the dataset parameter.
use your dataset on a table or list.
Select the binding tab on the table or list.
Your dataset parameter will show up in the list with the default value you
used in the query.
Change the value (Still on the binding tab) to params["parametername"] (this
is the report parameter).
Jason
"Mr. Burns" <Mr._Burns@web.de> wrote in message
news:dt412v$4gu$1@utils.eclipse.org...
> Hello,
>
> I don't know where to start.
> I have a report I which want to start with an URL parameter like follows:
>
> e.g.: /birt-viewer/run?format=html&__report=myreport.rptdesign &myparam=1
>
> Now I want to evaluate the parameter myparam in my reports database query
> like follows:
>
> select * from mytable where myfield = myparam;
> where myparam comes from the URL.
>
> So the query should result in: select * from mytable where myfield = 1;
>
> Can anyone lead me into the right direction how to achieve this?
>
> Thanks a lot!
>
|
|
|
|
|
Re: How to use URL parameters in SQL query? [message #132933 is a reply to message #132687] |
Mon, 20 February 2006 17:22 |
|
There is a parameters button on the Select Data of the graph that you can
put the
params["ParameterName"] in. This will give an error at design time, but
will work when you run it.
Jason
"Mr. Burns" <Mr._Burns@web.de> wrote in message
news:dtc4vj$dn8$1@utils.eclipse.org...
> Hello,
>
> ...or can I modify the SQL query using scripting?
>
> Something like:
>
> queryText = "select * from MyTable where MyField = " + myparam;
>
> How it is correct? Where I must place such code?
>
> Thanks for any help!
>
>
>
|
|
|
|
Re: How to use URL parameters in SQL query? [message #133641 is a reply to message #133168] |
Tue, 21 February 2006 16:26 |
|
You can do it the old way. I dont know that either is better.
If you want to use the parameters on the chart:
Choose the select data button
click the radial to Use Data Set (Choose your dataset)
select the parameters button (your data set parameter should show up there)
click on the value and enter params["ParameterName"]
This procedure effectively does the bind.
You will get an error at design time, but it should work at runtime.
Jason
"Mr. Burns" <Mr._Burns@web.de> wrote in message
news:dtegas$d1$1@utils.eclipse.org...
> Hello Jason,
>
> thanks fo your reply! I found the parameters button you mentioned but
> don't know how to use.
> I can create a dataset parameter, and select it by the parameters button
> you mentioned but don't know how to bind it to the report parameter,
> remember I just have a chart so no list or table where I can choose the
> binding tab.
> What about my idea to choose scripting like under a previous version of
> BIRT (before 2.0.0) ther was a possibility to use:
>
> queryText = "select * from myTable where myField = " + params["myParam"];
>
> Or is the dataset binding the right way to go with?
>
> Any further help?
>
> PS:
> BIRT 2.0.0 is really a fine thing, but if the documentation is behind the
> release than the users of BIRT don't know how to use the new features and
> then they get unsatisfied because everyting one wants to achieve is to do
> by try and error, and this is really timeconsuming, unprofessional and of
> less success.
> And posting every problem here into the newsgroups cannot be the solution,
> or waht do you think?
> So WHEN please the documentation gets updated as well?
> See also my post: ROM_Scripting_SPEC.pdf still from May 2005 (from
> 2005-02-20) or pass it to the related BIRT team member please.
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03784 seconds