Skip to main content



      Home
Home » Archived » BIRT » make the query dynamic???
make the query dynamic??? [message #202032] Mon, 20 November 2006 22:07 Go to next message
Eclipse UserFriend
Originally posted by: keeling040982.yahoo.com

hi...

i am using the birt2.1.1 to design my report template and using the
jbossIDE1.5 with the eclipse3.0 to run my system togather with the
jboss-4.0.2

now i wish to display the data in my report based on the filter that i
declare at the ".java"...

how can i make the query in the birt dynamic?? means that i can filter the
report data as i wish like limit the report date>1/11/2006 or report date
between 1/10/2006 and 1/11/2006 and so on...

what i done is,
at the birt2.1.1, i write the query like "select * from inventory";
at the ".java" where i make the filter, i pass the query as i wish like
"select * from inventory where date>1/11/2006"

but when i run whole system, the report will display all the data as the
query in the birt2.1.1 ("select * from inventory")...the data display in
report is not filter by the date>1/11/2006...

anyone can help me??? thanks....
Re: make the query dynamic??? [message #202056 is a reply to message #202032] Tue, 21 November 2006 02:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: karthi_mit.rrediffmail.com

Use Parameters.
Re: make the query dynamic??? [message #202070 is a reply to message #202056] Tue, 21 November 2006 02:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: keeling040982.yahoo.com

hai...KP...

thanks for your suggestion by using the parameter to make the query
dynamic.
could you please show me the clearly way how to make it??

i try to make the query dynamic, where i define at the beforeOpen method
as below:

this.quereyText="Select * from sp_inventory " + params["UPDATE_ON"];

but i still can't get the filtering for my data in the report.
is that i forgot any step???

thanks...
Re: make the query dynamic??? [message #202121 is a reply to message #202070] Tue, 21 November 2006 07:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: karthi.rediffmail.com

ok . Write ur query as like select * from inventory where inventory_id = ?

Then in the design of the report , add a parameter.

Define a default value , say for eg % .

Then while calling the report , u attach the parameter value.
If u hav any value then that will be considered , if not default value
will be taken.

Try this.

Kp
Re: make the query dynamic??? [message #202286 is a reply to message #202121] Tue, 21 November 2006 19:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: keeling040982.yahoo.com

hai KP...

but now the problem is i not using the birt viewer to view the report.
when i run my whole system, i am using the java to pass the parameter...

as your reference, i am using:
birt 2.1.1
eclipse3.0
jbossIDE1.5
jboss-4.0.2

so how can i get the parameter that i wish to pass as a filter for the
report from the java into the birt report query?? i can pass it into the
report but the birt report cant get it as the filter...

what have i done is, i call the beforeOpen method to call the query as:
this.queryText="select....+[param....];

but still have the problem to filter the report data as i wish...
any ideas on it????

thanks ya~
Re: make the query dynamic??? [message #202351 is a reply to message #202286] Wed, 22 November 2006 02:29 Go to previous message
Eclipse UserFriend
Originally posted by: karthi.rediffmail.com

Hi,
In the query string u need to attach the parameter along with the value
while calling the report.
Previous Topic:cannot find parameter names in DataSetParameters of ODA data source
Next Topic:Slow dataset definition
Goto Forum:
  


Current Time: Sun May 11 10:27:21 EDT 2025

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

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

Back to the top