Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Binding Data Source properties
fox802
Hello everybody,<br />
<br />
I deployed Birt Report Engine on an OC4J container to be accessible by all the others instances deployed on the server.<br />
The application is in Java and it launches the reports by its URL. (so the application launches IE with the URL of the report)<br />
<br />
For many hours now, I'm trying to bind the properties of the Data Source to evoid to multiply the number of my reports by the number of environments I have.<br />
<br />
So, after looking in this forum and on Google, I found that I needed to :<br />
1- bind the property of the DataSource via the "Property Binding" screen (for exemple : User Name : params["UserName"]<br />
2- apply the binding in the BeforeOpen section of the DataSource script (for exemple : <pre class='_prettyXprint _lang-auto _linenums:0'>this.setExtensionProperty("OdaUser",params["UserName"].value);</pre>
<br />
First : may you tell me if it is the correct way to do it so far ?<br />
<br />
Second : I didn't find the way to give the paramaters to the report. Can you please help me ?<br />
<br />
Regards
Find more posts tagged with
Comments
JasonW
That should work. To set the parameter you can just add &UserName=value to the url.
Make sure UserName is a report parameter as well.
Jason
fox802
Thanks Jason for your answer.<br />
<br />
So I added the three parameters to access the databases. I also put default parameters.<br />
<br />
It works fine when I launch the report without parameters in the URL (so I think it's using the default parameters)<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>http://localhost:8899/birt/frameset?__report=testaircraft.rptdesign</pre>
but no access to the datas when I give the parameters of the second database in the URL.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>http://localhost:8899/birt/frameset?__report=testaircraft.rptdesign&UserName=prod&Password=toto&URL=jdbc:oracle:thin:
@localhost
:1521:xe</pre>
<br />
Here the code I put in the beforeOpen section of the Data Source <pre class='_prettyXprint _lang-auto _linenums:0'>this.setExtensionProperty("OdaUser",params["UserName"].value);
this.setExtensionProperty("odaURL",params["URL"].value);
this.setExtensionProperty("odaPassword",params["Password"].value);</pre>
<br />
<br />
Maybe this isn't enough ?
fox802
And it is enough !!!
The problem was in the Data Sets. To make the queries, I used the mouse to copy/paste the name of the tables or fields. It was for once a bad idea to be lazy and not write the query myself !
By doing that, the system automatically puts the name of the schema as prefix...
That's why I haven't any access to the datas !
So thank you very much for your help.
Regards
Fabien