bybruno_2500 Posted November 16, 2014 Share Posted November 16, 2014 hello,any one have a sample that work with the api and request a pdf report but canchange the connection string? I want work with diferent databases each time i request the same report.thanks for your helpJason, Link to comment Share on other sites More sharing options...
Solution nthapa Posted December 1, 2014 Solution Share Posted December 1, 2014 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 More sharing options...
bybruno_2500 Posted December 2, 2014 Author Share Posted December 2, 2014 hello, thanks for your reply,i have seen this link: https://d2553lapexsdrl.cloudfront.net/sites/default/files/docs/jasperreports-server-web-services-guide.pdfmaybe is this what you are talking about, but thi is only for the commercial edition? i have the free version,thanks for your help,Jason Link to comment Share on other sites More sharing options...
calculate.machine Posted January 21, 2015 Share Posted January 21, 2015 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 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