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 RenderReport. The structure will be similar to Figure 5.1, “FileLoop Tree”.

    Figure 5.1. FileLoop Tree

    FileLoop Tree
  4. Click on FileLoop. In the FileLoop panel, enter the folder directory 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.
  5. 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
  6. In Script, enter the following. This is to retain the directory structure:
    newFileName = FileName.replace(/.rml/g,".pdf");
  7. 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.
  8. For the Target panel, select userhome and PDF for the output target name and output mime-type from the dropdown list respectively. For the Filename: field, enter ${=newFileName}. For the Folder: field, enter the desired folder name, for example output1, as seen in Figure 5.3, “Target Parameter”.

    Figure 5.3. Target Parameter

    Target Parameter
  9. If user wants to see the progress of file processed, user can click the Log tab to view the log.
  10. Now, run the job. After the job has finished running, the generated PDF files can be found in /User/{User_Name}/output1/.../, and the sub-folders will keep the same structure from the original folders which contain the reports.