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

Work with diferent datasources using API


bybruno_2500
Go to solution Solved by nthapa,

Recommended Posts

  • 3 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

If I am not wrong, what you are looking for is feature we call user attributes/ profile attribute, that lets you define differenet user specific value for different attribute. And use can use those attribute to define datasources and so forth. Those attributes are referenced as {attribute('attributeName')}. Please review JasperReports-Server-Web-Services-Guide.pdf, with JRS 6.0 that feature has been even more enhanced, but for your requirement earlier vesion should work as well.

 

 

Link to comment
Share on other sites

  • 1 month later...

There is no convenient way to realize dynamic datasources Jasper, let alone the free version. In this case you have to create a user-defined datasource. Alternatively, you can try esProc. The script is as follows:


result ${sCode}.query("select * from sales where OrderDate>=? and OrderDate <=?",begin,end)


 


In the report, assign parameter sCode with myDB1 to connect to Oracle database, or with myDB2 to connect to MYSQL database.


 


Of course you can write code to connect to different datasources. For more details, see http://blog.raqsoft.com/?p=2528 .


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