Skip to main content
Version: 7.9

Report Viewer

Component Palette Icon:

Description

The Report Viewer component provides a way to run and view Reports in Vision windows. Parameters added during Report creation are provided as Properties in the Viewer and can override any default values set in the Report Resource. Right clicking on the Report Viewer brings up a menu that allows you to easily print the report or save it in various formats. The Reporting Module comes with some additional reporting components that can be used with Vision components. To learn more, refer to the Vision Reporting Components section in the Reporting Module.

Properties

NameDescriptionTypeScriptingCategory
Background ColorColor that lays underneath the report.Color.backgroundAppearance
BorderThe border surrounding this component. NOTE that the border is unaffected by rotation.Border.borderCommon
Current PageCurrent page in the report you would like to view.Int.currentPageData
Foreground ColorThe foreground color the labels on the component.Color.foregroundAppearance
NameThe name of this component.String.nameCommon
Page CountNumber of pages in the report.Int.pageCountData
Print ModeSets the printing mode. Vector is fastest and high-quality for printers that support it, but Raster mode can help spool size with older printers.Int.printingModeBehavior
Report PathPath in the Project to the Report you would like to view.String.reportPathData
Show ControlsShow the bar with the page and the zoom controls.Boolean.showControlsAppearance
Suggested FilenameThe filename that will come up by default when the user saves the report to disk.String.suggestedFilenameBehavior
VisibleIf disabled, the component will be hidden.Boolean.visibleCommon
Zoom FactorZoom factor for this report.Float.zoomFactorData
Report Loading
New in 7.9.5
Returns true while the report is loading, Note that this property does NOT appear in the Property Editor, but can easily be accessed from a Python script. Useful in scenarios where you wish to change the value of a parameter on the Report Viewer in a script and then do some additional work once the report has finished loading.
Boolean.reportLoadingN/A

Scripting

See the Report Viewer Scripting Functions page for the full list of scripting functions available for this component.

Event Handlers

Event handlers allow you to run a script based off specific triggers. See the full list of available event handlers on the Component Events page

Examples

print()
#calls print on a Report Viewer component located in the same window

reportViewer = event.source.parent.getComponent('Report Viewer')
reportViewer.print()
print() with default printer, no dialog
#calls print on a Report Viewer component located in the same window
#bypasses the print dialog window and uses the default printer

reportViewer = event.source.parent.getComponent('Report Viewer')
reportViewer.print(None, False)
saveAsPDF()
#Saves the file as a PDF to a user selected location. 
#The file selection window defaults to a name of "Daily Report"

reportViewer = event.source.parent.getComponent('Report Viewer')
reportViewer.saveAsPDF("Daily Report")
New in 7.9.5

The following example utilizes the reportLoading property, which was introduced in 7.9.5.

Utilizing reportLoading
#This example will check if the report has finished loading. If so, print the report.

#Reference the report viewer
reportViewer = event.source.parent.getComponent('Report Viewer')

if reportViewer.reportLoading:
system.gui.warningBox("The report is still loading. Please wait")
else:
reportViewer.print()