#### The REPORT Command

The Report command object is identified with the REPORT command in the Edit window.

The REPORT Command Syntax

A REPORT command will have the following syntax in the Edit window's Command mode:

<ID> =REPORT/<TOG1>, FILENAME= <PATHWAY>, AUTOPRINT=<TOG2>, INLINE REPORT=<TOG3>, Section=<NUM1>,REPORTMODE=<MODE>

PARAM/=

ENDREPORT/

Item | Description
<ID> | This is the ID for the REPORT command.
REPORT/<TOG1> | This changes the type of REPORT command. It can be CUSTOM, LEGACY, TEMPLATE, or LABEL.
FILNAME=<PATHWAY> | This determines the report or template to load. <PATHWAY> is the full filename pathway pointing to the desired file. If you only use the name of the report or template, PC-DMIS will look in the default Reporting directory.
AUTOPRINT =<TOG2> | <TOG2> can switch between PRINT and PDF and NO. It only applies to REPORT/LEGACY commands. Setting AUTOPRINT=PRINT will cause the HyperView report to be printed to the default printer after it has loaded and executed. The report will close immediately after the print job has been spooled and execution of the part program will resume.

Setting AUTOPRINT=PDF will cause the HyperView Report to be printed to a Portable Document Format (PDF) file. The following rules apply:

- The name of the generated PDF file will have the same base name as the report or template filename appended by a numerical index and extension.

- The generated file will be located in the same directory as the Report file.

- If a file exists with the same name as the generated filename, the index will automatically increment itself until a unique file name is found.

Setting AUTOPRINT=NO will not print anything during execution of this command.

INLINE REPORT=<TOG3> | This is only used with Legacy (HyperView) Reports that have AUTOPRINT set to PDF. It determines if HyperView report information will appear in line with the other generated data from the Report window in a PDF output. <TOG3> switches between ON or OFF.

ON - When this command is executed and the Report Print Options dialog box generates a PDF automatically by the Overwrite, Auto, or Append options, the data from the specified legacy (HyperView) report appears in line with the other normal report output in the PDF file.

If the Prompt option is used, and this is set to ON, then multiple PDFs will be generated, one for the HyperView report and additional PDFs as needed to cover the rest of the Report window's content.

OFF - Data from the HyperView report appears in its own PDF file based off the name of the HyperView report. It is not included in the PDF generated from the Report Print Options dialog box.

Be aware that this option overrides the AUTOPRINT option for HyperView commands.

For more information on legacy HyperView reports, see "Working with Legacy (HyperView) Reports".

Section=<NUM> | <NUM> determines the section into which the report or template will be inserted. This item does NOT apply to label templates. If you type -1 or a value greater than the number of sections in the default template, the report gets inserted at the end.
REPORTMODE=<MODE> | When a part program executes, it starts to generate the report using the default report template, if a default report template is specified. Once it reaches the REPORT command, the generation changes based on the specified report mode: <MODE> can either be SWITCH or INSERT. This mode only applies to the REPORT/TEMPLATE commands.

SWITCH - This switches the report template to use the one in this command until another REPORT command is encountered or until the end of the part program.

INSERT - This generates report data for previously executed commands using the template in this command. When this REPORT command finishes, PC-DMIS returns to using the default report template to generate the rest of the report data.

PARAM/ | The PARAM/ option allows you to map PC-DMIS expressions to a report or a report template's variables or properties. This option does not apply to REPORT/LABEL commands. The syntax of the PARAM/ option is: PARAM/{object or variable name}={PC-DMIS expression}

Example: If you have a Global Variable in a report named “NumBoltHoles”. The following PARAM/ option would map the PC-DMIS expression to NumBoltHoles:
PARAM/NumBoltHoles=360.0/angle

Changes to the variable in the editor can also change the PC-DMIS variable.

Example: Using the following PARAM/ option, NumBoltHoles is set equal to numBolts. Changes within the HyperView report to the HyperView variable NumBoltHoles will be reflected in the PC-DMIS variable numBolts:
PARAM/NumBoltHoles=numBolts

Important: After execution any objects you changed by passing parameters into a Report template or a HyperView report will revert to what they had been before execution if you redraw or modify the report in any way. This means if you want to retain the results of passing a parameter to your template or report, you will need to first print the report before making modifications. You can do this using the AUTOPRINT parameter or by printing directly from the Report window.

See "Mapping PC-DMIS expressions to properties of HyperView Objects" for additional information on using parameters.

Hint: Pressing F9 on a REPORT/CUSTOM command opens up the custom report in the Custom Report Editor.

REPORT/TEMPLATE Report Generation

PC-DMIS generates the default report as usual until it reaches this command. When it executes this command, PC-DMIS utilizes the specified template and generates a separate report for all the part program commands in a new section within the current report. After PC-DMIS generates this new report section, it switches back to the previous report and continues generating commands in the original report from that point forward.