REPORTER 22.1

User Defined Variables

User defined variables

For example, if you want to create a report template that has a number of images that are created by a D3PLOT object. If you want to use the template to generate reports for a number of models, the problem is that the various filenames and directory paths will be different for each model. e.g:

Model Directory Path Job Name
Crush Tube 1 /data/test/tube1 tube_test1
Crush Tube 2 /data/test/tube2 tube_test2
Crush Tube 3 /data/test/tube3 tube_test3

To get round this problem you can use a variable for the directory path called DEFAULT_DIR and a variable for the job name called DEFAULT_JOB . When inserting the D3PLOT objects (see D3PLOT Objects  for more detail about inserting D3PLOT objects) use the variables for the directory path and job name. The variables need to be enclosed by % signs to distinguish them from the rest of the text string.

When generating a report for Crush Tube 2 model, the variables would be defined as follows:

Variable Name
Value
DEFAULT_DIR
/data/test/tube2
DEFAULT_JOB
tube_test2

When REPORTER generates the report it will substitute in the values of the relevant variables, so the two text strings would become:

Bitmap File /data/test/tube2/def.bmp
Job File /data/test/tube2/tube_test2.ptf

To generate a report for one of the other templates, all you need to do is change the value of DEFAULT_DIR and DEFAULT_JOB.