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.
Add and
Job. Enter a unique name for the job. For instance,
RenderAllReport, then click Finish.
The job will be created successfully.
Design tab, right-click on the job, select
Add, then FileLoop.
FileLoop and select Script.
Then, add RenderAllReport. The structure will similar to
Figure 5.1, “FileLoop Tree”.
FileLoop panel,
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.
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”.
Script, enter the following. This is to retain the directory
structure:
newFileName = FileName.replace(/.rml/g,".pdf");
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.
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”.
Log File: field under the Log
tab.