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

seboss

Members
  • Posts

    9
  • Joined

  • Last visited

seboss's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi, First of all, I'm sorry for my English. I hope you'll understand my problem... I used jasperreport with no problem since a few years with java web start and I want to improve my program with "dynamic report". I mean that I need to compile JRXML on client machine (before I was using precompiled .jasper file to generate report with no problem). On a local machine, there is no problem with the code. But when I use java web start, with all needed jars in the JNLP file, I have the following errors : "net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: C:\Users\Sébastien\Downloads\templatePortrait_1288690396822_552631.java:4: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; ^ ...." I found why it's not running. The classpath is not configured with the requested jar file with java web start whereas, in local, the classpath is properly configured. I search for a suitable solution but I didn't find anything that can be used. I tried to get the path of the jar to update the classpath on a client machine. A getResource() on a file in the required jar : System.out.println(getClass().getClassLoader().getResource(sourcePath)); Returns : jar:http://192.168.1.11:80/lib/report.jar!/report/templatePortrait.jrxml Not a local file. So i can't add the jar file in the classpath. When I copy jasperreport.jar in jre/ext/ path, it works, but it can't be deploy on all client machines... Does anybody have a solution ? Code:String sourcePath = "report/templatePortrait.jrxml";InputStream in = getClass().getClassLoader().getResourceAsStream(sourcePath);JasperReport jasperReport = JasperCompileManager.compileReport(in);
  2. Hello, I'm trying to generate a report which use some subreport to get calculated values, but I can't use this values in the master report. So I have two subreport which return 2 values ($V{A}, $V{B} for exemple), I put this in master report as the same name. In the master report, I have $F{C} and I wan't to generate $V{INTER_VALUE} (for exemple, expression value : "$V{A}*$F{C}+$V{B}"). If I display $V{INTER_VALUE}, I have "null" value. If I display a text field with "$V{A}*$F{C}+$V{B}" expression, I have the correct value. Subreports are in the detail band whereas $V{INTER_VALUE} is in the summary band. Is there a solution to do this ? Or should I write all in the expression of the text field ? Thanks for help and sorry if my english isn't very good...
  3. Thank for the alternative solution. It's perfectly working ! It has saved my time
  4. Ok, I didn't see that JRLoader.loadObject() return a jasperprint... Thanks a lot
  5. I explain again, I use this code : Code: ArrayList<Object> jpl = new ArrayList<Object>(); String fileGen = JasperFillManager.fillReportToFile(reportPath,parameters, bdd.getConnection()); jpl.add(JRLoader.loadObject(fileGen)); I just want to make something like this : Code:[code] ArrayList<Object> jpl = new ArrayList<Object>(); String fileGen = JasperFillManager.fillReportToFile(reportPath,parameters, bdd.getConnection()); if (!report.isEmpty()) jpl.add(JRLoader.loadObject(fileGen)); But I don't understand how to do with jasperPrint.getPages().isEmpty(). Post edited by: seboss, at: 2006/08/31 07:18
  6. Hello, I'd like to know how can I detect an empty report before loading it with the JRLoader.loadObject() method. Because when I want to export a report (always the same) with several differents dates given in parameter, I've got white pages in the exported pdf (for each date which has no data in the database source). Is it possible ? Thank for help.
  7. Ok, it's seems to work after little modifications but I've a new problem. (Thanks a lot) I'd like to make the same things but simply with a screen display, like JasperViewer.viewReport() method. I've been looking the class JRGraphics2DExport but I don't succeed to use it and there is no example about it. Can you give me informations about it please ? Thanks.
  8. Yes, it seems to be exactly what I need !! If you have an exemple of use... I'll take it :) Thanks you very much for you quick answer !
  9. Hello, I would like to know if it's possible to have, in one PDF file, several time the same report (for exemple a report concerning each person in a company). I didn't find anything in this way, what about ? Thanks
×
×
  • Create New...