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

rest_v2 ReportExecutionRequest async issue


clive.haynes_1

Recommended Posts

public class TestAsyncExportReportOutputCSV extends Assert {private static String sTestReport = "/ARC/Reports/Test_report";private static final String sOUTPUT_FORMAT = "html";@Testpublic void TestAsyncExportReportOutputCSV() {   RestClientConfiguration configuration = RestClientConfiguration.loadConfiguration("url.properties");   JasperserverRestClient client = new JasperserverRestClient(configuration);        Session session = client.authenticate("jasperadmin", "jasperadmin");        ReportExecutionRequest request = new ReportExecutionRequest();                             ReportParameter parameter = new ReportParameter();        parameter.setName("Trigramme");        List<String> values = new ArrayList<String>();        values.add("ARC");        parameter.setValues(values);               ReportParameters parameters = new ReportParameters();        List<ReportParameter> reportParameters = new ArrayList<ReportParameter>();        reportParameters.add(parameter);        parameters.setReportParameters(reportParameters);               request.setReportUnitUri(sTestReport);        request            .setParameters(parameters)                .setAsync(true)                .setOutputFormat(sOUTPUT_FORMAT);               OperationResult<ReportExecutionDescriptor> operationResult =         session //pay attention to this, all requests are in the same session!!!         .reportingService()         .newReportExecutionRequest(request);           ReportExecutionDescriptor reportExecutionDescriptor =  operationResult.getEntity();       assertNotNull(reportExecutionDescriptor);          OperationResult<ReportExecutionDescriptor> executionDetails = session       // pay attention to this, all requests are in the same       // session!!!       .reportingService()       .reportExecutionRequest(         reportExecutionDescriptor.getRequestId())       .executionDetails();     ReportExecutionDescriptor descriptor = executionDetails.getEntity();     List mylist = descriptor.getExports();     Iterator itt = mylist.iterator();     System.out.println(reportExecutionDescriptor);     while (itt.hasNext()) {      ExportDescriptor ff = (ExportDescriptor) itt.next();      System.out.println(ff.getId());      assert (sOUTPUT_FORMAT.equals(ff.getId()));     }         assertNotNull(descriptor);     System.out.println(descriptor.toString());                    session.logout();}}[/code]

Hi there I have an issue with the following code using rest_V2 . It appears that in the ExportDescriptor that is returned the id is not the outputformat requested but an id like this

ExportDescriptor{id='725bd66c-d606-40f5-985b-62deb1477f3e',

Can someone please explain why I get this error please. I have instaled jasperserver on 3 different platforms and 4 servers and only one of the servers works correctly.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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