|
Re: Dynamic Query Passing - Possible? (Urgent) [message #222505 is a reply to message #222468] |
Tue, 06 March 2007 12:07 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: xxx.xxx.cl
Mathi wrote:
> Hello Folks
> I m using default engine and rendering my reports thru URL.
> Is there any way to pass the query text dynamically and bind it?
>
> Because I use many parameters . I handled the default parameter with % ,
> this takes long time to genearte the report in the production environment.
>
> Please suggest me , if I can pass the SQL dynamically. If so how to do?
i think you should look at the dataset's property binding feature.
|
|
|
Re: Dynamic Query Passing - Possible? (Urgent) [message #222805 is a reply to message #222505] |
Wed, 07 March 2007 13:14 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: gaston.37.com
It is possible in several ways. But none in the correct one :)
You can construct your query dynamically using javascript. You need to build
a looooooooong string by parts, replacing parameters values in a way you
database can handle the whole string (eg: 'to_date('mm/dd/yyyy','+your
parameter). That's the most popular answer I found. Note you need to deal
with data escaping, adding innecessary funcions to convert string to the
correct data type, and for me the worst: sending a completelly new query to
parse to the database.
Then, there are two more ways I haven't tried yet, but they should work:
One is to create an scripted data source. This means to build a java
class that returns an object you can use as input for your report (eg: a
java class that performs the query to the database, ibatis, jdbc, hibernate,
etc and returns a collection with the results), here you can pass parameters
and build your query as you want.
Another one is to do the same, but with a stored procedure. You pass all
your parameters to your sp and then build your query as you want, binding
only parameters you need.
All of them are bad, and seems this is not an important issue for most
people since nobody involved in the project is paying attention :)
Good luck.
"Rom
|
|
|
Re: Dynamic Query Passing - Possible? (Urgent) [message #223526 is a reply to message #222468] |
Fri, 09 March 2007 07:01 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: johnw.innoventsolutions.com
Mathi,
Yes. See the property binding tab under the data set editor. Scott
Rosenbaum from the PMC and myself just did a demonstration of this at
Eclipsecon.
Additionally, if you wanted to do this with scripting instead, you can
use the queryText property of the dataset component, so doing something
in the beforeOpen scripting event that dynamically adds to the
this.queryText will work also.
Let me know if you have any further questions,
John
Mathi wrote:
> Hello Folks
> I m using default engine and rendering my reports thru URL.
> Is there any way to pass the query text dynamically and bind it?
>
> Because I use many parameters . I handled the default parameter with % ,
> this takes long time to genearte the report in the production environment.
>
> Please suggest me , if I can pass the SQL dynamically. If so how to do?
>
> Thanks
> Regards
> Mathi
>
|
|
|
Re: Dynamic Query Passing - Possible? (Urgent) [message #224270 is a reply to message #222468] |
Mon, 12 March 2007 18:24 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: sur.sub.gmail.com
Hi Mathi,
Don't know whether you got the answer already, try this
(Copied from another post)
"
Henrique wrote:
> I am developing an Eclipse RCP Application that generates a HTML
report file using the BIRT Report Engine.
> I need to create a report with parameters in the WHERE clause (this I
have achivied with the Data Set parameters) and I need to set the Table
Name and Schema in the query as parameter too (to be set by the
application user). Is it possible? How?
2 possible solutions:
1. you specify the query text in the Data Set's Property Binding window.
2. you specify the query text in the Data Set's beforeOpen method, for
example:
this.queryText = "SELECT * FROM " + params["myParam"]
"
Another question:
I was seeing another post of you which I am unfortunately not able to
locate now. It was about passing multiple values in single report
parameter. Interested to know how you solved that as I am running into
the same problem.
Thanks,
Suresh
Mathi wrote:
> Hello Folks
> I m using default engine and rendering my reports thru URL.
> Is there any way to pass the query text dynamically and bind it?
>
> Because I use many parameters . I handled the default parameter with % ,
> this takes long time to genearte the report in the production environment.
>
> Please suggest me , if I can pass the SQL dynamically. If so how to do?
>
> Thanks
> Regards
> Mathi
>
|
|
|
Powered by
FUDForum. Page generated in 0.04519 seconds