online_millionnaire Posted May 3, 2015 Posted May 3, 2015 Hello,I will try to explain my problem as clearly as I can (but do not hesitate to ask for more details...)I have one of my clients that used an old version of jasperreports and iReport (1.2.6 !!)Everything is ok for him but he wants to use the layers with iReport (available since the 3.7 version of iReport). With these layers, he can "group" different textfields and add a "Print when expression" for all of them in one time (instead of adding the firmula into each element) and he can show/hide the layers to see exactly what he will get when the expression will be true or false.So I updated his software with the jasperreport library 3.7.6 et I integrated the iReport Designer 3.7.6 too.The jasperreport library is a little bit modified because some classes has been added to fit to the printing flow he needs.but no problem with that.My problem is that his software "shows" a view of the design encapsulated (JRDesignViewer used inside the software).When you work with layers, the JRDesignViewer shows ALL the layers !So you can understand that the image that is shown is not clear...So I tried to find a way to count the available layers in the file et show them separately.I found some source code to count the layers but it is usabled with the iReport Designer library.so I added these library to test...And I have an exception !!! so it is unusabled...this exception seems to be "normal"...And my second problem is that the JRDesignViewer class in the 3.7.6 version do not ask for a layer precisely. so I can't use that method anymore...Is there someone that already used the layers in jasperreports ? how to control/list them ?Thanks for your helpthis is my code and my exception :JasperDesign jd = this.page.getReportDesign();jdv = new JRDesignViewer(jd);LayersSupport.getInstance().setJasperDesign(jd); List<Layer> layers = new ArrayList<Layer>();layers = LayersSupport.getInstance().getLayers();String msg = "";for (Layer l : layers){ msg += "Layer "+l.getId()+" = "+l.getName();}EasyLog.getInstance().msg(msg);[/code]SYSTEM::nulljava.lang.NullPointerException at com.jaspersoft.ireport.designer.IReportManager.getReportClassLoaderImpl(IReportManager.java:977) at com.jaspersoft.ireport.designer.IReportManager.getReportClassLoader(IReportManager.java:896) at com.jaspersoft.ireport.designer.IReportManager.getReportClassLoader(IReportManager.java:891) at com.jaspersoft.ireport.designer.IReportManager.getInstance(IReportManager.java:652) at com.jaspersoft.ireport.addons.layers.LayersSupport.<init>(LayersSupport.java:157) at com.jaspersoft.ireport.addons.layers.LayersSupport.getInstance(LayersSupport.java:147) at rie.riesystemcheque.ui.panels.PageDesign.setDesignViewer(PageDesign.java:76) at rie.riesystemcheque.ui.panels.PageDesign.buildPanel(PageDesign.java:97) at rie.riesystemcheque.ui.panels.PageDesign.<init>(PageDesign.java:38) at rie.riesystemcheque.ui.panels.PagePanel.buildCompo(PagePanel.java:99) at rie.riesystemcheque.ui.panels.PagePanel.<init>(PagePanel.java:25) at rie.riesystemcheque.ui.panels.BookTypeMainPanel.setPage(BookTypeMainPanel.java:214) at rie.riesystemcheque.ui.panels.BookTypeMainPanel.jList1ValueChanged(BookTypeMainPanel.java:202) at rie.riesystemcheque.ui.panels.BookTypeMainPanel.access$000(BookTypeMainPanel.java:22) at rie.riesystemcheque.ui.panels.BookTypeMainPanel$1.valueChanged(BookTypeMainPanel.java:126) at javax.swing.JList.fireSelectionValueChanged(JList.java:1765) at javax.swing.JList$ListSelectionHandler.valueChanged(JList.java:1779) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:167) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:147) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:194) at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:388) at javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:398) at javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:442) at javax.swing.JList.setSelectedIndex(JList.java:2179) at javax.swing.JList.setSelectedValue(JList.java:2295) at rie.riesystemcheque.ui.panels.BookTypeMainPanel.setBookType(BookTypeMainPanel.java:72) at rie.riesystemcheque.ui.panels.BookTypeMainPanel.<init>(BookTypeMainPanel.java:37) at rie.riesystemcheque.modules.BookTypeModule.getMainPanel(BookTypeModule.java:64) at tiie.j2imodule.J2iModuleManager.getMainPanelForm(J2iModuleManager.java:303) at tiie.j2imodule.J2iModuleManager.activeModule(J2iModuleManager.java:324) at rie.riesystemcheque.ui.panels.ManageBankPanel.jButton7ActionPerformed(ManageBankPanel.java:322) at rie.riesystemcheque.ui.panels.ManageBankPanel.access$800(ManageBankPanel.java:32) at rie.riesystemcheque.ui.panels.ManageBankPanel$9.actionPerformed(ManageBankPanel.java:181) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6297) at javax.swing.JComponent.processMouseEvent(JComponent.java:3275) at java.awt.Component.processEvent(Component.java:6062) at java.awt.Container.processEvent(Container.java:2039) at java.awt.Component.dispatchEventImpl(Component.java:4660) at java.awt.Container.dispatchEventImpl(Container.java:2097) at java.awt.Component.dispatchEvent(Component.java:4488) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166) at java.awt.Container.dispatchEventImpl(Container.java:2083) at java.awt.Window.dispatchEventImpl(Window.java:2489) at java.awt.Component.dispatchEvent(Component.java:4488) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:674) at java.awt.EventQueue.access$400(EventQueue.java:81) at java.awt.EventQueue$2.run(EventQueue.java:633) at java.awt.EventQueue$2.run(EventQueue.java:631) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$3.run(EventQueue.java:647) at java.awt.EventQueue$3.run(EventQueue.java:645) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:644) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now