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

JSON Data Adapter / Source REST


glenmiller

Recommended Posts

I can get the JSON Data Adapter to query a REST service by setting File / URL: in the Jasper Studio Data Adapter wizard to something like "http://127.0.0.1:8080/testrestservice".   But how do you append user provided parameters to the base url so that the url used to acutally retrieve the data would be something like "http://127.0.0.1:8080/testrestservice?name=Jack".

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thanks for the example. I am new to Jasper and can't quite figure it all out. I think I am missing some config settings.

The first difference in my tests and you file is I have a

that gets inserted by studio.

I have added the follwing

"12"

"http://127.0.0.1:8080/candidatemanager/app/rws/misc/test7?locationId=" +$P{locationId}

To use my rest service, based on what I could see from your example. But it does not seem to be overriding the file / url from the default data adapter being inserted by studio. Everytime I use preview it uses the values set in JSON file Adapter file / url text box. How do I get the url set in the parameter element above to be used instead?

Link to comment
Share on other sites

Hi Glen, the thing is that when you set the net.sf.jasperreports.json.source "by hand" you should not use the JSON data adapter (because it will effectively over-write it)...you should use --No Data Adapter -- I don't know how to select it but if you don't select one at all it will use no data adapter...I'm on JSS 6.0 btw
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...