2015-12-16 202 views
0

我有JasperServer(5.6)接受幾個參數的報告。我在「輸出選項」選項卡上編輯幾個設置,然後輸入我想要發送到「通知」選項卡上的電子郵件。報告成功生成併發送完整的電子郵件。賈斯珀報告與RestAPI

我希望使用JasperServer的Rest API來傳遞我的輸入選項並安排並通過電子郵件發送報告。我經歷了那裏的文檔http://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v56/rest-v2-report-services,但無法理解如何使用其餘的API。

這裏是我的報告的碧玉服務器

enter image description here

的性質有人能幫我如何安排我的報告。

回答

0

我想,我已經想出了安排在碧玉服務器上工作的方式。詳細信息可以在這裏找到

http://community.jaspersoft.com/documentation/tibco-jasperreports-server-web-services-guide/v62/scheduling-report

但在這裏舉例的是(與PUT方法調用它) http://localhost:8080/jasperserver/rest_v2/jobs 和身體定義作業結構


    { 
     "id": 3819, 
     "version": 2, 
     "username": "jasperadmin", 
     "label": "publisher_123_report", 
     "description": "", 
     "creationDate": "2015-12-30T02:02:40.382+03:00", 
     "trigger": { 
      "simpleTrigger": { 
       "id": "1770", 
       "misfireInstruction": "0", 
       "startDate": "2015-12-20T00:00:00+11:00", 
       "startType": "2", 
       "timezone": "Australia/Victoria", 
       "version": "0", 
       "occurrenceCount": "1" 
      } 
     }, 
     "source": { 
       "reportUnitURI": "/Reports/Prod/test_automated_report_v14", 
       "parameters": { 
       "parameterValues": { 
         "PublisherId" : "20", 
         "MonthEnd" : "2015-02-01", 
         "MonthStart" : "2015-03-20", 
         "email" : "[email protected]", 
         "CountryCode" : "560" 
       } 
       } 
     }, 
     "baseOutputFilename": "publisher_124_automated_report", 
     "outputLocale": "", 
     "mailNotification": { 
      "subject": "publisher monthly report" , 
      "toAddresses": { 
       "address": ["[email protected]", "[email protected]"] 
      }, 
      "ccAddresses": { 
       "address": ["[email protected]", "[email protected]"] 
      }, 
      "bccAddresses": { 
       "address": ["[email protected]", "[email protected]"] 
      }, 
      "includingStackTraceWhenJobFails" : false, 
      "resultSendType" : "SEND_EMBED", 
      "skipEmptyReports" : true, 
      "skipNotificationWhenJobFails" : false 
     }, 
     "alert": { 
      "id": 0, 
      "version": -1, 
      "recipient": "OWNER_AND_ADMIN", 
      "toAddresses": { 
       "address": ["[email protected]", "[email protected]"] 
      }, 
      "jobState": "FAIL_ONLY", 
      "messageText": "Success", 
      "messageTextWhenJobFails": "Failure", 
      "subject": "Notification Subject", 
      "includingStackTrace": true, 
      "includingReportJobInfo": true, 
      "jobState" : "ALL" 
     }, 
     "outputTimeZone": "Australia/Melbourne", 
     "repositoryDestination": { 
      "id": 3817, 
      "version": 0, 
      "folderURI": "/Reports/Prod", 
      "sequentialFilenames": false, 
      "overwriteFiles": false, 
      "outputDescription": "", 
      "timestampPattern": null, 
      "saveToRepository": true, 
      "defaultReportOutputFolderURI": null, 
      "usingDefaultReportOutputFolderURI": false, 
      "outputLocalFolder": null, 
      "outputFTPInfo": { 
       "userName": null, 
       "password": null, 
       "folderPath": null, 
       "serverName": null 
      } 
     }, 
     "outputFormats": { 
      "outputFormat": ["HTML"] 
     } 
    } 

更多選項可以在創建工作時提供。