Jump to content
Changes to the Jaspersoft community edition download ×

Possible to execute saved ad hoc views with REST client?


atotheroh

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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