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

Setting Datasource parameters dynamically


mayuri.kadam
Go to solution Solved by elizam,

Recommended Posts

Hello Team,

I am new to Japser Server. 

What I am trying to do is create a report that will prompt the user to enter Datasourse connection properties like JDBC driver, dbname, URL, username and password etc, and then connect to that database. On that database it should run the SQL query I have defined in my parent report.

Please help how I can go about implementing this in JasperStudio/Server.

 

Thanks in advance!

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

You can't do this directly in JasperReports Server.  I believe you could change the action when the report is opened and create an extra dialog that takes the info you want and then uses the REST API to set the datasource. That would take some programming.

You can instead attributes to set up a data source that takes information about the server/organization/user and selects the actual database based on those settings. That means that a user will only be able to access one database for that report, but that is the most common use case. (And the user won't have to know their database info.) 

http://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v630/attributes-data-source-definitions

http://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v630/managing-attributes

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...