Specifying File System Output

When configured, you can also specify a path on the local file system to write job output. The user running the server process must have write permission in that location.

In order for file system output to work, the server must be properly configured. In the file .../WEB-INF/applicationContext.xml, you must set the enableSaveToHostFS property to true. As described in the configuration chapter of the JasperReports Server Administrator Guide, this setting also enables file system output from the scheduler user interface for all users, which could be a security risk.

To create a job with file system output, add the outputLocalFolder 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> 
        <overwriteFiles>true</overwriteFiles> 
        <sequentialFilenames>false</sequentialFilenames>
        <outputLocalFolder>/temp/scheduledReports/</outputLocalFolder>
    </repositoryDestination> 
    <outputFormats>
        <outputFormat>XLS</outputFormat>
        <outputFormat>PDF</outputFormat>
    </outputFormats>
  ... 
</job>

As with FTP output, file system output is always specified in addition to repository output, and the output will be written to both the repository and the local folder. 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 file system output.

Feedback
randomness