Contents
Strategic Partner Links
Sepasoft - MES Modules
Cirrus Link - MQTT Modules
Resources
Knowledge Base Articles
Inductive University
Forum
IA Support
SDK Documentation
SDK Examples
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. To find documentation on the deprecated Report Viewer prior to Ignition 7.8, see the Legacy Report Viewer documentation.
Name | Description | Type | Scripting | Category |
---|---|---|---|---|
Background Color | Color that lays underneath the report. | Color | .background | Appearance |
Border | The border surrounding this component. NOTE that the border is unaffected by rotation. | Border | .border | Common |
Current Page | Current page in the report you would like to view. | Int | .currentPage | Data |
Foreground Color | The foreground color the labels on the component. | Color | .foreground | Appearance |
Name | The name of this component. | String | .name | Common |
Page Count | Number of pages in the report. | Int | .pageCount | Data |
Print Mode | Sets 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 | .printingMode | Behavior |
Report Path | Path in the Project to the Report you would like to view. | String | .reportPath | Data |
Show Controls | Show the bar with the page and the zoom controls. | Boolean | .showControls | Appearance |
Suggested Filename | The filename that will come up by default when the user saves the report to disk. | String | .suggestedFilename | Behavior |
Visible | If disabled, the component will be hidden. | Boolean | .visible | Common |
Zoom Factor | Zoom factor for this report. | Float | .zoomFactor | Data |
The following property was added in 7.9.5
Name | Description | Type | Scripting | Category |
---|---|---|---|---|
Report Loading | 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 | reportLoading | N/A |
#calls print on a Report Viewer component located in the same window reportViewer = event.source.parent.getComponent('Report Viewer') reportViewer.print()
#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)
#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")
The following example utilizes the reportLoading
property, which was introduced in 7.9.5.
#This example will change the value of a parameter, wait for a new version of the report #to generate, and then print the new report. #It is assumed that this script is being called from a component-based script, and the source component is in the same container as the Report Viewer #Reference the report viewer reportViewer = event.source.parent.getComponent('Report Viewer') #Make a change to one of the Report Parameters on the Report Viewer. #This will cause a new report to generate. reportViewer.EndDate = system.date.now() #We'll call this function once the report has finished loading. def finished(): #We're simply printing the report here, but you could place any amount of work #here that you want to execute once the new report has been generated reportViewer.print() #We'll use this function to constantly check to see if the report has finished loading def waiting(): #While we're waiting.... while reportViewer.reportLoading: #...don't do anything, just keep checking pass #Once we get to this point, the report has finished loading, so lets call finished() #Using invokeLater so we can finish up in the Event Dispatch Thread system.util.invokeLater(finished) #Start the waiting process in an asynchronous thread. system.util.invokeAsynchronous(waiting)
This component does not have any custom properties.