Showing or hiding report content in different print and export formats

You can use the system report variable _CurrentPrintMode in formulas to present different report and report book content in different output formats, such as Excel and PDF.

_CurrentPrintMode is a read-only system report variable. It is populated only in these circumstances:

  • When a report or report book is printed
  • When a report or report book is exported
  • When the print preview is opened

When populated, the variable has these properties:

  • Key: Output type.
  • Property: Format.

    Valid values are: pdf, ppt, xlsx novalue, xlsx value, img.

  • Property: Method.

    Valid values are: export, print.

  • Property: Object.

    Valid values are: report, book.

For example:
<Table>
<Row name="output type">
<Property name="format" value="pdf"/>
<Property name="method" value="export"/>
<Property name=object" value="report"/>
</Row>
</Table>

Use _CurrentPrintMode in, for example, GETPROPERTY formulas on the Availability tab of these report objects:

  • Text box
  • Chart
  • Web extension
  • Image
For example:
=IF(GETPROPERTY(ReportVariables._CurrentPrintMode.Text, "output type", "format")="pdf","True","False")