Home
Analytics
How To Pass Database URL, Username, Password to Datasource to make Datasource dynamic
4robert
I am using birt-rcp-report-designer-2.2.2 to develop the report. I am new to BIRT and I have created a report that contains multiple datasource.
So. in my report I have connected each dataset to corresponding datasource. But now the problem is that Database URL of one of my datasource has been
changed and also its Username and Password has been altered. I can easily change these information in my report as I have these information. But if it
changes again in future I have to change again from the report designer. So, I like to make it dynamic.
I want to know how to pass Database URL, Username and Password to my report as a parameter so that it can be supplied by the user.
For example, if IP of my Database URL changes from 58 to 59 and then 60 I have to change the Database URL each time.
But I want to pass it through the parameter so that the user can change their IP address as they like.
I know it is a common problem, so please help me immediately to solve these one.
Thanks in Advance!
Find more posts tagged with
Comments
vishalkp
Hello Robert
I think you can use this in the Datasource's --> Property Binding --> JDBC Driver URL :
if ( params["DB"] =='1')
{
"jdbc:actuate:sqlserver://192.168.2.1;databasename=ABS";
}
else if ( params["DB"] =='2')
{
"jdbc:actuate:sqlserver://192.168.2.2;databasename=ABS";
}
esle
{
"jdbc:actuate:sqlserver://192.168.2.3;databasename=ABS";
}
Hope this might help you.
Thanks,
Vishal KP.
bhanley
There is an entry for this on the BIRT Wiki: <a class='bbc_url' href='
http://www.birt-exchange.org/wiki/BIRT:Report_Parameters/#Q:__Can_I_Bind_my_Data_Source_Connection_Properties_to_Parameters.3F'>BIRT:Report
Parameters - BIRT Wiki - BIRT Exchange</a>
4robert
Thank you all.
I am very happy to say that I have solved the problem already.