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

dheeraj.madhu

Members
  • Posts

    12
  • Joined

  • Last visited

Community Answers

  1. dheeraj.madhu's post in Getting net.sf.jasperreports.engine.JRRuntimeException: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from undefined Exception was marked as the answer   
    Issue is solved.
     
    When the data set is empty high chart still try to render the chart and it will fail. To prevent it added print when condition for chart element in report jrxml.
    <printWhenExpression><![CDATA[$V{REPORT_COUNT} > 0]]></printWhenExpression>[/code]

     
  2. dheeraj.madhu's post in Create Sub report using Jasper API was marked as the answer   
    Ok. Issue is solved.
    Here is the code block
    band = new JRDesignBand();band.setHeight(250);band.setSplitType(SplitTypeEnum.STRETCH);JRDesignSubreport jSubreport = new JRDesignSubreport(jasperDesign);jSubreport.setUsingCache(false);jSubreport.setRemoveLineWhenBlank(true);jSubreport.setPrintRepeatedValues(false);JRDesignExpression expression = new JRDesignExpression();expression.setText("new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{time})");jSubreport.setDataSourceExpression(expression);expression = new JRDesignExpression();expression.setText(""/path/to/sub.jasper"");jSubreport.setExpression(expression);band.addElement(jSubreport);[/code] 
  3. dheeraj.madhu's post in Can't cast String to Long in jasper was marked as the answer   
    Problem was somewhere else. Solved it.
  4. dheeraj.madhu's post in Report has only one row when xml data source is used was marked as the answer   
    Passing the xml path while creating the data source fixed the issue. 
    Used following constructor to create a new xml data source
    JRXmlDataSource source = new JRXmlDataSource(new File(file,"/response/results/field");[/code] 
    Then removed query String from jrxml.  Modified field section looks like below
    <field name="field" class="java.lang.String"> <fieldDescription><![CDATA[child::text()]]></fieldDescription></field><field name="count" class="java.lang.String"> <fieldDescription><![CDATA[@count]]></fieldDescription></field>[/code] 
     
     
     
×
×
  • Create New...