Specifying FTP Output

The REST service allows a job to specify output to remote files through FTP (File Transfer Protocol). In addition to the repository location, you can specify an FTP server and path where JasperReports Server will write the output files when the job runs. You also need to provide a username and password to access the FTP server.

To specify these parameters, add the outputFTPInfo element to the XML job descriptor, as shown in the following example:

<job> 
  <reportUnitURI>/reports/samples/AllAccounts</reportUnitURI> 
  <label>MyJob</label>
  <description>MyJob description</description>
  <baseOutputFilename>WeeklyAccountsReport</baseOutputFilename> 
  <repositoryDestination> 
    <folderURI>/reports/samples</folderURI> 
    <outputDescription/> 
    <overwriteFiles>true</overwriteFiles> 
    <sequentialFilenames>false</sequentialFilenames> 
    <outputFTPInfo>      <serverName>ftpserver.example.com</serverName>      <userName>ftpUser</userName>      <password>ftpPassword</password>      <folderPath>/Shared/Users/ftpUser</folderPath>
    </outputFTPInfo>
  </repositoryDestination> 
  <outputFormats>
    <outputFormat>XLS</outputFormat>
    <outputFormat>PDF</outputFormat>
  </outputFormats>
  ... 
</job>

FTP output is always specified in addition to repository output, and the output will be written to both the repository and the FTP location. You cannot specify FTP output alone. The file names to be written are the same ones that are generated by the job output, as specified by the baseOutputFilename, sequential pattern if any, and format extensions such as .pdf. Similarly, the file overwrite and sequential filename behavior specified for repository output also apply to FTP output.

Version: 
Feedback
randomness