JOS Report Format Commands
JOS Report format files use the basic format language syntax, Procedures, and format() statement. However, there are additional format commands that designed for reports; to help format your printed or displayed output.
Learning SmartCAM includes a tutorial topic that covers all the steps required to create a custom format file. See the Creating a Custom JOS Report Format File topic.
JOS Report Procedures
Procedures are groups of formatting language statements that are associated with a single task; for example, the init{} procedure is called once, at the start of a report, and is used to initialize specific settings for the report.
JOS Report Procedures are covered in the Procedure Types topic.
Setting Print Options
Print options, for SmartCAM JOS reports, are tracked in the [JosReport]
section of the
application.ini
file. Defaults can be established using Utility - Options - JOS
Report Options and editing the properties. Additionally, the print options can be set within
the init procedure of your report format file.
Example:
procedure init
{
page_width(256);
disable_pagination();
disable_form_feed();
html_encode();
}
This procedure sets the output to use a page width of 256 characters, turns off pagination (form feeds between pages) and the final form feed at the end of the report. It also enabled HTML encoding (used for HTML-based pages).
The following properties can be set in your format file:
Property | What it does |
---|---|
OutputFile | Specifies the filename for the report file, when you print to a file. This setting is controlled by an input field in the JOS Report dialog box and does not need to be set manually. |
OutputDevice | 0 sets the report output to your printer, 1 outputs the report to a file. this setting is controlled by a selection on the JOS Report window. It does not need to be set manually. |
PageWidth | Sets the maximum width, in characters, of a printed line. |
PageLength | Sets the maximum length of a page, by the number of lines that can be printed. |
UseFormFeed | Force a form feed at the end of each page of the report. If the printer uses a form feed, set the value to 1. If no form feed is needed, set the value to 0. In most cases, set this to 1. |
UseFinalFF | Forces a form feed after printing the last page of a report. If the printer requires a final form feed, set the value to 1. If no form feed is required, set the value to 0. In most cases, set this to 1. |
Miscellaneous Commands for Report Formats
In addition to the general constructs, procedures, and format statements already identified, the following commands can also be used in report procedures.
Command | What it does |
---|---|
OutputFile | Specifies the filename for the report file, when you print to a file. This setting is controlled by an input field in the JOS Report dialog box and does not need to be set manually. |
map() | Maps an integer value to a string value. By default, the corresponding string values are paired with the scalar values. |
disable_pagination() | Disables report pagination. When pagination is disabled, the page-based HEADER and
FOOTER procedures are only called once each; header at the start of the report and
footer at the end. |
enable_pagination() | Enables report pagination. When the report outputs the user defined page length (number of lines
per page), a new "page" is output. When pagination is enabled, the page-based
HEADER and FOOTER procedures are called at the start and end of each page. |
page_length(#) | Set the number of lines to output per page. |
page_width(#) | Set the number of characters to output per line. If the output line exceeds the number of characters defined for the page width, the line is truncated at the point it exceeds the page width and the remainder of the line is output as the next line. |
disable_form_feed() | Disables output of page-based form feed character (^L ). |
enable_form_feed() | Enabled output of form feed character (^L ). When pagination is enabled and the number of
lines per page is reached a new pages is generated. When form feed is enabled, a printer form feed
character is output (to force a printer form feed). |
disable_final_form_feed() | Disables the output of a form feed character (^L ) at the end of the report. |
enable_final_form_feed() | Enables output of final form feed character (^L ) at the end of the report. |
day() | Inserts the current day of the month as an integer. |
month() | Inserts the current month as an integer value. |
year() | Inserts the current year as an integer value. |
hour() | Inserts the number of hours since midnight (24-hour time). |
minute() | Insert the number of minutes past the hour. |
second() | Insert the number of seconds past the minute. |
newpage() | Forces a form feed. |
page() | Inserts the current page number. |
shpfile() | Returns the path/filename to the current process model file. |
jobfile() | Returns the path/filename to the current JOF file. |
mclfile() | If the report is being called from a SmartCAM macro, returns the path/filename of the currently running macro. |
smffile() | Returns the path/filename to the current machine file. |
cgtfile() | Returns the path/filename to the current code generator template file. |
codfile() | Returns the path/filename to the current code output file. |
rptfile() | Returns the path/filename to the report file being generated. |
get_name() | Returns the filename.ext from a path/filename string. Example:
|
call(procedure) | Calls a procedure from within another procedure. The called procedure must be defined before the call statement. When the procedure is finished, returns to the next line in the format file. |
call_if_report_image(procedure) | Used to embed screen captures in the output report file. The report format generator knows which JOS
context is active (Job Info, Steps, or Tooling) and if the JOS Reports dialog has a selected named view
to be captured, this function will call the named procedure.
The called procedure is where the bitmap is included in the report file. |
report_image_get(forceWhiteBackGrnd, Width, Height [, showTools, blackWireframe, lineThicknessMultiplier]) | Function that generates the screen capture bitmap and returns the path/filename of the created image file.
The image file will be in .PNG format. This function knows what the current JOS Context is (Job Info, Steps,
or Tooling) and uses the appropriate named view for the screen capture.
The captured bitmap is saved in the same directory as the output report file. The bitmap is named the
same as the generated output file with an additional The The Example: See the default HTML report files for an example of how the call_if_report_image() and report_image_get() functions are used in concert to add bitmaps to the generated reports. A simple example of this is:
The command has three optional parameters, based on equivalent functionality in the File - Print - Graphics function. If you do not want to use these features, you do not need to include their parameters as arguments when calling the function. However, if you want to use any of the three additional features, you must use all three arguments. The optional arguments are the three at the end, wrapped by [] brackets. Do not include the braces. The optional 0 = OFF (the default) The optional
|
image_get(viewName, forceWhiteBackGrnd, Width, Height [, showTools, blackWireframe, lineThicknessMultiplier]) | Function that generates a screen capture bitmap and returns the path/filename of the created image file. The
image file will be in .PNG format. Similar in function to report_image_get() , this function allows
the user to pass in the Named View to capture, regardless of the graphical user interface Image file setting.
The captured bitmap is saved in the same directory as the output report file. The bitmap is named the same
as the generated output file with an additional The The The Example, using
Captures a bitmap, of the The command has three optional parameters, based on equivalent functionality in the File - Print - Graphics function. If you do not want to use these features, you do not need to include their parameters as arguments when calling the function. However, if you want to use any of the three additional features, you must use all three arguments. The optional arguments are the three at the end, wrapped by [] brackets. Do not include the braces. The optional 0 = OFF (the default) The optional The optional |
tool_image_get(Width, Height, Zoom Level) | Generates an image file for the current tool, in the active JOS Context. It resembles the tool graphic preview
in the JOS Planner, however the tool profile will always be black and the background white. The function
creates the bitmap file (in .PNG format) and saves it in the same folder as the generated report and returns
the path/filename of the created image file.
The captured bitmap is named the same as the generated report with an additional The The |
html_encode() | Usually called in the init procedure, when included this function causes all JOS strings to be
run through a HTML encoder. Some text characters have special meaning in HTML and so need to be converted to
HTML equivalents. This function does that.
The characters converted are: Line Feed converted to <BR /> |
custom_encode(path/filename.ext) | Allows custom character substitution from string data returned from JOS tags. This function is usually
called in the init procedure. The parameter for this function is the path and filename of a
custom encoding file. This is an ASCII text file which contains the string characters to search for and
the character to replace with.
The function parameter should include the path and filename. If it just includes the filename, SmartCAM
will search for the file by first checking any paths associated with the environment variables:
The format file is a simple ASCII text file. Each search and replace combination reside on separate lines.
Each line begins with the search string - the string to find. Followed by either a Single characters can be represented by the hexadecimal value of the ASCII character. Hexadecimal characters
must start with There is a special search string: If the first character of the line is ' |
Related Topics
Creating a Custom JOS Report Format File