Jump to content
Changes to the Jaspersoft community edition download ×

php client schedule job attachment


ashcsi1322

Recommended Posts

Hi All,

I am using the php client rest api to schedule a report. I am using the following code to achieve this :

    $result = new JasperJob();    $result->baseOutputFilename = $reportDet['baseOutputFilename'];    $result->label = $reportDet['label'];    $result->description = $reportDet['description'];      $result->repositoryDestination['folderURI'] = $repositoryDestination['folderURI'];    $result->repositoryDestination['overwriteFiles'] = (!empty($repositoryDestination['overwriteFiles'])) ? 'true' : 'false';  $result->repositoryDestination['sequentialFilenames'] =(!empty($repositoryDestination['sequentialFilenames'])) ? 'true' :'false';      $result->outputFormats['outputFormat'] = $outputFormat['outputFormat'];      $result->source['reportUnitURI'] = $source['reportUnitURI'];    $result->source['parameters'] = array(                                        'REPORT_TIME_ZONE' => array('Asia/Kolkata'),                                        'status' => array('A')                                    );    $result->simpleTrigger['occurrenceCount'] = $simpleTrigger['occurrenceCount'];      $result->simpleTrigger['recurrenceInterval'] = $simpleTrigger['interval'];    $result->simpleTrigger['recurrenceIntervalUnit'] = $simpleTrigger['intervalUnit'];    $result->simpleTrigger['startDate'] = $simpleTrigger['startDate'];    $result->simpleTrigger['timezone'] = $simpleTrigger['timezone'];    $result->mailNotification['toAddresses']['address'] = $mailNotification['toAddresses'];    $result->mailNotification['subject'] = $mailNotification['subject'];    $result->mailNotification['messageText'] = $mailNotification['messageText'];    $result->mailNotification['resultSendType'] = 'SEND_ATTACHMENT';      $this->_client->putJob($result);[/code]


Using the code above report is getting sent correctly as an attachment. But the attachment is empty. Could anyone let me know what I am missing ?

Also, I am using older version of php client

PHP Client (v1.0)
Published: 2012-Nov-12

and the jasper server version is 5.0.0. Can that also be a part of the problem ?


thanks

ashy

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 months later...

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