Jump to content
We've recently updated our Privacy Statement, available here ×

eoin.sutton

Members
  • Posts

    7
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by eoin.sutton

  1. Can anyone help? I've successfully added jasper reports to my java program, and recently added fonts via font extensions to ensure they appear when exporting to PDF. On clean-and-build, everything works fine (when the jar file and /lib folder are separate). However when I compile everything into one unified (fat) jar file, I get the following error when trying to run the reports: Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:124) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62) at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:668) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:649) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:971) at ie.orderofmalta.OMFinancialsForm.yTDReportBtnActionPerformed(OMFinancialsForm.java:283) at ie.orderofmalta.OMFinancialsForm.access$700(OMFinancialsForm.java:30) at ie.orderofmalta.OMFinancialsForm$8.actionPerformed(OMFinancialsForm.java:163) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877) at java.awt.Component.processMouseEvent(Component.java:6505) at javax.swing.JComponent.processMouseEvent(JComponent.java:3320) at java.awt.Component.processEvent(Component.java:6270) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:708) at java.awt.EventQueue$4.run(EventQueue.java:706) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:705) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)Caused by: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Input stream not found at : fonts/fontsfamily1406301744789.xml at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:188) at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:56) at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:110) at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83) ... 50 moreCaused by: net.sf.jasperreports.engine.JRException: Input stream not found at : fonts/fontsfamily1406301744789.xml at net.sf.jasperreports.repo.RepositoryUtil.getInputStreamFromLocation(RepositoryUtil.java:159) at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontFamilies(SimpleFontExtensionHelper.java:183) ... 53 more[/code]It's telling me an Input stream is not found for the extra fonts I added. Any ideas? Why would the reports run fine on a normal build but not in a unified jar?
  2. How can I loop through an array of doubles that I have passed into a report as a field? I need to check if the amount in the array is >= 1000, if so, display the value. I can do the if statement but how are loops done? Any help appreciated!
  3. I'm fairly new to jasper reports and ireport. I am creating a report where I calculate what is needed in a Calculations() class and set the results to variables. I display these variables in my report via a JavaBean datasource and they work fine. But there is a requirement now to add information to the report if an amount is over €1000. If so I need to display date, category, amount and a note on a single row. This info can be found in an ArrayList in my java application and I can do the required calculation if required. But how would I add this information to my report? I assume with a table but having read some tutorials I am still uncertain. Could anyone help?
  4. Hi, does anyone know how I can set the Save As Dialog box in JasperViewer have a specific filename, and always a .pdf or .xls extension? I will be deploying this application to people not familiar with computers, and they only need to save to .pdf or .xls and with the same filename. Thank you for any help!
  5. Hi, I'm trying to get a basic jasper report to run. I have a jrxml created in ireport in the directory listed but I just get errors? Code below: private void pdfBtnActionPerformed(java.awt.event.ActionEvent evt) { try { JasperReport jasperReport = null; JasperPrint jasperPrint = null; JasperDesign jasperDesign = null; Map parameters = new HashMap(); jasperDesign = JRXmlLoader.load("/Users/admin/Documents/HCCE/Semester 2/OOP/Projects2/OMFinancials/src/ie/orderofmalta/OMACtest.jrxml"); jasperReport = JasperCompileManager.compileReport(jasperDesign); jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, new JRBeanCollectionDataSource(ie.orderofmalta.BeanFactory.getCalcs())); JasperExportManager.exportReportToPdfFile(jasperPrint,"OMACTEST.pdf"); JasperViewer.viewReport(jasperPrint); } catch(Exception ex) { System.out.println("EXCEPTION: "+ex); } } log4j:WARN No appenders could be found for logger (net.sf.jasperreports.extensions.ExtensionsEnvironment). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstantat java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:270)at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:157)at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:115)at net.sf.jasperreports.functions.FunctionsBundle.addFunctionClass(FunctionsBundle.java:84)at net.sf.jasperreports.functions.FunctionsBundle.<init>(FunctionsBundle.java:54)at net.sf.jasperreports.functions.FunctionsRegistryFactory.createRegistry(FunctionsRegistryFactory.java:76)at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.instantiateRegistry(DefaultExtensionsRegistry.java:239)at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:214)at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:162)at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getRegistries(DefaultExtensionsRegistry.java:133)at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:105)at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:83)at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:124)at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:89)at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:104)at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:62)at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:108)at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:584)at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:930)at jaspertest.JasperTest.main(JasperTest.java:28)Caused by: java.lang.ClassNotFoundException: org.joda.time.ReadableInstantat java.net.URLClassLoader$1.run(URLClassLoader.java:366)at java.net.URLClassLoader$1.run(URLClassLoader.java:355)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:354)at java.lang.ClassLoader.loadClass(ClassLoader.java:425)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)at java.lang.ClassLoader.loadClass(ClassLoader.java:358)... 22 moreJava Result: 1BUILD SUCCESSFUL (total time: 1 second) I don't understand what is happening. Even when I create a basic report to test I get these errors. Can anyone help?
  6. I'm trying to get values from variables in my bean class into iReport (using JavaBean as datasoure). I have the bean class which in its constructor calls a loadReceipt() method - which loads data from a .dat file the user saves. I then have other methods in the bean class which use the data from loadReceipt() to calculate figures and saves them into double variables. Each of the variables has a getMethod which I call in the factory class and is added to a JavaBean collection which iReport uses. However my problem is that when I drag the fields into my PDF template and Preview it in Netbeans, I get "File not found" errors for the .dat file that the bean class needs, and thus the fields are always 0.0. Here's an excerpt from my bean class: public class Calculations implements Serializable{//declare data membersprivate double amt[] = new double [100];private String cat[] = new String [100];public double bankIntReceived;private String category;private ArrayList <Receipts> rec = new ArrayList<Receipts>();//constructorpublic Calculations(){ rec = new ArrayList<Receipts>(); loadReceipts(); category = ""; bankIntReceived = calcReceipts("Bank Interest Received");}public double getBankIntReceived() { return bankIntReceived;}public void setBankIntReceived(double bankIntReceived) { this.bankIntReceived = bankIntReceived;}[/code]Any my factory class: public class BeanFactory implements Serializable{//collection for javabeanspublic static Collection getCalcs(){ Vector calculations = new Vector(); try { Calculations calc = new Calculations(); calc.getBankIntReceived(); calculations.add(calc); } catch(Exception ex) { System.out.println(ex); } return calculations;}}[/code]bankIntReceived will always show 0.0. If I set it manually to a different figure it will show up, so it's a problem loading the .dat file. Does anyone know why this is happening and how I could get the .dat file to load? Any help really appreciated! I have been wracking my brain trying to figure this out for the last week. Please excuse any messiness in the code I am a beginner to java. Really would appreciated some help with this!
×
×
  • Create New...