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)
DB parameteers for working in different environments
kumaresh
Hi.. am new to BIRT.
My working environment is like having different environments where in one we develop reports and test it locally. There is a separate dummy database for this environment. Next we deploy the reports in another environment where the database connection is different.
Is there any procedure to make the report file to identify the working environment and hence, get the database connection parameters automatically from a Java class or a library file on its own?
Find more posts tagged with
Comments
JasonW
You have a lot of different choices here. You can retrieve a session variable and set the parameters based on that using some beforeOpen script. You could also use a connection profile which stores the connection information in a separate file which would allow you to put one connection profile in dev and another in production.
Jason
kumaresh
Hi
Setting up the parameters through beforeOpen method seems good. If possible, could you please explain how to store connection profile of multiple environments in a separate config file and connect it to BIRT report?
Thanks in advance!
JasonW
If you design a connection profile you can set its location at runtime. For example suppose you wanted to put the connection profile in the resource folder of each environment. You could set the location in script like:
if( !reportContext.getHttpServletRequest().getAttribute("attributeBean").isDesigner() ){
myresourcefolder = reportContext.getDesignHandle().getResourceFolder()
this.setExtensionProperty("OdaConnProfileStorePath", myresourcefolder+"/myprofile.txt");
}
Jason