Skip to main content



      Home
Home » Archived » BIRT » Parameterized Query
Parameterized Query [message #166724] Thu, 01 June 2006 12:57 Go to next message
Eclipse UserFriend
I'm in the process of converting a Jasper report to BIRT. In the Jasper
report, I have a query that changes at runtime to add the following to
the WHERE clause as follows:

($P{organizationID}==null) ? ("") :
("AND bo_org.Organization_id in
(SELECT id FROM GET_CHILD_ORGANIZATIONS('"+$P{organizationID}+"')) " )

Where $P{organizationID} is the parameter passed into the report. How
would I go about implementing the same "conditional" statement to the
WHERE clause in BIRT?
Re: Parameterized Query [message #167085 is a reply to message #166724] Fri, 02 June 2006 11:00 Go to previous message
Eclipse UserFriend
George Handin wrote:
> I'm in the process of converting a Jasper report to BIRT. In the Jasper
> report, I have a query that changes at runtime to add the following to
> the WHERE clause as follows:
>
> ($P{organizationID}==null) ? ("") :
> ("AND bo_org.Organization_id in
> (SELECT id FROM GET_CHILD_ORGANIZATIONS('"+$P{organizationID}+"')) " )
>
> Where $P{organizationID} is the parameter passed into the report. How
> would I go about implementing the same "conditional" statement to the
> WHERE clause in BIRT?

In asking others, I think I've found "one" solution. Again, if there is
a better one, please let me know.

In the Report Design view, I create an empty data set. Then I click the
"Script" tab and select "beforeOpen" to manually generate the query by
building populating the queryText variable with the data needed.

The only reference to this "queryText" variable is found in section
labeled "OdaDataSet" of the BIRT Help. But I would have never come to
this solution on my own reading just this page. Is this feature
documented anywhere else?
Previous Topic:Oracle (OC4J) Deployment
Next Topic:2 columns of detail rows
Goto Forum:
  


Current Time: Fri Apr 18 21:05:37 EDT 2025

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

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

Back to the top