Jump to content

prosvet

Members
  • Posts

    18
  • 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

Posts posted by prosvet

  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. 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

  6. 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
     

  7. 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

  8. 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?

     


     

  9. 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.

  10. In the crosstab I have made, each cell can have positive and negative values. At the end of each row I have two columns, "Debit" and "Credit", one of which is filled according to the sign of the row total.

     

    At the end of the report, I would like to put the total of the debit and credit columns. Or, the total of all positive values is not equal to the total of "Debit" column. The same is right about the "Credit" column.

     

    So, is there a way to total header columns?

     

    Igor

×
×
  • Create New...