I have an event script for a mouse click that opens the PDF viewer and loads a PDF that is a nvarchar set of bytes in my DB. When I click the button to open the PDFViewer and load the file everything works as expected EXCEPT I also get following error:
[code]Traceback (innermost last):
File “event:mouseClicked”, line 4, in ?
java.lang.ClassCastException: Cannot coerce value ‘[Client]currProject’ into type: class [Ljava.lang.Object;
java.lang.ClassCastException: java.lang.ClassCastException: Cannot coerce value ‘[Client]currProject’ into type: class [Ljava.lang.Object;
Ignition v7.3.3 (b570)
Java: Sun Microsystems Inc. 1.6.0_31
[/code]
My event script is as follows:
[code]system.tag.writeToTag("[Client]fileLoc", event.source.text)
system.nav.openWindow(‘File’)
result = system.db.runPrepQuery(“SELECT SU38, SU38bytes FROM ProjectSummary WHERE SU1 = ?”,"[Client]currProject","[Client]currProject")
if result != None:
window = system.gui.getWindow(‘File’)
window.getRootContainer().getComponent(‘PDFViewer’).setBytes(result[0][1])
window.getRootContainer().getComponent(‘PDFViewer’).text = (result[0][0])
system.nav.centerWindow(‘File’)[/code]
Is there a way to suppress or correct this?
I also noticed that the PDF does not display all the ‘layers’ correctly and I noticed this error in the console, is there a way to correct this color/layer display issue?
java.lang.IllegalArgumentException: Color parameter outside of expected range: Component 1
at java.awt.Color.<init>(Unknown Source)
at com.ribs.pdf.DefaultFactories.createColor(DefaultFactories.java:144)
at com.ribs.pdf.PDFPageParser.getColor(PDFPageParser.java:1428)
at com.ribs.pdf.PDFPageParser.parse(PDFPageParser.java:865)
at com.ribs.pdf.PDFPageParser.parse(PDFPageParser.java:542)
at com.ribs.pdf.PDFPageParser.parsePage(PDFPageParser.java:56)
at com.ribs.pdf.PDFPage.parse(PDFPage.java:482)
at com.ribs.pdf.PDFPage.getImage(PDFPage.java:473)
at com.reportmill.graphics.RMPDFImageReader.getImage(RMPDFImageReader.java:74)
at com.reportmill.graphics.RMImageData.awt(RMImageData.java:418)
at com.reportmill.graphics.RMImageFill.awt(RMImageFill.java:602)
at com.reportmill.graphics.RMImageFill.paintShape(RMImageFill.java:362)
at com.reportmill.shape.RMShapePainter.paintShape(RMShapePainter.java:166)
at com.reportmill.shape.RMShapePainter.paintShape_super(RMShapePainter.java:145)
at com.reportmill.shape.RMShapePainter.paintShapeDeep(RMShapePainter.java:90)
at com.reportmill.shape.RMShapePainter.paintShapeDeep(RMShapePainter.java:98)
at com.reportmill.RMViewer.paintComponent(RMViewer.java:554)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at com.inductiveautomation.vision.api.client.components.model.AbstractVisionPanel.paintChildren(AbstractVisionPanel.java:222)
at javax.swing.JComponent.paint(Unknown Source)
at com.inductiveautomation.factorypmi.plugins.reporting.components.ReportBase.paint(ReportBase.java:179)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.access$700(Unknown Source)
at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)