Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled Jasper Server Job isn't passing parameters #79

Closed
paawak opened this issue May 18, 2015 · 3 comments
Closed

Scheduled Jasper Server Job isn't passing parameters #79

paawak opened this issue May 18, 2015 · 3 comments
Assignees

Comments

@paawak
Copy link

paawak commented May 18, 2015

Hello,

We are using the jrs-rest-java-client, version 5.5.0 (https://github.com/Jaspersoft/jrs-rest-java-client ) to schedule a
Job on the Jasper (Tomcat) Server. The problem is, though the job is created on the server, the report parameters are
all null.

This is the client code:

private Session clientSessionForAsynchronousRequest;

private void scheduleJob(String reportUri, Map parameters) {
    Job job = new Job();
    job.setLabel("New Job for ISS Report");
    job.setDescription("New Job for the report template: " + reportUri);
    JobSource jobSource = new JobSource();
    jobSource.setReportUnitURI(reportUri);

    jobSource.setParameters(new HashMap(parameters));
    job.setSource(jobSource);
    Set outputFormats = new HashSet();
    outputFormats.add(OutputFormat.PDF);
    outputFormats.add(OutputFormat.XLSX);
    job.setOutputFormats(outputFormats);
    RepositoryDestination repositoryDestination = new RepositoryDestination();
    repositoryDestination.setSaveToRepository(true);
    repositoryDestination.setFolderURI("/scheduled_reports");
    job.setRepositoryDestination(repositoryDestination);
    SimpleTrigger trigger = new SimpleTrigger();
    trigger.setStartType(SimpleTrigger.START_TYPE_NOW);
    trigger.setOccurrenceCount(1);
    trigger.setRecurrenceInterval(0);
    trigger.setRecurrenceIntervalUnit(IntervalUnitType.DAY);
    job.setTrigger(trigger);
    job.setBaseOutputFilename("portiss_report" + System.currentTimeMillis());

    clientSessionForAsynchronousRequest.jobsService().scheduleReport(job);

}

However, we have a bad work-around, by changing the JobsService in jrs-rest-java-client. The above code works if I replace:

long jobId = clientSessionForAsynchronousRequest.jobsService().scheduleReport(job);

With:
long jobId = clientSessionForAsynchronousRequest.jobsService().scheduleReportWithHack(job);
// long jobId = clientSessionForAsynchronousRequest.jobsService().scheduleReport(job);

Also, I have forked the project on git-hub, and you will find my changes here:
https://github.com/paawak/jrs-rest-java-client

Thanks,
Palash.

@paawak
Copy link
Author

paawak commented May 23, 2015

Submitted a pull request for the same:
#82

Thanks,
Palash.

@TanyaEf
Copy link
Contributor

TanyaEf commented Nov 10, 2015

The bug can not be reproduced on the latest version of client (6.1.4). Please, try this version and reopen the issue.

@yaroslav-kovalchyk
Copy link
Contributor

Please try the latest release version and fill free to reopen if it still doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants