Class ReportViewer
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- javax.swing.JPanel
- 
- com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel
- 
- com.inductiveautomation.reporting.components.ReportViewer
 
 
 
 
 
 
- 
- All Implemented Interfaces:
- DynamicPropertyProvider,- LocaleListener,- MutableDynamicPropertyProvider,- StyleProvider,- ComponentLifecycle,- ExtensibleComponent,- QualityMonitor,- VisionComponent,- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible
 
 public class ReportViewer extends AbstractVisionPanel implements ExtensibleComponent filename: ReportViewer.java author: Perry The ReportViewer component allows the display of a Report in an Ignition Client Window. Implements DynamicPropertyProvider to override the default component inheritance of MutableDynamicPropertyProvider as Report-specific Properties originate from the ReportDataSourceConfig object's ReportParameters. ReportParameters should be configured in the ReportDataEditor of a given Report.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classReportViewer.ControlsPanelprotected classReportViewer.ReportLoaderReportLoader is the background process that runs to collect the data for a report without blocking the UI thread.- 
Nested classes/interfaces inherited from class javax.swing.JPaneljavax.swing.JPanel.AccessibleJPanel
 - 
Nested classes/interfaces inherited from class javax.swing.JComponentjavax.swing.JComponent.AccessibleJComponent
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringCAT_REPORTINGprotected ReportViewer.ControlsPanelcontrolsprotected javax.swing.JPopupMenupopupMenu- 
Fields inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanelantialias, context, cursorCode, dynamicProps
 - 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 - 
Fields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 - 
Fields inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecycleCOMPONENT_RUNNING
 - 
Fields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 - 
Fields inherited from interface com.inductiveautomation.ignition.client.model.LocaleListenerLOCAL_CHANGE_EVENT
 - 
Fields inherited from interface com.inductiveautomation.vision.api.client.binding.MutableDynamicPropertyProviderRESERVED_SET_KEY
 - 
Fields inherited from interface com.inductiveautomation.vision.api.client.components.model.VisionComponentCOMPONENT_LOCKED, COMPONENT_PERMISSIONS, COMPONENT_SECURITY, COMPONENT_TRANSLATIONS
 
- 
 - 
Constructor SummaryConstructors Constructor Description ReportViewer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbulkSetValues(java.util.Map<java.lang.String,java.lang.Object> map)protected booleancheckExpirationAccess()java.awt.ColorgetBackground()Gets the background color of this component.byte[]getBytesPDF()Allows scripts to get the bytes in PDF format.byte[]getBytesPNG()Allows scripts to get the bytes in png format.intgetCurrentPage()java.util.TreeMap<java.lang.String,DynamicPropertyDescriptor>getDynamicProps()java.util.Map<java.lang.String,ExtensionFunction>getExtensionFunctions()intgetPageCount()java.awt.ColorgetPanelBackground()DynamicPropertyDescriptor[]getProperties()java.lang.ObjectgetPropertyValue(java.lang.String name)java.lang.StringgetReportPath()java.lang.StringgetSuggestedFilename()floatgetZoomFactor()protected javax.swing.JPopupMenuinitMenu()booleanisFitPanel()booleanisPropertyDefined(java.lang.String name)booleanisReportLoading()booleanisShowControls()voidloadReport()loadReport() starts most of the checking and loading duties for the ReportViewer.voidlocaleChanged(java.util.Locale newLocale)voidonShutdown()Subclasses should override this to provide shutdown logic.voidonStartup()We override these PropertyProvider methods to expose the ReportResource's parameters as custom properties in the Property Editor, but we don't want the names to be editable outside of the ReportData configuration panel.voidprint()voidprint(java.lang.String printerName)voidprint(java.lang.String printerName, boolean showDialog)java.lang.StringsaveAsHTML(java.lang.String fname, boolean continuous)java.lang.StringsaveAsPDF(java.lang.String fname)java.lang.StringsaveAsPNG(java.lang.String fname)java.lang.StringsaveAsXls(java.lang.String fname)Deprecated.java.lang.StringsaveAsXlsx(java.lang.String filename)saves theRMDocumentin xlsx format to the supplied file name.voidsetBackground(java.awt.Color bg)voidsetCurrentPage(int pageNumber)voidsetDynamicProps(java.util.TreeMap<java.lang.String,DynamicPropertyDescriptor> map)voidsetExtensionFunctions(java.util.Map<java.lang.String,ExtensionFunction> map)voidsetFitPanel(boolean fitPanel)voidsetForeground(java.awt.Color fg)voidsetPageCount(int unused)voidsetPanelBackground(java.awt.Color panelBackground)voidsetPropertyValue(java.lang.String name, java.lang.Object value)The Property (aka Report Parameter) values can be set from the Property editor to override the default value.voidsetPropertyValueQuiet(java.lang.String name, java.lang.Object value)Sets the property value without reloading the report.voidsetReportLoading(boolean reportLoading)voidsetReportPath(java.lang.String reportPath)voidsetShowControls(boolean show)voidsetSuggestedFilename(java.lang.String suggestedFilename)voidsetZoomFactor(float zoomFactor)voidupdateControlVisibility()- 
Methods inherited from class com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanelgetAppContext, getCursorCode, getDataQuality, getQuality, getStyles, getToolTipText, initStyleListener, isAntialias, isComponentRunning, paintChildren, paintComponent, paintOverlayOverChildren, setAntialias, setCursorCode, setDataQuality, setName, setQuality, setStyles, setToolTipText, setVisible, shutdownComponent, startupComponent, translate, updateQuality
 - 
Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 - 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 - 
Methods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
Methods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface com.inductiveautomation.vision.api.client.components.model.ComponentLifecyclegetAppContext, shutdownComponent, startupComponent
 
