Jump to content
We've recently updated our Privacy Statement, available here ×

DATA ADAPTER dynamic


gcarissimo_2

Recommended Posts

Hello
I am ramping with JasrperReport and jasperserver, is there any way to parameterize the Dataadapter to the main report? Via the url eg: ..... pdf? REDPORT_CONNECTION = myDB
 
Assuming we run a report and have more than one data source eg:
 
Report: MyReport01
DataSources: DS01 - JDBC Oracle
DataSources: DS01 - JDBC Postgres
 
Both data sources have the same data schemas.
 
I can at run time change the datasource
 
Execution 1: MyReport01 with DS01
Run 2: MyReport01 with DS02
 
Without having to do a deploy for each datasorce

 
 
 
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

May be you can create 2 subreports and play with the default data adapters.

  1. Create a main report with 2 groups. one for the MyReport01 with DS01 & another for MyReport01 with DS02.
  2. Create a parameter with two values DS01 & DS02. Hide the groups accordingly on the basis of this parameter.
  3. Create MyReport01 with DS01 as the default data adapter and place it in main report
  4. Create MyReport01 with DS02. as the default data adapter and place it in main report

The process for creating default data adapters is as follows:

its a bit complicated and you need to put the xml datasource files on top of the server. the downside of this process is that whenever you change the credentials, you need to update the xml files on the server.

  1. The  jdbc drivers are to be placed in this location - jasperreports-server-cp-6.2.0apache-tomcatwebappsjasperserverWEB-INFlib
  2. A datasource xml file with the jdbc driver and credentials will be deployed onto the jasperserver webapp at this location - jasperreports-server-cp-6.2.0apache-tomcatwebappsjasperserver
  3. The jrxml will reference the above mentioned datasource xml file in default data adapter section
Link to comment
Share on other sites

I think I did not explain correctly, what I need is a power report at runtime, be able to fit the datasorce to refer to in the JasperServer, the same report can run it in X datasources, changing the DS at runtime.

 
My English is very bad I'm using Google Translator, my native language is Spanish
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...