User Manual

GETTING STARTED


OTHER EDITIONS


LAUNCHERS


MODULES


PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support

ALL USER MANUAL VERSIONS

Ignition 8.1. Offline Version (04/2021)
Ignition 8 Online Version
Ignition 7.9 Online Version
Ignition 7.8 Online Version

Deprecated Pages

SDK Documentation

Employees

Sign In

Skip to end of metadata
Go to start of metadata

Component Palette Icon:

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. 

To begin using the Report Viewer, the project must first have at least one report configured. Once a report exists in the project, then the  Report Path property on the Report Viewer can be used to select the report, which will cause the component to render the selected report. If the report has any parameters, those will be exposed under the Report Parameters category in the Property Editor, allowing you to configure bindings on them. 

On this page ...


Interface Elements

ElementDescription
Zoom FactorDetermines the zoom level of the rendered report. 
PagerDetermines which page is currently shown in the report viewer. 
Right ClickRight-clicking on the rendered report will present a popup menu, allowing the user to save a copy of the report, or print it out to an available printer. 


Properties

NameDescriptionTypeScriptingCategory
Background ColorColor that lays underneath the report. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.Color.backgroundAppearance
Border

The border surrounding this component. Options are: No border, Etched (Lowered), Etched (Raised), Bevel (Lowered), Bevel (Raised), Bevel (Double), Button Border, Field Border, Line Border, and Other Border.

Note: The border is unaffected by rotation.

Border.borderCommon
Current PageCurrent page in the report you would like to view.Int.currentPageData

Fit Panel

Ignore the zoom and fit the report to the component.

Boolean

.fitPanel

Data

Foreground ColorThe foreground color the labels on the component. See  Color Selector.Color.foregroundAppearance
NameThe name of this component.String.nameCommon
Page CountNumber of pages in the report.Int.pageCountData
Report Loading

Returns true while the report is loading.


Note: 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.

BooleanreportLoadingN/A
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 the rendered report. This property directly controls the zoom factor interactive element displayed on the component. Float.zoomFactorData

Report Parameters Category

The Report Viewer component features a dynamic subset of properties under the Report Parameters category. This category is populated by report parameters that are defined on the reported specified by the Report Path property. 


Component Functions

.print(printerName, showDialog)

Note: The following print method will only work if a report has finished loading on the Report Viewer component.

  • Description

Uses the named printer and determine if the print dialog window should appear or not.

  • Parameters

String printerName - The name of the printer the report should be sent to. Will use the default printer if left blank. [optional]

Boolean showDialog - True if the dialog window should appear, False if the dialog window should be skipped. Will be true if left blank. [optional]

  • Return

Nothing

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)

.getBytesPDF()

  • Description

Return the bytes of the generated report in the Report Viewer using PDF format.

  • Parameters

None

  • Return

Byte Array - The bytes of the report in PDF format.

.getBytesPNG()

  • Description

Return the bytes of the generated report in the Report Viewer using PNG format.

  • Parameters

Nothing

  • Return

Byte Array - The bytes of the report in PNG format.

.saveAsPDF(fileName)

  • Description

Prompts the user to save a copy of the report as a PDF. Shows a file selection window with the extension set to PDF.

  • Parameters

String fileName - A suggested filename to save the report as

  • Return

Nothing

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")

.saveAsXls(fileName)

  • Description

Prompts the user to save a copy of the report as an XLS file. Shows a file selection window with the extension set to XLS.

  • Keyword Args

String fileName - A suggested filename to save the report as.

  • Return

Nothing


Extension Functions

onReportGenerated

  • Description

Called when the Report generation process has been completed.

  • Keyword Args

Component self  - A reference to the component invoking this method.

Byte Array pdfBytes  - The PDF formatted bytes generated by the Report.

  • Return

Nothing


Examples

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()



  • No labels