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

prosvet

Members
  • Posts

    18
  • Joined

  • Last visited

prosvet's Achievements

Apprentice

Apprentice (3/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Finally, I have managed to do what I want. In case if someone later has the same problem, here's the code (just to give an idea): Code:String sourceLocation = "main_report_location"JasperDesign reportSource = JRXmlLoader.load(sourceLocation);JRDesignSubreport subReportDesign = null;JRExpression jrExpression = null;JRElement[] jrElements = ((JRDesignBand) reportSource.getDetailSection().getBands()[0]).getElements();for (JRElement jrElement : jrElements) { if (jrElement instanceof JRDesignSubreport) { subReportDesign = (JRDesignSubreport) jrElement; jrExpression = subReportDesign.getExpression(); [...handle expression contents here...] subReportDesign.setExpression(); }}ByteArrayOutputStream reportOutStream = new ByteArrayOutputStream();JasperCompileManager.compileReportToStream(reportSource, reportOutStream);returnStream = new ByteArrayInputStream(reportOutStream.toByteArray());
  2. Sorry if the a similar question was already answered, but I have not found the answer. I have main report with many subreports that should be reordered at print time according to user preferences. What is missing between ellipses (cf. code), are lines that would allow me to access subreports and whether change their source path, or move inside reportSource before compilation. Thanks in advance Igor Code: Post Edited by prosvet at 07/17/2012 15:45
  3. Apparently, when I add manually variable's initial value in the jrxml file (cf. code) or modify an existing (pre-3.5.2 created jrxml file) variable's initial value, everything is OK. However, when I create the variable in iReport and type in initial value, the error appears. So, for the moment, I have to create all my labels with iReport, position them, and then add initial values manually in jrxml file. Feasible, but cumbersome. Code: <initialValueExpression><![CDATA["test"]]></initialValueExpression>
  4. Since this morning, for a new report (Groovy or not) it gives the following error message when trying to preview: "The initial value class is not compatible with the variable's class" Simplifying the report, I came to the simplest case to reproduce: variable is a simple java.lang.String to be able to put a label inside. The error comes even for one variable, not placed on the repoirt layout. Report is empty. (cf. attachment) Any idea? Igor
  5. Sorry for bothering, but I have tried different combinations of locate en in conf file and menus are still in French. Igor
  6. Thank you for advice, Giulio. I have changed for Groovy and now it works. Maybe the reason of the js problem was that in the beginning I had 2.0.2 jars in classpath, so ant was first searching them. Now, I have no jar reference in system variables and it works. Well, almost. When I try to compile reports, I have the following warning (but everything compiles, though): [jrc] 8 mai 2009 14:28:17 net.sf.jasperreports.engine.component.ComponentsEnvironment findComponentBundles [jrc] ATTENTION: Found two components for namespace http://jasperreports.sourceforge.net/jasperreports/components I run compilations with the folowing command: ant compileReports -lib ../_jasper/lib _jasper/lib contains the following jars: classes12dms.jar commons-beanutils-1.7.jar commons-collections-2.1.jar commons-digester-1.7.jar commons-logging-1.0.2.jar dms.jar groovy-all-1.5.5.jar iText-2.1.0.jar jasperreports-3.5.1.jar jdt-compiler-3.1.1.jar jfreechart-1.0.12.jar poi-3.2-FINAL-20081019.jar servlet.jar spring-beans.jar spring-core.jar and also a sub-directory jdbc: classes12.jar, ojdbc14dms.jar and ojdbc14.jar Igor
  7. Lucian, I have purged 2.0.2 references from CLASSPATH system variable (I have forgotten they were there) and now it works better. Igor
  8. Directly in iReport when trying to preview a report containing subreport: Error filling print... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : new java.lang.Integer(1) net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : new java.lang.Integer(1) at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:667) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:346) Apparently, java.lang.Integer(1) is generated in the .jasper file, but I have not managed to understand why. Igor
  9. srikuba, You have to pass SUBREPORT_DIR from parent to children reports. Also, I add the following line in HttpServlet's doGet method: parameterMap.put("SUBREPORT_DIR", reportLocation.toString() + "/"); Igor
  10. Lucian, I have used two versions, 3.5.0 and now 3.5.1 . Reports created with iReport 2.0.2 compile OK. Reports 2.0.2 retouched with iReport 3.5.x do not. I have compared JRXML files for the same report (I attach both versions of the same report). 2.0.2: <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="DossiersEtapeDocuments" .... 3.5.x: <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="DossiersEtapeDocuments" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> Regards. Igor
  11. If I take out the line <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> , I get the following error message on report compilation: [jrc] net.sf.jasperreports.engine.JRException: No report compiler set for language : null iReport 3.5.0 compiles reports OK, but when I try to compile them with ant, I get one of these messages. Never have managed to go past them. Reports compile and run OK with 2.0.2 version. I would like to pass to v. 3.5.0 to be able to use javascript. What should be modified in build.xml file or somwhere else to be able to compile correctly?
  12. OK, has found the answer in this forum. sourceforge.net links were unfortunately unavailable. Igor Post Edited by prosvet at 04/29/2009 15:16
  13. I am using JasperReports library to generate reports for my client. Not being a lawyer, I am not sure whether in this case (commercial use, I presume?) I should pay the licence. If no - then no problem. If yes, how much would it cost? Igor
  14. As long as you don't (re)touch or (re)compile reports made with old versions, it's OK. Otherwise, you have to rework all your reports to replace methods that became obsolete since v2.0.3. I have created my reports with v1.3.4 and the latest version that allows to work with them without headache is v2.0.2.
  15. I call a JavaScript that prepares command string for JasperReports launch and starts it in a new window.
×
×
  • Create New...