Jasper Ideas

Pass the datasource as input control in jasper reports

Dear All,

We are having multiple jdbc data source with same report structure in our jasper server, currently we have separated the report for each data source instead of this we need to pass the data source as parameter/input control it will help us to save lot of timings and man effort.

  • Rajasekar Baskaran
  • May 11 2022
  • To be Reviewed
Components JasperSoft Studio, JasperReports Server, RestAPI, Input Controls
  • Attach files
  • Johannes Held commented
    13 May 06:55am

    Hi,


    you have multiple options here:

    • Use subreports for the actual heavy lifting and create the correcet Data Connection ‘on the fly’ based on given parameters. You might even code a JNDI Lookup into that.

    • Set attributes key-values (level host, tenant or user) and use them in your data source definition.
      Then, your logged in user defines the connection to the data.