Top  | Previous | Next

header_logo Report Viewer

Icon in toolbar: reportviewericon

 

Description

reportviewer

The Report Viewer is the component that displays reports within Ignition. Dynamic Properties bring data from Ignition into the report. Any changes to the dynamic data automatically regenerates the report. Customization is done in the Report Designer via the customizer (Cntl+U)

reportviewerrightclickUsers can zoom in to the report and scroll between pages with the builtin controls located at the bottom. Right clicking anywhere on a report in the Report Viewer in the Runtime will allow you to print or save the report in several formats.

 

 

 

 

Properties

Zoom Factor

zoomFactor

INT

This variable sets and displays the current zoom level of the report.

 

Customizer

The customizer for this class is the Report Designer. It lets you add, remove, and edit properties for the Report's datasets as well as create entire reports.

Events

mouse
mouseClicked
mouseEntered
mouseExited
mousePressed
mouseReleased
mouseMotion
mouseDragged
mouseMoved
propertyChange
propertyChange

 

 

 

Scripting Functions

 

 

print([printerName], [showDialog])

Prompts the report to print. The optional arguments can be used to specify the name of the printer to use, and whether or not to show the user the print options dialog box.

Parameters

 

[printerName]

 

The name of the printer to print to. Omit or use None to use the default printer.

[showDialog]

 

A boolean (0 or 1) indicating whether or not to show the user the print dialog options box.

 

Example:

# This would prompt the user to print, showing them the print dialog box and starting with the deafult printer selected
report = event.source.parent.getComponent("Report Viewer")
report.print()

Example:

# This would print to the "HP Laserjet" printer with no user interaction
report = event.source.parent.getComponent("Report Viewer")
report.print("HP Laserjet"0)

Example:

# This would print to the default printer with no user interaction
report = event.source.parent.getComponent("Report Viewer")
report.print(None0)

getBytesHTML(continuous)

Creates an HTML byte array of the report generated.

Parameters

 

continuous

 

Create a paged HTML document or a continuous HTML document

 

Example:

# This code would prompt the user to save the HTML bytes to a file
path = fpmi.file.saveFile("myfile.html")
if path != None:
 fpmi.file.writeFile(path, report.getBytesHTML(1))

getBytesPDF()

Creates an HTML byte array of the report generated.

Example:

# This code would prompt the user to save the PDF bytes to a file
path = fpmi.file.saveFile("myfile.pdf")
if path != None:
 fpmi.file.writeFile(path, report.getBytesPDF())

saveAsHTML(filename, continuous)

Saves the generated report as HTML to the specified filename.

Parameters

 

filename

 

The filename, such as myfile.html

continuous

 

Create a paged HTML document or a continuous HTML document

saveAsPDF(filename)

Saves the generated report as a PDF to the specified filename.

Parameters

 

filename

 

The filename, such as myfile.pdf

saveAsPNG(filename)

Saves the generated report as a PNG to the specified filename.

Parameters

 

filename

 

The filename, such as myfile.png