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

christiaan_se

Members
  • Posts

    51
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by christiaan_se

  1. Hi, we are migrating from version 1.2.6 to 1.3.3. When we try to compile a JasperDesign which was stored in 1.2.6 using JRSaver.saveObject() (to save the report to a stream) we get the following Nullpointer exception. Is this a bug or should we use a different approach?: java.lang.NullPointerException at net.sf.jasperreports.engine.design.JRDesignDataset.getSortFields(JRDesignDataset.java:521) at net.sf.jasperreports.engine.design.JRVerifier.verifySortFields(JRVerifier.java:708) at net.sf.jasperreports.engine.design.JRVerifier.verifyDataset(JRVerifier.java:2372) at net.sf.jasperreports.engine.design.JRVerifier.verifyDesign(JRVerifier.java:213) at net.sf.jasperreports.engine.design.JRVerifier.verifyDesign(JRVerifier.java:183) at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:257) at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:144) at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:212) kind regards, Christiaan [file name=reportsaved.txt size=7857]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/reportsaved.txt[/file] Post edited by: christiaan_se, at: 2007/05/03 15:11
  2. and the pdf with version 1.3.3 (nice work on the size reduction btw;) Also, we are using the itext 2.0.2 [file name=Images_jasper_1.pdf size=99732]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Images_jasper_1.pdf[/file]
  3. The images.... [file name=images.zip size=159542]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/images.zip[/file]
  4. 2nd attempt adding files [file name=Images_jasper_1.zip size=162589]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Images_jasper_1.zip[/file]
  5. Hi Teodor, we replaced our BufferedImage.TYPE_INT_ARGB code with ImageIO.read(imageFile) which already gave better transparency results in previewing the report. When exporting to pdf, the results are different (less good) as the 1.2.6 version. I've attached the pdf documents and the images used. We actually always convert the images to png before displaying them (could be another format if you think that is more appropriate). So what we basically do: - load the image with: BufferedImage bufImage = ImageIO.read(imageFile); - store the image as bytearray in png format: ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); ImageIO.write(image, PICTURE_FORMAT, baos); - load the image bytes into BufferedImage again and provide it as a parameter to report: BufferedImage im = ImageIO.read(new ByteArrayInputStream(imagebytes)); kind regards, Christiaan
  6. We actually encountered the same problem when moving to 1.3.2 (jdk 6 u1, XP) Is the provided solution the way to go, or does this need to be fixed in Jasperreports? kind regards, Christiaan
  7. Hi Teodor, thanks for the reply. This was actually a mistake in the testcase, in the application it was done properly. However, I replaced the code with below, and there is still the memory increase ending in an OoM exception. Code: .... frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(viewer, BorderLayout.CENTER); //JasperViewer.viewReport(jasperPrint, false); frame.setVisible(true); frame.setVisible(false); viewer.clear(); //just to be sure frame.dispose(); ..... kind regards, Christiaan
  8. Hi, we are using jasperreports 1.3.2 and one of our testers noticed that after previewing a report multiple times he got an OutOfMemoryException. Running the following simple testcase we indeed notice that the memory usage keeps increasing and will result in OOM. It shouldn't, right? Code: for(int i = 0; i < 10000; i++) { JRViewer viewer = new JRViewer(jasperPrint); JFrame frame = new JFrame(); frame.setPreferredSize(new Dimension(500, 500)); frame.pack(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(viewer, BorderLayout.CENTER); //JasperViewer.viewReport(jasperPrint, false); frame.setVisible(true); frame.setVisible(false); //clear() reduces memory growth, but still increases viewer.clear(); System.out.println("" + i + " - "+ calcMemoryUsage()); kind regards, Christiaan
  9. Hi, I think you need to use JRDesignImage.setUsingCache(true); otherwise the image will be copied everytime it is used. kind regards, Christiaan
  10. Hi, any comments from the Jasper team on this? We are considering doing the same update. kind regards, Christiaan
  11. Yes sorry about that (and the late reply). It's just example code, not fully functional. The idea is that you provide a custom datasource for both parent and child. As soon next is being called you store that info in an attribute so the child CustomDataSource can easily access this. Code: public class CustomDataSource implements JRDataSource { private CustomDataSource parentDatasource = null; private Object currentObject = null; public ChildDataSource (ParentDataSource parentDatasource) { super(); this.parentDatasource = parentDatasource; } public Object getFieldValue(JRField field) throws JRException { if(parentDatasource != null) { Object parentObject = parentDatasource.getCurrentRow(); //now use parentObject to get parent info } //use currentObject to retrieve info } public boolean next() throws JRException { //process next data //assign data to currentObject } public Object getCurrentObject() { return currentObject(); } } hope this helps, Christiaan
  12. Hi, you can write a custom datasource which has access to the parent datasource: Code: public class ChildDataSource implements JRDataSource { private JRDataSource parentDatasource = null; public ChildDataSource (ParentDataSource parentDatasource) { super(); this.parentDatasource = parentDatasource; } public Object getFieldValue(JRField field) throws JRException { Object parentObject = parentDatasource.getCurrentRowObject(); .... } }
  13. Hi, not sure what you mean, are you talking about opening and modifying an existing pdf file or do you want to generate a pdf file based on a jasper reports. JasperReports is not meant for the first option, you should use something like the iText library. kind regards, Christiaan
  14. Hi, thanks for the workaround. However in the end I would still prefer a separate band for this so it is clear that it is intended as a watermark. Note, we have implemented a simple designer to deal with a a number of bands (including the background). In order to work with this workaround we need to "fake" the foreground band, put the elements in negative values on the pagefooter when printed and show them in the foreground band when using the designer. This is quite complex and easily leads to errors, so a dedicated foreground band is preferred. kind regards, Christiaan
  15. hi, our users have a special request for printing "watermarks", for instance an image or the text "concept" printed over the complete page. I've tried using the background band for this, but in order to make it visible I need to make sure all my elements on the report are transparent which is not feasible. I would like to make a request for a foreground band (preferrably with a transparancy value) which behaves the same as the background band except for the fact that it is painted over the existing elements. kind regards, Christiaan
  16. Thnx for the reply. I actually don't have any experience with POI at the moment, but I probably need to use it in the near future. I will keep you informed if I find a solution. I suppose you tried the quickguide explanation: http://jakarta.apache.org/poi/hssf/quick-guide.html#Images
  17. Hi, I am using JasperReports 1.2.6 and I am currently encountering the already familiar issue that images are not exported to Excel. I read I should be using jexcelapi from the demos folder. However on the POI site I read that images are supported: http://jakarta.apache.org/poi/hssf/quick-guide.html#Images (btw, I also saw a newer version of POI than the one included with JasperReports is available). Any chance that export of images to excel will be done with the default POI? kind regards, Christiaan
  18. Hi, in the constructor of JasperViewer there is boolean indicating whehter it should perform an exit on close. With the viewer you can't view pdf files, you just view the jasper reports. To view pdf files you probably need to use something like JDIC or get a (commercial and most of the times pretty expensive) java implementation of a pdf viewer. There used to be a nice java-com bridge available (njawin) which is now commercially available (http://www.javain.com). kind regards, Christiaan
  19. Hi Lucian, thanks for the reply. I was actually under the wrong impression that the report generation process is streambased, so thats why I thought it was a memory leak. Unfortunately our users do need these kind of reports (not printed, but in pdf format), so I hope I can solve it with the heap space increase. kind regards, Christiaan
  20. Hi, I have a simple large report (200.000 record) where each record has a simple sub report of 500 records. Printing it results in a java.lang.OutOfMemoryError: Java heap space after printing 15.000 records. (I also noticed that after printing a couple of thousands or records things really start to slow down, but this is probably caused by this) I use a swapfilevirtualizer and have set Xmx256M When printing just the main report (so without subreport) this doesn't result in OutOfMemory. I've attached a simple testcase to reproduce this. It occurs at: net.sf.jasperreports.engine.fill.JRVerticalFiller(net.sf.jasperreports.engine.fill.JRBaseFiller).fill(java.util.Map) line: 783 net.sf.jasperreports.engine.fill.JRVerticalFiller(net.sf.jasperreports.engine.fill.JRBaseFiller).fill(java.util.Map, net.sf.jasperreports.engine.JRDataSource) line: 666 net.sf.jasperreports.engine.fill.JRFiller.fillReport(net.sf.jasperreports.engine.JasperReport, java.util.Map, net.sf.jasperreports.engine.JRDataSource) line: 89 net.sf.jasperreports.engine.JasperFillManager.fillReport(net.sf.jasperreports.engine.JasperReport, java.util.Map, net.sf.jasperreports.engine.JRDataSource) line: 601 test.Test.main(java.lang.String[]) line: 37 [file name=testcaseoutofmem.zip size=3860]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/testcaseoutofmem.zip[/file]
×
×
  • Create New...