Template Keywords

Miscellaneous - ****

The /****/ keyword allows you to add text to a template that is ignored by SM-Reports when printing a report. Putting comments in a template script is useful for when you later need to change a template and need to remember what each section does.

/****/,<text that is ignored when printing a report>

Preview text

There is another use for a comment in a template. When using the Preview button of the Edit Template command, the preview of the template fills the fields with text to let you see what the template will look like with information on it. The preview text will necessarily make sense, but is helpful for seeing how much room is needs for different elements on the page.

There are 4 types of preview comments

/****/,preview,text,<the text to show>

The field is filled with the text exactly as you enter it.

/****/,preview,latin,<minimum length>,<maximum length>

The field is filled with nonsense "latin" with a random length that is between the minimum and maximum values.

/****/,preview,number,<minimum value>,<maximum value>

The field is filled with a random number that is between the minimum and maximum values.

/****/,preview,graph,1,<number of levels>

The graph is drawn with a level between 1 and the maximum level. This preview is a special case and is necessary before every /graph/ line. The number of levels is the number of different columns the tick can appear in for an outcome. For a gauge representing student marks the number of levels is normally 50 or 100.

In each case, the preview comment must appear on the line before the field that is to be filled with the information.

Examples

This shows comments that remind what the lines of script are for and fills the name and attendance fields with information for the preview.

/****/,--------------- Student ---------------
/offset/,0,200,relative
/serif/,14
/left/
/text/,0,0,200,100,Student:
/serif/,14,bold
/left/
/****/,preview,text,A. G. Student
/field/,student,200,0,1800,100
/****/,--------------- Absences ---------------
/offset/,1200,0,relative
/serif/,14
/left/
/text/,0,0,200,100,Absences:
/serif/,14,bold
/left/
/****/,preview,number,1,10
/field/,attendance,200,0,500,100

 

Contents
Search