Jump to content
Changes to the Jaspersoft community edition download ×

Need help connecting to a non-standard datasource


adamb

Recommended Posts

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

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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:

  1. 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.
    1. 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".
  2. 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:
    1. Patch Jasper Server ver 3.7.0 with the remote XML patch
    2. Install the xpath2 jar on Jasper Server
  3. 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.
  4. 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

  • 2 years later...

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