Jump to content
Changes to the Jaspersoft community edition download ×

flamant

Members
  • Posts

    11
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by flamant

  1. Hi, I have a report with special caracters when I generate the jrxml String it includes special characters and I get an error at line 2 (see the following) (in jrxml, I have for example a static Text "<text><![CDATA[" + field.getFldText() + "]]></text>" with special characters in field.getFldText()) line 1 - InputStream jrxmlInputStream = new ByteArrayInputStream(jrxml.toString().getBytes()); line 2 - JasperDesign jasperDesign = JRXmlLoader.load(jrxmlInputStream); So, I try to escape special characters (xml escaping) the raw data ( field.getFldText() ) and to use an imported class in jrxml to unescape back ( xml unescaping ) the data <import value=\"org.apache.commons.lang.StringEscapeUtils\" /> under jasperReport tag And for the static Text <text><![CDATA[stringEscapeUtils.unescapeXml(").append(StringEscapeUtils.escapeXml(field.getFldText())).append(")]]></text> But it seems that org.apache.commons.lang.StringEscapeUtils.unescapeXml() is not used as a java class but as a raw String (in jrxml, I can see the following: <text><![CDATA[stringEscapeUtils.unescapeXml(Do NOT use the following symbols: \ (backward slash), é, Ä, ß, µ (non-English language symbols), °C (superscripts), ¾ (fractions), symbols < and > and quotation marks)]]></text> I conclude that I don't use the right way to use imported java class. Do you have an idea ? Thank you in advance for your answers
  2. Hi, I definitively have some problems with subreports Here is a master report with 2 subreports that are in a group <?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="crf" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="SIMPLE_DATA" class="java.util.HashMap"> </parameter> <field name="subreport2" class="java.util.HashMap"/> <field name="subReportName" class="java.lang.String"/> <field name="subReportDataSource" class="net.sf.jasperreports.engine.data.JRMapCollectionDataSource"/> <field name="subReportJasperReport" class="net.sf.jasperreports.engine.JasperReport"/> <group name="Group1" > <groupExpression><![CDATA[$F{subReportName}]]></groupExpression> <groupHeader> <band height="792"> <subreport> <reportElement positionType="Float" x="0" y="0" width="555" height="792"/> <subreportParameter name="subReportName"> <subreportParameterExpression><![CDATA[$F{subReportName}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$F{subReportDataSource}]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$F{subReportJasperReport}]]></subreportExpression> </subreport> <subreport> <reportElement positionType="Float" x="0" y="0" width="595" height="792"/> <subreportParameter name="subReportName"> <subreportParameterExpression><![CDATA[$F{subReportName}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$F{subreport2}.get("subReportDataSource")]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$F{subreport2}.get("subReportJasperReport")]]></subreportExpression> </subreport> </band> </groupHeader> </group> <background> <band splitType="Stretch"/> </background> <title> <band height="0" splitType="Stretch"/> </title> <columnHeader> <band height="0" splitType="Stretch"/> </columnHeader> <detail> </detail> <columnFooter> <band height="0" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="30" splitType="Stretch"> <frame> <reportElement mode="Opaque" x="2" y="0" width="553" height="30" forecolor="#D0B48E" backcolor="#F2EBDF"/> <textField> <reportElement x="224" y="3" width="39" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+"/"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="264" y="3" width="40" height="20"/> <textElement/> <textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> </frame> </band> </pageFooter> <summary> <band height="0" splitType="Stretch"/> </summary> </jasperReport> When I fill the master report as the following Map simpleMasterMap = new HashMap(); Map subreport2 = new HashMap(); subreport2.put("subReportJasperReport", subReportQueryJasperReportList.get(1)); subreport2.put("subReportDataSource", subReportQueryDataSourceList.get(1)); simpleMasterMap.put("subReportName", subReportName.get(1)); simpleMasterMap.put("subReportJasperReport", subReportJasperReport.get(1)); simpleMasterMap.put("subReportDataSource", subReportDataSource.get(1)); simpleMasterMap.put("subreport2", subreport2); simpleMasterList.add(simpleMasterMap); JRDataSource simpleDS = new JRMapCollectionDataSource(simpleMasterList); HashMap SIMPLE_DATA = new HashMap(); params.put("SIMPLE_DATA", SIMPLE_DATA); JasperPrint jasperPrint = null; InputStream jrxmlInputStream = new ByteArrayInputStream(jrxml.toString().getBytes()); if (simpleDS == null) simpleDS = new JREmptyDataSource(1); try { JasperDesign jasperDesign = JRXmlLoader.load(jrxmlInputStream); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign); jasperPrint = JasperFillManager.fillReport(jasperReport, params, simpleDS); it loops infinitively with the following output 2012-05-20 10:16:27 JRVerticalFiller [DEBUG] Fill 2: page header 2012-05-20 10:16:27 JRVerticalFiller [DEBUG] Fill 2: page header 2012-05-20 10:16:27 JRBaseFiller [DEBUG] Fill 2: suspeding subreport runner 2012-05-20 10:16:27 JRBaseFiller [DEBUG] Fill 2: suspeding subreport runner 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notifying on suspend 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notifying on suspend 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: waiting to continue 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: waiting to continue 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notified of fill result 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notified of fill result 2012-05-20 10:16:27 JRFillSubreport [DEBUG] Fill 1: subreport 2 to continue 2012-05-20 10:16:27 JRFillSubreport [DEBUG] Fill 1: subreport 2 to continue 2012-05-20 10:16:27 JRVerticalFiller [DEBUG] Fill 1: page footer 2012-05-20 10:16:27 JRVerticalFiller [DEBUG] Fill 1: page footer 2012-05-20 10:16:27 JRBaseFiller [DEBUG] Adding evaluation of net.sf.jasperreports.engine.fill.JRTemplatePrintText@4b939fbd by net.sf.jasperreports.engine.fill.JRFillTextField@49b9b979 for evaluation {type: REPORT, group: null, band: 0} 2012-05-20 10:16:27 JRBaseFiller [DEBUG] Adding evaluation of net.sf.jasperreports.engine.fill.JRTemplatePrintText@4b939fbd by net.sf.jasperreports.engine.fill.JRFillTextField@49b9b979 for evaluation {type: REPORT, group: null, band: 0} 2012-05-20 10:16:27 JRBaseFiller [DEBUG] Fill 1: adding page 5394 2012-05-20 10:16:27 JRBaseFiller [DEBUG] Fill 1: adding page 5394 2012-05-20 10:16:27 JRFillSubreport [DEBUG] Fill 1: resuming 2 2012-05-20 10:16:27 JRFillSubreport [DEBUG] Fill 1: resuming 2 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notifying to continue 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notifying to continue 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: waiting for fill result 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: waiting for fill result 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notified to continue 2012-05-20 10:16:27 JRThreadSubreportRunner [DEBUG] Fill 2: notified to continue Thank you in advance for your answers
  3. Hi, I implemented a report with a pageFooter that is not at the bottom of the page but which is placed after the content of the page and I don't see why <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="crfQueryReport" pageWidth="595" pageHeight="842" columnWidth="555" 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"/> <style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/> <style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/> <style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/> <style name="Detail" fontName="Arial" fontSize="12"/> <style name="Row" mode="Transparent"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression> <style backcolor="#E6DAC3"/> </conditionalStyle> </style> <style name="border" isBlankWhenNull="false" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0"/> <leftPen lineWidth="1.0"/> <bottomPen lineWidth="1.0"/> <rightPen lineWidth="1.0"/> </box> </style> <field name="softwareVersion" class="java.lang.String"/> <field name="msgId" class="java.lang.Integer"/> <field name="subNbr" class="java.lang.Integer"/> <field name="msgSubject" class="java.lang.String"/> <field name="msgCenter" class="java.lang.Integer"/> <field name="msgDuedt" class="java.util.Date"/> <field name="msgRead" class="java.lang.String"/> <field name="msgClosed" class="java.lang.String"/> <field name="scrName" class="java.lang.String"/> <field name="endDate" class="java.util.Date"/> <field name="mslUser" class="java.lang.String"/> <field name="mslRole" class="java.lang.String"/> <field name="mslCredt" class="java.util.Date"/> <field name="mslContent" class="java.lang.String"/> <field name="emptyMessage" class="java.lang.String"/> <field name="sstStatus" class="java.lang.String"/> <field name="scheduleName" class="java.lang.String"/> <field name="count" class="java.lang.Integer"/> <field name="totalCount" class="java.lang.Integer"/> <group name="Test"> <groupExpression><![CDATA[$F{msgId}]]></groupExpression> <groupHeader> <band height="22"> <textField> <reportElement x="2" y="4" width="368" height="15"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8" isBold="true" isUnderline="true"/> </textElement> <textFieldExpression><![CDATA[$F{msgSubject}]]></textFieldExpression> </textField> <textField pattern="dd/MM/yyyy"> <reportElement x="459" y="4" width="43" height="14"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{msgDuedt}]]></textFieldExpression> </textField> <textField> <reportElement x="427" y="4" width="31" height="14"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{msgId}]]></textFieldExpression> </textField> <line> <reportElement style="Title" positionType="FixRelativeToBottom" x="0" y="0" width="555" height="1" isPrintWhenDetailOverflows="true"/> <graphicElement> <pen lineWidth="1.5" lineColor="#999999"/> </graphicElement> </line> <textField pattern="dd/MM/yyyy"> <reportElement x="503" y="4" width="43" height="13"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{endDate}]]></textFieldExpression> </textField> <textField> <reportElement x="374" y="4" width="21" height="15"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$F{msgRead}]]></textFieldExpression> </textField> <textField> <reportElement x="396" y="4" width="28" height="15"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{msgClosed}]]></textFieldExpression> </textField> </band> </groupHeader> </group> <background> <band splitType="Stretch"/> </background> <title> <band height="3"/> </title> <pageHeader> <band height="45" splitType="Stretch"> <frame> <reportElement style="border" mode="Opaque" x="1" y="0" width="555" height="45" forecolor="#000000" backcolor="#FFFFFF"/> <staticText> <reportElement x="3" y="32" width="53" height="13"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[schedule:]]></text> </staticText> <textField > <reportElement x="56" y="32" width="139" height="13"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{scheduleName}]]></textFieldExpression> </textField> <staticText> <reportElement x="2" y="8" width="42" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[subject:]]></text> </staticText> <textField> <reportElement x="44" y="8" width="63" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{subNbr}]]></textFieldExpression> </textField> <textField> <reportElement x="189" y="5" width="177" height="14"/> <textElement textAlignment="Center"> <font fontName="Arial" size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{scrName}]]></textFieldExpression> </textField> <textField> <reportElement x="202" y="32" width="151" height="13"/> <textElement textAlignment="Center"> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[($F{sstStatus}.equals("131")? "Completed":$F{sstStatus}.equals("132")? "Completed with Information not available":$F{sstStatus}.equals("133")? "Completed with Forced Validation ":$F{sstStatus}.equals("141")? "Completed after unmarking ":$F{sstStatus}.equals("142")? " Information Not Available after unmarking ":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("151")? "Completed after unmarking ":$F{sstStatus}.equals("152")? " Information Not Available after unmarking ":$F{sstStatus}.equals("153")? "Forced Validation after marking":$F{sstStatus}.equals("999")? "Never entered":$F{sstStatus}.equals("111")? "Marked":$F{sstStatus}.equals("121")? "Marked":$F{sstStatus}.equals("134")? "Data pending":$F{sstStatus}.equals("141")? "Completed after unmarking":$F{sstStatus}.equals("151")? "Completed after unmarking":$F{sstStatus}.equals("142")? "Information Not Available after unmarking":$F{sstStatus}.equals("152")? "Information Not Available after unmarking":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("153")? "Forced Validation after marking": ($F{sstStatus}.equals("144") || $F{sstStatus}.equals("154"))? "Data pending after marking":$F{sstStatus}.equals("112")? "Marked with Information not available":$F{sstStatus}.equals("122")? "Marked with Information not available":$F{sstStatus}.equals("113")? "Marked with Forced Validation ":$F{sstStatus}.equals("123")? "Marked with Forced Validation ": $F{sstStatus}.equals("135")? "Medical doctor": $F{sstStatus}.equals("241")? "Unmarked and completed on cleaned data": $F{sstStatus})]]></textFieldExpression> </textField> <image> <reportElement x="408" y="0" width="146" height="45"/> <imageExpression><![CDATA["/Users/xflamant/Documents/enable/src/main/webapp/img/logo-gsk.gif"]]></imageExpression> </image> </frame> </band> </pageHeader> <columnHeader> <band height="33" splitType="Stretch"> <staticText> <reportElement style="Column header" x="503" y="-2" width="44" height="22" forecolor="#736343"/> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Effective Resolution]]></text> </staticText> <staticText> <reportElement style="Column header" x="459" y="-2" width="44" height="22" forecolor="#736343"/> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Expected Resolution]]></text> </staticText> <staticText> <reportElement style="Column header" x="428" y="-2" width="31" height="22" forecolor="#736343"/> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[id]]></text> </staticText> <staticText> <reportElement style="Column header" x="374" y="-2" width="22" height="22" forecolor="#736343"/> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Read]]></text> </staticText> <staticText> <reportElement style="Column header" x="397" y="-2" width="31" height="22" forecolor="#736343"/> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Closed]]></text> </staticText> <staticText> <reportElement x="0" y="-2" width="92" height="20"/> <textElement verticalAlignment="Bottom"> <font fontName="Arial" size="10" isBold="false"/> </textElement> <text><![CDATA[Query]]></text> </staticText> <textField> <reportElement isPrintRepeatedValues="false" x="0" y="20" width="555" height="13" isRemoveLineWhenBlank="true"> <printWhenExpression><![CDATA[$F{emptyMessage} != null]]></printWhenExpression> </reportElement> <textElement textAlignment="Center"> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{emptyMessage}]]></textFieldExpression> </textField> </band> </columnHeader> <detail> <band height="27"> <textField> <reportElement x="31" y="3" width="106" height="17"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA["From: " + $F{mslUser} + "("+ $F{mslRole}+")"]]></textFieldExpression> </textField> <textField pattern="dd/MM/yyyy HH.mm.ss"> <reportElement x="137" y="3" width="82" height="16"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{mslCredt}]]></textFieldExpression> </textField> <textField> <reportElement stretchType="RelativeToTallestObject" x="219" y="3" width="295" height="24"> <printWhenExpression><![CDATA[$F{emptyMessage} == null]]></printWhenExpression> </reportElement> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{mslContent}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="9" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="30" splitType="Stretch"> <frame> <reportElement positionType="FixRelativeToBottom" mode="Opaque" x="1" y="0" width="554" height="30" forecolor="#D0B48E" backcolor="#FFFFFF"/> <textField pattern="ddMMMyyyy HH:mm:ss"> <reportElement style="Column header" x="432" y="4" width="119" height="13" forecolor="#000000"/> <textElement verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="224" y="3" width="39" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$F{count}+"/"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="264" y="3" width="40" height="20"/> <textElement/> <textFieldExpression><![CDATA["" + $F{totalCount}]]></textFieldExpression> </textField> <staticText> <reportElement x="432" y="18" width="30" height="11"/> <textElement> <font fontName="Arial" size="8"/> </textElement> <text><![CDATA[eN@ble]]></text> </staticText> <textField evaluationTime="Report"> <reportElement x="464" y="19" width="86" height="10"/> <textElement> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$F{softwareVersion}]]></textFieldExpression> </textField> <textField> <reportElement x="1" y="0" width="116" height="14"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{scrName}]]></textFieldExpression> </textField> <textField> <reportElement x="1" y="14" width="116" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[($F{sstStatus}.equals("131")? "Completed":$F{sstStatus}.equals("132")? "Completed with Information not available":$F{sstStatus}.equals("133")? "Completed with Forced Validation ":$F{sstStatus}.equals("141")? "Completed after unmarking ":$F{sstStatus}.equals("142")? " Information Not Available after unmarking ":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("151")? "Completed after unmarking ":$F{sstStatus}.equals("152")? " Information Not Available after unmarking ":$F{sstStatus}.equals("153")? "Forced Validation after marking":$F{sstStatus}.equals("999")? "Never entered":$F{sstStatus}.equals("111")? "Marked":$F{sstStatus}.equals("121")? "Marked":$F{sstStatus}.equals("134")? "Data pending":$F{sstStatus}.equals("141")? "Completed after unmarking":$F{sstStatus}.equals("151")? "Completed after unmarking":$F{sstStatus}.equals("142")? "Information Not Available after unmarking":$F{sstStatus}.equals("152")? "Information Not Available after unmarking":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("153")? "Forced Validation after marking": ($F{sstStatus}.equals("144") || $F{sstStatus}.equals("154"))? "Data pending after marking":$F{sstStatus}.equals("112")? "Marked with Information not available":$F{sstStatus}.equals("122")? "Marked with Information not available":$F{sstStatus}.equals("113")? "Marked with Forced Validation ":$F{sstStatus}.equals("123")? "Marked with Forced Validation ": $F{sstStatus}.equals("135")? "Medical doctor": $F{sstStatus}.equals("241")? "Unmarked and completed on cleaned data": $F{sstStatus})]]></textFieldExpression> </textField> </frame> </band> </pageFooter> <summary> <band splitType="Stretch"/> </summary> </jasperReport> Thank you in advance for your answers
  4. Hi, I solved the problem by changing the strategy I set JasperReport as parameters Code :Sélectionner tout - Visualiser dans une fenêtre à part1 2 3 4 for (int i=0; i < subReportName.size(); i++) { jrxml.append("\t<parameter name=\""+subReportName.get(i)+"_JasperReport\" class=\"net.sf.jasperreports.engine.JasperReport\"/>\n"); }[/code][/code]I reference these parameters in element subReportExpression Code :Sélectionner tout - Visualiser dans une fenêtre à part1 2 "\t\t\t\t<subreportExpression class=\"net.sf.jasperreports.engine.JasperReport\"><![CDATA[$P{"+subReportName.get(i)+"_JasperReport}]]></subreportExpression>\n" +[/code][/code]And it works. Unfortunately, I have a blank page
  5. Hi, I implemented a master report that contains 2 subReports <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="crf" pageWidth="595" pageHeight="842" columnWidth="555" 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"/> <style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/> <style name="table"> <box> <pen lineWidth="1.0" lineColor="#000000"/> </box> </style> <style name="table_TH" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_CH" mode="Opaque" backcolor="#FFBFBF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_TD" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="border" isBlankWhenNull="false" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"> <box> <pen lineWidth="1.0"/> <topPen lineWidth="1.0"/> <leftPen lineWidth="1.0"/> <bottomPen lineWidth="1.0"/> <rightPen lineWidth="1.0"/> </box> </style> <parameter name="SIMPLE_DATA" class="java.util.HashMap"> </parameter> <parameter name="subReport_6071684_JasperReport" class="net.sf.jasperreports.engine.JasperReport"/> <parameter name="subReport_14892984_JasperReport" class="net.sf.jasperreports.engine.JasperReport"/> <field name="softwareVersion" class="java.lang.String"/> <field name="subNbr" class="java.lang.Integer"/> <field name="activityName" class="java.lang.String"/> <field name="sstStatus" class="java.lang.String"/> <field name="scheduleName" class="java.lang.String"/> <field name="subReport_6071684" class="java.lang.String"/> <field name="subReport_14892984" class="java.lang.String"/> <background> <band splitType="Stretch"/> </background> <title> <band height="4" splitType="Stretch"/> </title> <pageHeader> <band height="45" splitType="Stretch"> <frame> <reportElement style="border" mode="Opaque" x="1" y="0" width="555" height="45" forecolor="#000000" backcolor="#FFFFFF"/> <staticText> <reportElement x="3" y="32" width="53" height="13"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[schedule:]]></text> </staticText> <textField > <reportElement x="56" y="32" width="139" height="13"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{scheduleName}]]></textFieldExpression> </textField> <staticText> <reportElement x="2" y="8" width="42" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[subject:]]></text> </staticText> <textField> <reportElement x="44" y="8" width="63" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{subNbr}]]></textFieldExpression> </textField> <textField bookmarkLevel="3"> <reportElement x="192" y="5" width="177" height="18"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$F{activityName}]]></textFieldExpression> <anchorNameExpression><![CDATA[ $F{activityName}]]></anchorNameExpression> </textField> <textField> <reportElement x="201" y="27" width="151" height="18"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[($F{sstStatus}.equals("131")? "Completed":$F{sstStatus}.equals("132")? "Completed with Information not available":$F{sstStatus}.equals("133")? "Completed with Forced Validation ":$F{sstStatus}.equals("141")? "Completed after unmarking ":$F{sstStatus}.equals("142")? " Information Not Available after unmarking ":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("151")? "Completed after unmarking ":$F{sstStatus}.equals("152")? " Information Not Available after unmarking ":$F{sstStatus}.equals("153")? "Forced Validation after marking":$F{sstStatus}.equals("999")? "Never entered":$F{sstStatus}.equals("111")? "Marked":$F{sstStatus}.equals("121")? "Marked":$F{sstStatus}.equals("134")? "Data pending":$F{sstStatus}.equals("141")? "Completed after unmarking":$F{sstStatus}.equals("151")? "Completed after unmarking":$F{sstStatus}.equals("142")? "Information Not Available after unmarking":$F{sstStatus}.equals("152")? "Information Not Available after unmarking":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("153")? "Forced Validation after marking": ($F{sstStatus}.equals("144") || $F{sstStatus}.equals("154"))? "Data pending after marking":$F{sstStatus}.equals("112")? "Marked with Information not available":$F{sstStatus}.equals("122")? "Marked with Information not available":$F{sstStatus}.equals("113")? "Marked with Forced Validation ":$F{sstStatus}.equals("123")? "Marked with Forced Validation ": $F{sstStatus}.equals("135")? "Medical doctor": $F{sstStatus}.equals("241")? "Unmarked and completed on cleaned data": $F{sstStatus})]]></textFieldExpression> </textField> <image> <reportElement x="408" y="0" width="146" height="45"/> <imageExpression><![CDATA["/Users/xflamant/Documents/enable/src/main/webapp/img/logo-gsk.gif"]]></imageExpression> </image> </frame> </band> </pageHeader> <columnHeader> <band height="4" splitType="Stretch"/> </columnHeader> <detail> <band height="594" splitType="Stretch"> <subreport> <reportElement positionType="FixRelativeToTop" x="0" y="0" width="554" height="297"/> <subreportParameter name="subReport_6071684"> <subreportParameterExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_6071684})]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_6071684})]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{subReport_6071684_JasperReport}]]></subreportExpression> </subreport> <subreport> <reportElement positionType="FixRelativeToTop" x="0" y="297" width="554" height="297"/> <subreportParameter name="subReport_14892984"> <subreportParameterExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_14892984})]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[$P{SIMPLE_DATA}.get($F{subReport_14892984})]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{subReport_14892984_JasperReport}]]></subreportExpression> </subreport> </band> </detail> <columnFooter> <band height="8" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="30" splitType="Stretch"> <frame> <reportElement mode="Opaque" x="1" y="0" width="554" height="30" forecolor="#D0B48E" backcolor="#FFFFFF"/> <textField pattern="ddMMMyyyy HH:mm:ss"> <reportElement style="Column header" x="432" y="4" width="119" height="13" forecolor="#000000"/> <textElement verticalAlignment="Middle"> <font size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="224" y="3" width="39" height="20"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+"/"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="264" y="3" width="40" height="20"/> <textElement/> <textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <staticText> <reportElement x="432" y="18" width="30" height="11"/> <textElement> <font fontName="Arial" size="8"/> </textElement> <text><![CDATA[eN@ble]]></text> </staticText> <textField evaluationTime="Report"> <reportElement x="464" y="19" width="86" height="10"/> <textElement> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$F{softwareVersion}]]></textFieldExpression> </textField> <textField> <reportElement x="1" y="0" width="116" height="14"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$F{activityName}]]></textFieldExpression> </textField> <textField> <reportElement x="1" y="14" width="116" height="15"/> <textElement> <font fontName="Arial" size="10" isBold="false"/> </textElement> <textFieldExpression><![CDATA[($F{sstStatus}.equals("131")? "Completed":$F{sstStatus}.equals("132")? "Completed with Information not available":$F{sstStatus}.equals("133")? "Completed with Forced Validation ":$F{sstStatus}.equals("141")? "Completed after unmarking ":$F{sstStatus}.equals("142")? " Information Not Available after unmarking ":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("151")? "Completed after unmarking ":$F{sstStatus}.equals("152")? " Information Not Available after unmarking ":$F{sstStatus}.equals("153")? "Forced Validation after marking":$F{sstStatus}.equals("999")? "Never entered":$F{sstStatus}.equals("111")? "Marked":$F{sstStatus}.equals("121")? "Marked":$F{sstStatus}.equals("134")? "Data pending":$F{sstStatus}.equals("141")? "Completed after unmarking":$F{sstStatus}.equals("151")? "Completed after unmarking":$F{sstStatus}.equals("142")? "Information Not Available after unmarking":$F{sstStatus}.equals("152")? "Information Not Available after unmarking":$F{sstStatus}.equals("143")? "Forced Validation after marking":$F{sstStatus}.equals("153")? "Forced Validation after marking": ($F{sstStatus}.equals("144") || $F{sstStatus}.equals("154"))? "Data pending after marking":$F{sstStatus}.equals("112")? "Marked with Information not available":$F{sstStatus}.equals("122")? "Marked with Information not available":$F{sstStatus}.equals("113")? "Marked with Forced Validation ":$F{sstStatus}.equals("123")? "Marked with Forced Validation ": $F{sstStatus}.equals("135")? "Medical doctor": $F{sstStatus}.equals("241")? "Unmarked and completed on cleaned data": $F{sstStatus})]]></textFieldExpression> </textField> </frame> </band> </pageFooter> <summary> <band height="9" splitType="Stretch"/> </summary> </jasperReport> Unfornutaly I have a blank page except for header and footer. The central panel is blank The 2 subReports are normally pages with fields inside with values and labels I don't see how to debug it, and I am wondering: if I have 3 subReports, does the pagination will be correctly incremented on 3 pages and does the headers and footers of each page of subReport will be the master report header and footer or the subReports one ? I am wondering if it is not an issue of pagination Thank you if you can give me an clue
  6. Hi, I generate a masterReport that includ subReports Within teh masterReport, I define fields and a parameter SIMPLE_DATA "t<parameter name="SIMPLE_DATA" class="java.util.HashMap">n" + for (int i=0; i < subReportName.size(); i++) { jrxml.append("t<field name=""+subReportName.get(i)+"" class="java.lang.String"/>n"); jrxml.append("t<field name=""+subReportName.get(i)+"_JasperReport" class="java.lang.String"/>n"); } in the detail section, I define the subreport for (int i=0; i < subReportName.size(); i++) { jrxml.append("ttt<subreport>n" + "tttt<reportElement positionType="Float" x="67" y="18" width="168" height="47"/>n" + "tttt<subreportParameter name=""+subReportName.get(i)+"">n" + "ttttt<subreportParameterExpression><![CDATA[$P{SIMPLE_DATA}.get($F{"+subReportName.get(i)+"})]]></subreportParameterExpression>n" + "tttt</subreportParameter>n" + "tttt<subreportParameter name=""+subReportName.get(i)+"_JasperReport">n" + "ttttt<subreportParameterExpression><![CDATA[$P{SIMPLE_DATA}.get($F{"+subReportName.get(i)+"_JasperReport})]]></subreportParameterExpression>n" + "tttt</subreportParameter>n" + "tttt<dataSourceExpression><![CDATA[$P{SIMPLE_DATA}.get($F{"+subReportName.get(i)+"})]]></dataSourceExpression>n" + "tttt<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SIMPLE_DATA}.get($F{"+subReportName.get(i)+"_JasperReport}]]></subreportExpression>n" + "ttt</subreport>n"); } In the master dataSource I add the following for (int i=0; i < subReportName.size(); i++) { simpleMasterMap.put(subReportName.get(i), subReportName.get(i)); simpleMasterMap.put(subReportName.get(i)+"_JasperReport", subReportName.get(i)+"_JasperReport"); } List simpleMasterList = new ArrayList(); simpleMasterList.add(simpleMasterMap); JRDataSource simpleDS = new JRMapCollectionDataSource(simpleMasterList); SIMPLE_DATA is added into the master parameters HashMap SIMPLE_DATA = new HashMap(); for (int i=0; i < subReportDataSource.size(); i++) { SIMPLE_DATA.put(subReportName.get(i), subReportDataSource.get(i)); } for (int i=0; i < subReportDataSource.size(); i++) { SIMPLE_DATA.put(subReportName.get(i)+"_JasperReport", subReportJasperReport.get(i)); } params.put("SIMPLE_DATA", SIMPLE_DATA); And I have the following compilatio exception net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Syntax error, insert ")" to complete Expression value = ((java.util.HashMap)parameter_SIMPLE_DATA.getValue()).get(((java.lang.String)field_subReport_6071684_JasperReport.getValue()); //$JR_EXPR_ID=17$ ^ 2. Syntax error, insert ")" to complete Expression value = ((java.util.HashMap)parameter_SIMPLE_DATA.getValue()).get(((java.lang.String)field_subReport_14892984_JasperReport.getValue()); //$JR_EXPR_ID=21$ ^ 3. Syntax error, insert ")" to complete Expression value = ((java.util.HashMap)parameter_SIMPLE_DATA.getValue()).get(((java.lang.String)field_subReport_6071684_JasperReport.getOldValue()); //$JR_EXPR_ID=17$ ^ 4. Syntax error, insert ")" to complete Expression value = ((java.util.HashMap)parameter_SIMPLE_DATA.getValue()).get(((java.lang.String)field_subReport_14892984_JasperReport.getOldValue()); //$JR_EXPR_ID=21$ ^ 5. Syntax error, insert ")" to complete Expression value = ((java.util.HashMap)parameter_SIMPLE_DATA.getValue()).get(((java.lang.String)field_subReport_6071684_JasperReport.getValue()); //$JR_EXPR_ID=17$ ^ 6. Syntax error, insert ")" to complete Expression value = ((java.util.HashMap)parameter_SIMPLE_DATA.getValue()).get(((java.lang.String)field_subReport_14892984_JasperReport.getValue()); //$JR_EXPR_ID=21$ ^ 6 errors I don't see what causes the error. Thank you in advance for your answers Post Edited by flamant at 05/14/2012 14:35
  7. Hi, when you say Here's how to do it in iReport 1. In your variable or field you want to use, set the hyperlink value to the desired field or variable you want. Make sure it is set the hyperlink to Self... 2. Set the bookmark level to 1 (or whatever level you wish) That's it... I don't see a possibility to achieve it in iReport 4.1.3 if I display variable PAGE_NUMBER properties, I only see "Name" and "Variable Class" properties if I display a textfield properties, I see no "hyperlink" property furthermore where do you set the hyperlink to Self and set the bookmark level ? Thanks in advance for your reply
  8. Hi, I use a barchart that displays status on the X axis and the amount of data that has the status on Y axis. Everything works fine when I have more than one unit on Y axis or more than one status on X axis : the legend is printed, But when I have one unit on Y axis and one status on X axis, the legend isn't printed
  9. Hi, I know how to generate a report in PDF format by designing it with iReport Designer. First I put the PDF format as parameter in my Java code. But the design of iReport Designer seems to be targeted for A4 page like PDF page. I can put the XLS format in my java code but the design of iReport Designer doesn't take into account the particularities of an EXCELL sheet. For example I don't know how to put a column title in columns "B", "C", "D", "E" in line 3 of the EXCELL sheet and how to put the corresponding values in column "B", "C", "D", "E" in lines 4, 5, 6 and so on Can anyone give me a detailed example of a design for EXCELL sheet ?
  10. Hi, I designed a report with a crossTab and a footer. But the footer is displayed only on the first page not on the other pages I put the same footer on other reports and it works well. These other reports haven't a crossTab Thank you in advance for your answers Here is the XML file <?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="activityStatusReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="2.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/> <style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/> <style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/> <style name="Detail" fontName="Arial" fontSize="12"/> <style name="Row" mode="Transparent"> <conditionalStyle> <conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression> <style backcolor="#E6DAC3"/> </conditionalStyle> </style> <style name="table"> <box> <pen lineWidth="1.0" lineColor="#000000"/> </box> </style> <style name="table_TH" mode="Opaque" backcolor="#F0F8FF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_CH" mode="Opaque" backcolor="#BFE1FF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table_TD" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table 1"> <box> <pen lineWidth="1.0" lineColor="#000000"/> </box> </style> <style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF"> <box> <pen lineWidth="0.5" lineColor="#000000"/> </box> </style> <style name="Crosstab Data Text" hAlign="Center"/> <subDataset name="Table Dataset 1"> <queryString language="SQL"> <![CDATA[]]> </queryString> </subDataset> <subDataset name="dataset1"/> <subDataset name="Table Dataset 2"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["/tmp"]]></defaultValueExpression> </parameter> <field name="protocolName" class="java.lang.String"/> <field name="softwareVersion" class="java.lang.String"/> <field name="actName" class="java.lang.String"/> <field name="scrName" class="java.lang.String"/> <field name="subId" class="java.lang.Integer"/> <field name="sstStatus" class="java.lang.String"/> <field name="subCenter" class="java.lang.Integer"/> <background> <band splitType="Stretch"/> </background> <title> <band height="42"> <staticText> <reportElement x="351" y="21" width="53" height="20"/> <textElement textAlignment="Right"> <font fontName="Arial" size="10" isBold="true"/> </textElement> <text><![CDATA[Center:]]></text> </staticText> <staticText> <reportElement x="2" y="25" width="53" height="17"/> <textElement> <font fontName="Arial" size="12" isBold="true"/> </textElement> <text><![CDATA[Protocol:]]></text> </staticText> <staticText> <reportElement x="0" y="0" width="204" height="25"/> <textElement> <font fontName="Arial" size="18" isBold="true"/> </textElement> <text><![CDATA[Activity Status]]></text> </staticText> <textField> <reportElement x="55" y="25" width="149" height="16"/> <textElement> <font fontName="Arial" size="12"/> </textElement> <textFieldExpression><![CDATA[$F{protocolName}]]></textFieldExpression> </textField> <textField> <reportElement x="406" y="21" width="145" height="20"/> <textElement> <font fontName="Arial" size="12"/> </textElement> <textFieldExpression><![CDATA[$F{subCenter}]]></textFieldExpression> </textField> </band> </title> <pageFooter> <band height="26"> <frame> <reportElement mode="Opaque" x="2" y="0" width="553" height="24" forecolor="#D0B48E" backcolor="#F2EBDF"/> <textField pattern="ddMMMyyyy HH:mm:ss"> <reportElement style="Column header" x="433" y="0" width="119" height="13" forecolor="#000000"/> <textElement verticalAlignment="Middle"> <font size="8" isBold="false"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> <reportElement x="216" y="3" width="39" height="20"/> <textElement textAlignment="Right"> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+"/"]]></textFieldExpression> </textField> <textField evaluationTime="Report"> <reportElement x="255" y="3" width="40" height="20"/> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField> <reportElement x="464" y="12" width="88" height="11"/> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$F{softwareVersion}]]></textFieldExpression> </textField> </frame> </band> </pageFooter> <summary> <band height="50"> <crosstab ignoreWidth="false"> <reportElement stretchType="RelativeToBandHeight" x="3" y="6" width="548" height="44"/> <rowGroup name="ACT_NAME" width="104" totalPosition="End"> <bucket class="java.lang.String"> <bucketExpression><![CDATA[$F{actName}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents backcolor="#F0F8FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="0" y="0" width="102" height="21"/> <textElement> <font fontName="Arial" size="8"/> </textElement> <textFieldExpression><![CDATA[$V{ACT_NAME}]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents backcolor="#BFE1FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <staticText> <reportElement x="0" y="0" width="102" height="25"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Arial" size="8" isBold="true"/> </textElement> <text><![CDATA[Total]]></text> </staticText> </cellContents> </crosstabTotalRowHeader> </rowGroup> <columnGroup name="SST_STATUS" height="37" totalPosition="End"> <bucket class="java.lang.String"> <bucketExpression><![CDATA[$F{sstStatus}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents backcolor="#F0F8FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="2" y="0" width="44" height="37" isPrintInFirstWholeBand="true"/> <textElement> <font fontName="Arial" size="7"/> </textElement> <textFieldExpression><![CDATA[($V{SST_STATUS}.equals("131")? "Completed":$V{SST_STATUS}.equals("132")? "Completed with Information not available":$V{SST_STATUS}.equals("133")? "Completed with Forced Validation ":$V{SST_STATUS}.equals("141")? "Completed after unmarking ":$V{SST_STATUS}.equals("142")? " Information Not Available after marking ":$V{SST_STATUS}.equals("143")? "Forced Validation after marking":$V{SST_STATUS}.equals("151")? "Completed after unmarking ":$V{SST_STATUS}.equals("152")? " Information Not Available after marking ":$V{SST_STATUS}.equals("153")? "Forced Validation after marking":$V{SST_STATUS}.equals("999")? "Never entered":$V{SST_STATUS}.equals("111")? "Marked":$V{SST_STATUS}.equals("121")? "Marked":$V{SST_STATUS}.equals("134")? "Data pending":$V{SST_STATUS}.equals("141")? "Completed after marking":$V{SST_STATUS}.equals("151")? "Completed after marking":$V{SST_STATUS}.equals("142")? "Information Not Available after marking":$V{SST_STATUS}.equals("152")? "Information Not Available after marking":$V{SST_STATUS}.equals("143")? "Forced Validation after marking":$V{SST_STATUS}.equals("153")? "Forced Validation after marking":$V{SST_STATUS}.equals("144")? "Data pending after marking":$V{SST_STATUS}.equals("154")? "Data pending after marking":$V{SST_STATUS}.equals("112")? "Marked with Information not available":$V{SST_STATUS}.equals("122")? "Marked with Information not available":$V{SST_STATUS}.equals("113")? "Marked with Forced Validation ":$V{SST_STATUS}.equals("123")? "Marked with Forced Validation ":$V{SST_STATUS})]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents backcolor="#BFE1FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <staticText> <reportElement x="1" y="0" width="53" height="37"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Arial" size="7"/> </textElement> <text><![CDATA[Total Number of subjects for which the activity exists]]></text> </staticText> </cellContents> </crosstabTotalColumnHeader> </columnGroup> <measure name="SUB_IDMeasure" class="java.lang.Integer" calculation="Count"> <measureExpression><![CDATA[$F{subId}]]></measureExpression> </measure> <crosstabCell width="48" height="21"> <cellContents> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="2" y="0" width="44" height="21"/> <textElement> <font fontName="Arial" size="7"/> </textElement> <textFieldExpression><![CDATA[$V{SUB_IDMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="48" height="25" rowTotalGroup="ACT_NAME"> <cellContents backcolor="#BFE1FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="2" y="0" width="44" height="25"/> <textElement verticalAlignment="Middle"> <font fontName="Arial" size="8" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{SUB_IDMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="56" height="21" columnTotalGroup="SST_STATUS"> <cellContents backcolor="#BFE1FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="1" y="0" width="53" height="21"/> <textElement> <font fontName="Arial" size="7"/> </textElement> <textFieldExpression><![CDATA[$V{SUB_IDMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="56" rowTotalGroup="ACT_NAME" columnTotalGroup="SST_STATUS"> <cellContents backcolor="#BFE1FF" mode="Opaque"> <box> <pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> </box> <textField> <reportElement style="Crosstab Data Text" x="1" y="0" width="53" height="25"/> <textElement verticalAlignment="Middle"> <font fontName="Arial" size="8" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{SUB_IDMeasure}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> </crosstab> </band> </summary> </jasperReport>
  11. Hi, I designed a report with a crosstab and populate the jrDataSource with object ActivityStatusReportItem that have two properties "actName" and "sstStatus" (both are String) The column Groups is defined with the Bucket expression ${sstStatus} which is a String. I would like to sort the column depending on the value of "sstStatus". For example I would like that the first column were the column for which the sstStatus is "131" and the second column were the column for which the sstStatus is "145". I can see in the properties that there is a "Comparator exp" property (they say that this expression's type must be compatible with java.util.Comparator) or a "Order by exp" property (they say that it should be compatible with java.lang.Comparable, otherwise a custom comparator expression would be required). I don't know how to use these 2 properties. Can anyone show me a detailed example of how to use it ? I have the same problem with the Row Groups for which the Bucket expression is ${actName} and I want to sort the lines on "actName" ascending order. I tried to sort the dataSource to achieve this problem but without success. Thank you in advance for your answers
×
×
  • Create New...