Job Recipes

Render All Reports In A Folder

This section will show the user the steps to rendering all the reports in a specified folder into the desired output format. PDF will be the chosen output format in this case.

  1. In a repository or folder, right-click and select Add and Job. Enter a unique name for the job. For instance, RenderAllReport, then click Finish. The job will be created successfully.
  2. In Design tab, right-click on the job, select Add, then FileLoop.
  3. Right-click on FileLoop and select Script. Then, add RenderAllReport. The structure will similar to Figure 5.1, “FileLoop Tree”.

    Figure 5.1. FileLoop Tree

    FileLoop Tree
  4. Click on FileLoop. In the FileLoop panel,
  5. Click on FileLoop. In the FileLoop panel, enter the folder directory in in the Folder: field. User can also click on ... to select the folder. Check Recursive if the files are contained within the folders of folders.
  6. In the File Criteria panel, add a new criteria. In Test, choose Extension in the dropdown list. For When condition, select Equals. As for Value, enter rml like in Figure 5.2, “File Criteria”.

    Figure 5.2. File Criteria

    File Criteria
  7. In Script, enter the following. This is to retain the directory structure:
    newFileName = FileName.replace(/.rml/g,".pdf");
  8. In the Render Report job, enter ${FileName} for the Name: field in the Report panel. This is so that the name of the PDF generated will take on the name of the rml file.
  9. For the Target panel, select output1 and application/pdf for the output directory name and output mime-type from the dropdown list respectively. Inside the Parameters panel, edit the parameter value as seen in Figure 5.3, “Target Parameter”.

    Figure 5.3. Target Parameter

    Target Parameter
  10. If user wants to see the progress of file processed, user can add enter the path of a log file in the Log File: field under the Log tab.
  11. Now, run the job. After the job has finished running, the generated PDF files can be found in /RepertoireServer/output/folder1, and a folder with the name of the repository will contain the generated PDF files.