Jump to content


  • Posts

  • Joined

  • Last visited

toffer's Achievements

  1. Thank you very much. Been struggling with this for a while now!
  2. We had a similar issue. The problem was, that we specified the "SansSerif" font-family for our textfields which worked well on Windows, but on Linux did not fit into the boxes anymore, because it uses a different font. So they were rendered blank. We then decreased the font-size of the texts and it worked on both machines. You specified Tahoma, so basically it should look the same, if the font is available on Solaris as well. I would still try decreasing the font-size.
  3. In another project I found out, that you must put your .properties-files in a .jar-file and that must be inside the lib folder of your .ear. --> someDeployment.ear/lib/someConfig.jar/someConfig.properties Best way is to let Maven do this for you, although I would appreciate a more smarter approach.
  4. Although it seems I am the only one with the issue, not being able to change log4j's loglevel, I describe what I did to make it work for me. Checked out latest Javaflow code from here http://svn.apache.org/repos/asf/commons/sandbox/javaflow/trunk/Changed suspend() method's returntype to void ("so that's what the 'V' stands for after the NoSuchMethodError" :-)Commented out all log.debug() method callsBuilt and deployed it along with Jasperreport-Javaflow libraryHope that this might help someone with the same problem. Maybe someone will investigate what really causes the StackOverflowError...
  5. Ok, so I checked out the latest source of Javaflow, as it seems the developers improved logging according to the SVN commit message. After I built/deployed it, I am getting a new Exception: Caused by: net.sf.jasperreports.engine.JRRuntimeException: java.lang.NoSuchMethodError: org/apache/commons/javaflow/Continuation.suspend()V at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:782) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331) at net.sf.jasperreports.engine.fill.JRFillFrame.prepare(JRFillFrame.java:219) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:386) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:358) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2059) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446) at net.sf.jasperreports.engine.JasperRunManager.runToPdf(JasperRunManager.java:331) at net.sf.jasperreports.engine.JasperRunManager.runReportToPdf(JasperRunManager.java:796)[/code] @lucianc: can you please help out and tell me how to change the Continuation.suspend method, so that it works for JR? Basically, what return type is required? Thanks in advance.
  6. I am gettting the same StackOverflowError Exception here, after switching to Javaflow. Unfortunately we needed to do this, as our application runs in a Weblogic container. As I do not have a web-application and instead an ejb-ear and I am not certain where to place the mentioned log4j.properties. So far I tried META-INF/ and META-INF/classes/ but without any success. Can anyone give an advice here? Or would it be possible to remove the "defective" part in Javaflow, as it is an open-source project? Please help a very desperate developer :-(
  7. Ok, I figured out that I need to put the class loader into the current thread's context. I am also using an anonymous class loader now, so that only requested classes get loaded (also improves debugging). // check if customizer classes are present and load them final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); final URL customizersUrl = classLoader.findResource("customizers.jar"); if (customizersUrl != null) { ClassLoader cl = new ClassLoader() { @Override public Class loadClass(String className) throws ClassNotFoundException { try { return contextClassLoader.loadClass(className); } catch (ClassNotFoundException ex) { if (customizersUrl != null) { try { URI jarUri = customizersUrl.toURI(); URL[] jarContentUrls = {new URL("jar:file:" + jarUri.getPath() + "!/")}; URLClassLoader customizerInnerClassLoader = URLClassLoader.newInstance(jarContentUrls); return customizerInnerClassLoader.loadClass(className); } catch (URISyntaxException ex1) { logger.debug("Exception during customizer class loading", ex1); } catch (IOException ex1) { logger.debug("Exception during customizer class loading", ex1); } catch (ClassNotFoundException ex1) { throw new ClassNotFoundException("Exception during customizer class loading", ex1); } } } return null; } }; // squeeze our own class loader in Thread.currentThread().setContextClassLoader(cl); } byte[] result = generate(jasperReport, parameters); // changing the class loader back to its origin... just to be safe Thread.currentThread().setContextClassLoader(contextClassLoader);[/code]
  8. I need to render Jasper reports with charts and require individual ChartCustomizer classes for them. My application is running as a Java web-application. Current state is, that the templates (.jasper files) are packaged with their required resources in a separate jar-file. These jar files themselves are stored as BLOBs in the Database. I load them with an own FileResolver, which I provide as a parameter to the Jasper Engine. So far this works great for me, except I cannot load my Customizer classes. I tried to put them in another jar file and load them with an own ClassLoader and also provide that to the Jasper Engine: URL customizersUrl = classLoader.findResource("customizers.jar"); if (customizersUrl != null) { URI jarUri = customizersUrl.toURI(); JarFile jarFile = new JarFile(new File(jarUri)); Enumeration e = jarFile.entries(); URL[] jarContentUrls = {new URL("jar:file:" + jarUri.getPath() + "!/")}; customizerClassLoader = URLClassLoader.newInstance(jarContentUrls); while (e.hasMoreElements()) { JarEntry je = (JarEntry) e.nextElement(); if (je.isDirectory() || !je.getName().endsWith(".class")) { continue; } // -6 because of .class String className = je.getName().substring(0, je.getName().length() - 6); className = className.replace('/', '.'); Class c = customizerClassLoader.loadClass(className); }}parameters.put(JRParameter.REPORT_CLASS_LOADER, customizerClassLoader);[/code]but I am still getting a java.lang.ClassNotFoundException, although I can see in the Debugger, that the classloading from jar works. Any help is appreciated!
  9. I am thinking of packaging my template and its sub-templates into a jar and then load these into the classpath (or JVM?) before rendering. Has anyone experience with that and/or does that approach make any sense?
  10. Hi, I would like to know if there is a way to include (not to reference) a subreport .jasper file into a master .jasper file? I thought Jasper Studio would do this automatically during compilation, but I was proven wrong the hard way now :-( As a last resort, does someone know if I could at least embed it by base64-encoding the binaries as mentioned here: http://community.jaspersoft.com/questions/523992/tip-embedding-images-reports Referencing is not an option as I want to store a single .jasper file in our database. Thanks in advance!
  11. I thought of an attempt to use some kind of counter variable that goes up, every time an image is printed and then use this to calculate the position of the next image. But unfortunately it seems, that dynamic values or expressions cannot be used as x/y position values... Is there a way to maybe achieve this programatically in Java? Sorry, but I am still new to Jasper Reports.
  12. Thanks Massimo. But when I split the images into two frames with horizontal layout, they cannot swap from one to the other, as stated in my above example (i.e. move image #4 from the lower frame to the upper one, when #3 has printWhenExpression set to false).
  13. @Java_Jasper: Thanks, but I think this cannot be applied to my issue, as I want to handle the layout of images and not text
  14. Let's say I got six images in a grid of 3x2: Now I would like to make the third image disappear by setting "printWhenExpression" to false and automatically let the fourth image take in the place of the third and the fifth of the fourth and so on: What layout type or settings do I need to use to achieve this in a Jasper Report .jrxml? Either Free/Vertical/Horizontal Layout did not work out for me.
  • Create New...