gcarissimo_2 Posted December 13, 2016 Share Posted December 13, 2016 HelloI 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: MyReport01DataSources: DS01 - JDBC OracleDataSources: DS01 - JDBC Postgres Both data sources have the same data schemas. I can at run time change the datasource Execution 1: MyReport01 with DS01Run 2: MyReport01 with DS02 Without having to do a deploy for each datasorce Link to comment Share on other sites More sharing options...
reportdev Posted December 13, 2016 Share Posted December 13, 2016 May be you can create 2 subreports and play with the default data adapters.Create a main report with 2 groups. one for the MyReport01 with DS01 & another for MyReport01 with DS02.Create a parameter with two values DS01 & DS02. Hide the groups accordingly on the basis of this parameter.Create MyReport01 with DS01 as the default data adapter and place it in main reportCreate MyReport01 with DS02. as the default data adapter and place it in main reportThe 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.The jdbc drivers are to be placed in this location - jasperreports-server-cp-6.2.0apache-tomcatwebappsjasperserverWEB-INFlibA 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-tomcatwebappsjasperserverThe jrxml will reference the above mentioned datasource xml file in default data adapter section Link to comment Share on other sites More sharing options...
gcarissimo_2 Posted December 13, 2016 Author Share Posted December 13, 2016 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 More sharing options...
hozawa Posted December 14, 2016 Share Posted December 14, 2016 Have you looked at the following thread?http://community.jaspersoft.com/questions/826000/change-datasource Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now