09 July 2009 - 3.0 user guide eclipse intellij netbeans maven download nightly forum bugs blog sf.net eviware


Eviware Logo

Report Templates

Report templates represent sort of alias for chunks of text that will be insterted by property expansion in a report. This is done before report is actualy is being generated. This could be xml code as well, so it could influence report generating or/and data populating in report as well.

For example let's create dummy project report like this:

			
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ReportTemplate" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <property name="ireport.encoding" value="UTF-8"/>
   <template>"../../styles.jrtx"</template>
   <title>
      <band height="70">
         <staticText>
            <reportElement x="159" y="13" width="229" height="42"/>
            <textElement>
               <font size="13"/>
            </textElement>
            <text>${title}</text>
         </staticText>
      </band>
   </title>
   <pageHeader>
      <band/>
   </pageHeader>
   <detail>
      <band height="122">
      </band>
   </detail>
</jasperReport>
			
			
and template like this:
${=project.name} Report
your report title will be project name plus "Report". Here is used combination of property expansion and report template. Property expansions does not have to be part of report tempalates they could be directly used in reports, see Cusomizing Report.

See pictures: - template

- main report

- result


Next: Report Parameters