adamb Posted June 29, 2010 Share Posted June 29, 2010 At my work we use a proprietary database and I am trying to figure out the proper way to connect to it through JasperServer.In order to have Jasper talk to my proproetary database I made a web service that returned an XML response. This seemed like a good idea at the time because I saw that iReport has a way to connect to that. After designing the report and using the XML web service, everything works great locally. However, I cannot get it to work on the server, in fact I cannot even define a "Remote XML Datasource" on the server.Am I going about this the wrong way? Is there a way to get Remote XML on JasperServer? The XML web service is just opening a socket to the database application, so is there a better way than the XML route?Thanks in advance. Link to comment Share on other sites More sharing options...
lucianc Posted July 2, 2010 Share Posted July 2, 2010 See http://jasperforge.org/projects/jasperserver/tracker/view.php?id=4190You can write a custom data source implementation if you want to directly access the DB.Regards,Lucian Link to comment Share on other sites More sharing options...
adamb Posted July 6, 2010 Author Share Posted July 6, 2010 Awesome link Lucian, that was perfect. I don't think I would have found that without you. Thanks!!! Link to comment Share on other sites More sharing options...
adamb Posted July 7, 2010 Author Share Posted July 7, 2010 I wanted to point out all that I did in order to get this to work because throughout the process of getting this to work I wasn't ever able to find all the answers in one spot, so here is the summary of what I did to make remote XML work on Jasper Server: Get some way to produce XML. Perhaps your database already outputs in XML or perhaps you have to write a little web service. Either way you will want to have some sort of address to point Jasper too, I used a web service through apache so it had an http://serviceAddress type of address. If you intend on passing in dynamic information to your database, such as a select statement or other parameters you need to set special parameters in the report itself. The parameters must begin with "XML_GET_PARAM_". So if you wanted to pass a variable on the GET string through http named frank, you would make a parameter called "XML_GET_PARAM_frank". Patch the server to work with remote XML. As far as I understand, this only works for Jasper Server ver 3.7.0. There are two things you must to do make this work: Patch Jasper Server ver 3.7.0 with the remote XML patch Install the xpath2 jar on Jasper Server Setup the remote XML datasource. If the patch has worked correctly, when you log into the JasperServer web interface, you will have new options when you make a new datasource (see attachment 1: ds.png). You will most likely want to use "XML File data source" option and follow the wizard. You may need to tweak settings to get the XML to work correctly, but that depends on how you've setup your XML to work. Deploy. When you deploy your report make sure that you chose the new datasource on the server that you made in step 3.I hope that helps, good luck! Link to comment Share on other sites More sharing options...
kundan.scorpio Posted December 10, 2012 Share Posted December 10, 2012 Hi Adam Can you please share the sample code example of using XML data source?I also need to use a webs-service as data source in Jasperreport. I did not find any example on the web do so. 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