Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata



General

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. To find documentation on the deprecated Report Viewer prior to Ignition 7.8, see the Legacy Report Viewer documentation.

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.

The border is unaffected by rotation.

Border.borderCommon
Current PageCurrent page in the report you would like to view.Int.currentPageData
EndDateEnd date for the report.Date.EndDateReport Parameters

Fit Panel

The following feature is new in Ignition version 8.0.3
Click here to check out the other new features

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 LoadingReturns 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.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
StartDateStart date for the report.Date.StartDateReport Parameters
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
Scripting
Scripting Functions
 print(printerName, showDialog)

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

  • Scope

Client

 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.

 

This function will return null if the trial has expired.


  • Scope

Client

 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.

 

This function will return null if the trial has expired.


  • Scope

Client

 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

  • Scope

Client

 saveAsPNG(fileName)
  • Description

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

  • Keyword Args

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

  • Return

Nothing

  • Scope

Client

 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

  • Scope

Client

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

  • Scope

Client

Event Handlers
 mouse
 mouseClicked

This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseEntered

This event fires when the mouse enters the space over the source component.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseExited

This event fires when the mouse leaves the space over the source component.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mousePressed

This event fires when a mouse button is pressed down on the source component.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseReleased

This event fires when a mouse button is released, if that mouse button's press happened over this component.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseMotion
 mouseDragged

Fires when the mouse moves over a component after a button has been pushed.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 mouseMoved

Fires when the mouse moves over a component, but no buttons are pushed.

.sourceThe component that fired this event
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Control key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.
 propertyChange
 propertyChange

Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.

.sourceThe component that fired this event
.newValueThe new value that this property changed to.
.oldValueThe value that this property was before it changed. Note that not all components include an accurate oldValue in their events.
.propertyName

The name of the property that changed.

Remember to always filter out these events for the property that you are looking for! Components often have many properties that change.

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")
Utilizing reportLoading
#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)
Customizers

This component does not have any custom properties.

 

  • No labels