atotheroh Posted May 17, 2015 Share Posted May 17, 2015 Hello,I am an intern and I've only been working with JasperServer for a short amount of time, so please forgive me if I confuse terminology or say something stupid. I have a Java app that uses the REST API to test our reports. It simply executes them and checks for http 200 status.We want to do the same thing for the ad hoc views we have, but apparently it wasn't possible when they first created the app.I'm wondering if it is now possible with the new REST API and if so, what classes should I be looking to use?For reports, we currently use this:OperationResult<ClientResourceListWrapper> resultReport = client .authenticate(jasperusername, jasperpassword) .resourcesService() .resources() .parameter(ResourceSearchParameter.FOLDER_URI, folder) .parameter(ResourceSearchParameter.TYPE,"ReportUnit") .parameter(ResourceSearchParameter.RECURSIVE, "true") .search(); ClientResourceListWrapper reportResourceListWrapper = resultReport.getEntity();OperationResult<InputStream> reportrun = client .authenticate(jasperusername, jasperpassword) .reportingService() .report(cs.getUri()) .prepareForRun(ReportOutputFormat.HTML, 1) .run(); // InputStream report = reportrun.getEntity(); int responsestatus=reportrun.getResponse().getStatus();[/code]I can't get it to work by using .parameter(ResourceSearchParameter.TYPE,"AdhocDataView") or .parameter(ResourceSearchParameter.TYPE,"AdhocReportUnit"). For AdhocDataView, I get an error: invalid value for reportURI parameter.For AdhocReportUnit, I get a null pointer exception. Any advice is greatly appreciated. Thank you! Link to comment Share on other sites More sharing options...
ernestoo Posted May 18, 2015 Share Posted May 18, 2015 Unfortunatetly ad-hoc views can not be consumed via any REST or Visualize.js API - you will have to instead embed them in an iFrame, some of that is discussed on this wiki page: http://community.jaspersoft.com/wiki/embedding-ad-hoc-http-api 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