Passing Parameters [message #175491] |
Thu, 06 July 2006 02:59  |
Eclipse User |
|
|
|
Originally posted by: karthi_mit.rediffmail.com
Hello folks,
So far I was using RCP designer only.Now I m using Report Engine API.
Can any one of you guide me how to pass parameters dynamically to the
engine and through which of the class and render report.
Thanks in advance..
Karthi
|
|
|
complex sql query statement [message #178857 is a reply to message #175491] |
Wed, 19 July 2006 10:32   |
Eclipse User |
|
|
|
greetings folks!
when creating custom reports i find it easier sometimes to modify the
report XML directly, after generating a basic layout to start with via
Eclispe.
in a current project i have an xml tag set like so:
<property name="queryText">select p.name,p.vorname, left(p.name,1)
firstletter from PERSONEN p WHERE (left(p.name,1) >= 'D')
</property>
and this works as expected, giving me all the people in the table
starting with 'D' and going up the alphabet. so far so good!
but if i try to add an 'AND (left(p.name,1) <= 'F')' to the end of the
query string to create a range of names, the birt viewer (accessed via
/run?__report=/home/hades/report23b.rptdesign) gives me:
'The design file /home/hades/report23b.rptdesign has error and can not
be run.'
the same query run directly in phpMyAdmin on the same MySQL database
returns the expected results, so i know the query is not at fault here.
does BIRT have a special syntax for SQL queries like this, or perhaps a
limited sub-set?
thanks for your time!
-jimm (jimm.pratt@linstep.de)
|
|
|
Re: complex sql query statement solved!... sorta [message #179073 is a reply to message #178857] |
Thu, 20 July 2006 07:29  |
Eclipse User |
|
|
|
Jimm Pratt wrote:
> <property name="queryText">select p.name,p.vorname, left(p.name,1)
> firstletter from PERSONEN p WHERE (left(p.name,1) >= 'D')
> </property>
>
it turns out i was close: the proper statement should be:
<property name="queryText">
select p.name,p.vorname, left(p.name,1) firstletter from PERSONEN p
WHERE left(p.name,1) BETWEEN 'A' AND 'D'
</property>
....and that (using BETWEEN instead of basic boolean math) works like a
charm!
next issue: passing parameters into the query.
while the above works great, it's still 'hardcoded' for each report.
i'm hoping to pass parameters the way the test.rptdesign receives them
via 'params["sample"]' command found in that report:
<expression name="valueExpr">params["sample"]</expression>
sample is apparently grabbed from the report url like so:
/path/to/report/test.rptdesign&sample=my+parameter
but when making changes to my report:
<property name="queryText">
select p.name,p.vorname, left(p.name,1) firstletter from PERSONEN p
WHERE left(p.name,1) BETWEEN 'params["from"]' AND 'params["to"]'
</property>
....and using a url constructed like so:
/path/to/report/report.rptdesign&from=A&to=D
....it appears to return a blank dataset, as if the parameters are not
being changed (ie: params["from"] is not being converted to A)
any hints? suggestions? comments? all is appreciated!
thanks again for your time!
-jimm
|
|
|
Powered by
FUDForum. Page generated in 0.28430 seconds