- 
 
- 
- 
- 
Field Detail- 
CAT_REPORTINGpublic static final java.lang.String CAT_REPORTING - See Also:
- Constant Field Values
 
 - 
popupMenuprotected javax.swing.JPopupMenu popupMenu 
 - 
controlsprotected ReportViewer.ControlsPanel controls 
 
- 
 - 
Method Detail- 
onStartuppublic void onStartup() We override these PropertyProvider methods to expose the ReportResource's parameters as custom properties in the Property Editor, but we don't want the names to be editable outside of the ReportData configuration panel. Otherwise, AbstractVisionPanel implements MutableDynamicPropertyProvider which would allow Custom Properties panels.- Overrides:
- onStartupin class- AbstractVisionPanel
 
 - 
onShutdownpublic void onShutdown() Description copied from class:AbstractVisionPanelSubclasses should override this to provide shutdown logic.- Overrides:
- onShutdownin class- AbstractVisionPanel
 
 - 
getPropertiespublic DynamicPropertyDescriptor[] getProperties() - Specified by:
- getPropertiesin interface- DynamicPropertyProvider
- Overrides:
- getPropertiesin class- AbstractVisionPanel
 
 - 
getDynamicPropspublic java.util.TreeMap<java.lang.String,DynamicPropertyDescriptor> getDynamicProps() - Specified by:
- getDynamicPropsin interface- MutableDynamicPropertyProvider
- Overrides:
- getDynamicPropsin class- AbstractVisionPanel
 
 - 
setDynamicPropspublic void setDynamicProps(@Nullable java.util.TreeMap<java.lang.String,DynamicPropertyDescriptor> map)- Specified by:
- setDynamicPropsin interface- MutableDynamicPropertyProvider
- Overrides:
- setDynamicPropsin class- AbstractVisionPanel
 
 - 
setPropertyValuepublic void setPropertyValue(java.lang.String name, java.lang.Object value) throws java.lang.ClassCastExceptionThe Property (aka Report Parameter) values can be set from the Property editor to override the default value. Property names are based on the Report Data panel Parameter names. These properties can be null/empty, but if a default is not specified the key won't get run in the report.- Specified by:
- setPropertyValuein interface- DynamicPropertyProvider
- Overrides:
- setPropertyValuein class- AbstractVisionPanel
- Throws:
- java.lang.ClassCastException
 
 - 
setPropertyValueQuietpublic void setPropertyValueQuiet(java.lang.String name, java.lang.Object value) throws java.lang.ClassCastExceptionSets the property value without reloading the report. Used by the report converter- Throws:
- java.lang.ClassCastException
 
 - 
bulkSetValuespublic void bulkSetValues(java.util.Map<java.lang.String,java.lang.Object> map) 
 - 
getPropertyValuepublic java.lang.Object getPropertyValue(java.lang.String name) - Specified by:
- getPropertyValuein interface- DynamicPropertyProvider
- Overrides:
- getPropertyValuein class- AbstractVisionPanel
 
 - 
isPropertyDefinedpublic boolean isPropertyDefined(java.lang.String name) - Specified by:
- isPropertyDefinedin interface- DynamicPropertyProvider
- Overrides:
- isPropertyDefinedin class- AbstractVisionPanel
 
 - 
