0 Replies Latest reply: Apr 28, 2010 6:30 AM by 807567 RSS

    Jasper subreports

    807567
      I have created jasper report in java, send in some parameters and it works fine. Now i would like to make a new page on this report - subreport. But i just dont get result - just blank page. I want some static text for now.
      Should i pass in some parameters or data source?
         
      <?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="PermitReport.jrxml" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
           <property name="ireport.zoom" value="1.0"/>
           <property name="ireport.x" value="0"/>
           <property name="ireport.y" value="0"/>
           <parameter name="self" class="net.sf.jasperreports.engine.JRDataSource"/>
           <field name="templateName" class="java.lang.String"/>
           <field name="firstName" class="java.lang.String"/>
           <field name="lastName" class="java.lang.String"/>
           <background>
                <band/>
           </background>
           <title>
                <band height="79"/>
           </title>
           <pageHeader>
                <band height="35"/>
           </pageHeader>
           <columnHeader>
                <band height="61">
                     <textField isStretchWithOverflow="true">
                          <reportElement positionType="Float" x="3" y="0" width="189" height="15"/>
                          <box leftPadding="10" rightPadding="10"/>
                          <textElement/>
                          <textFieldExpression class="java.lang.String"><![CDATA['Test 1. stran']]></textFieldExpression>
                     </textField>
                </band>
           </columnHeader>
           <detail>
                <band height="239">
                     <textField>
                          <reportElement x="10" y="26" width="100" height="20"/>
                          <textElement/>
                          <textFieldExpression class="java.lang.String"><![CDATA[$F{firstName}]]></textFieldExpression>
                     </textField>
                     <textField>
                          <reportElement x="110" y="26" width="100" height="20"/>
                          <textElement/>
                          <textFieldExpression class="java.lang.String"><![CDATA[$F{lastName}]]></textFieldExpression>
                     </textField>
                
                <subreport>
                        <reportElement x="155" y="130" width="200" height="100"/>               
                       <subreportExpression class="java.lang.String">
                                       <![CDATA["/home/t/workspace/.../src/main/resources/Report_OUTER_subreport.jasper"]]>
                            </subreportExpression>
                </subreport>
                </band>
           </detail>
           <columnFooter>
                <band height="45"/>
           </columnFooter>
           <pageFooter>
                <band height="54"/>
           </pageFooter>
           <summary>
                <band height="42"/>
           </summary>
      </jasperReport>