isReportLoadingpublic boolean isReportLoading() 
 - 
setReportLoadingpublic void setReportLoading(boolean reportLoading) 
 - 
getReportPathpublic java.lang.String getReportPath() 
 - 
setReportPathpublic void setReportPath(java.lang.String reportPath) 
 - 
loadReportpublic void loadReport() loadReport() starts most of the checking and loading duties for the ReportViewer. If the context has loaded and there is a reportPath entered, it will try to find the resource, show the loading animation pane, and call the SwingWorker to handle the RDP calls to collect the data configuration, update the Component's property (aka parameter) list, and finally run/draw the report.
 - 
setBackgroundpublic void setBackground(java.awt.Color bg) - Overrides:
- setBackgroundin class- javax.swing.JComponent
 
 - 
getBackgroundpublic java.awt.Color getBackground() Gets the background color of this component.- Overrides:
- getBackgroundin class- java.awt.Component
 
 - 
setForegroundpublic void setForeground(java.awt.Color fg) - Overrides:
- setForegroundin class- javax.swing.JComponent
 
 - 
getExtensionFunctionspublic java.util.Map<java.lang.String,ExtensionFunction> getExtensionFunctions() - Specified by:
- getExtensionFunctionsin interface- ExtensibleComponent
 
 - 
setExtensionFunctionspublic void setExtensionFunctions(java.util.Map<java.lang.String,ExtensionFunction> map) - Specified by:
- setExtensionFunctionsin interface- ExtensibleComponent
 
 - 
localeChangedpublic void localeChanged(java.util.Locale newLocale) - Specified by:
- localeChangedin interface- LocaleListener
- Overrides:
- localeChangedin class- AbstractVisionPanel
 
 - 
getZoomFactorpublic float getZoomFactor() 
 - 
setZoomFactorpublic void setZoomFactor(float zoomFactor) 
 - 
isFitPanelpublic boolean isFitPanel() 
 - 
setFitPanelpublic void setFitPanel(boolean fitPanel) 
 - 
getCurrentPagepublic int getCurrentPage() 
 - 
setCurrentPagepublic void setCurrentPage(int pageNumber) 
 - 
getPageCountpublic int getPageCount() 
 - 
setPageCountpublic void setPageCount(int unused) 
 - 
initMenuprotected javax.swing.JPopupMenu initMenu() 
 - 
printpublic void print() 
 - 
printpublic void print(java.lang.String printerName) 
 - 
printpublic void print(java.lang.String printerName, boolean showDialog)
 - 
getBytesPDF@Nullable public byte[] getBytesPDF() Allows scripts to get the bytes in PDF format. Useful for emailing or saving to a database.- Returns:
- Bytes of report in PDF format, or null if trial is expired.
 
 - 
getBytesPNG@Nullable public byte[] getBytesPNG() Allows scripts to get the bytes in png format. Useful for emailing or saving to a database.- Returns:
- Bytes of report in png format, or null if trial is expired.
 
 - 
saveAsPDFpublic java.lang.String saveAsPDF(java.lang.String fname) 
 - 
saveAsHTML@Nullable public java.lang.String saveAsHTML(java.lang.String fname, boolean continuous)
 - 
saveAsPNGpublic java.lang.String saveAsPNG(java.lang.String fname) 
 - 
saveAsXls@Deprecated public java.lang.String saveAsXls(java.lang.String fname) Deprecated.
 - 
saveAsXlsxpublic java.lang.String saveAsXlsx(java.lang.String filename) saves theRMDocumentin xlsx format to the supplied file name.- Parameters:
- filename- the filename to save to
- Returns:
- the path to the saved file or nullif the action was unsuccessful or canceled
 
 - 
checkExpirationAccessprotected boolean checkExpirationAccess() 
 - 
getPanelBackgroundpublic java.awt.Color getPanelBackground() 
 - 
setPanelBackgroundpublic void setPanelBackground(java.awt.Color panelBackground) 
 - 
setSuggestedFilenamepublic void setSuggestedFilename(java.lang.String suggestedFilename) 
 - 
getSuggestedFilenamepublic java.lang.String getSuggestedFilename() 
 - 
isShowControlspublic boolean isShowControls() 
 - 
setShowControlspublic void setShowControls(boolean show) 
 - 
updateControlVisibilitypublic void updateControlVisibility() 
 
- 
 
-