I'm using TIBCO Jaspersoft® Studio 6.8.0 and I'm having some issues positioning things. I thought that the positioning would be kinda automatic following the GUI, but apparently it doesn't work like that.
I have a SubReport (no need for the master report right now) that calls other 2 SubReports, one for a pie chart and one for a crosstab. They both working pretty fine using subdataset from an external json (local json).
The problem is that I can't position them properly: I would need the pie chart to be positioned in the top part of the page, and the crosstab immediatly below.
Here's the subreport (used as master report now). You can see I'm using a mock (xml that calls a json), I will add the json at the end of the question.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b -->
<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="ReportAnomalies_subReport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0a8e5b1c-8d35-4290-a283-c7fb4e197131">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="report\mock\TestTemp.xml"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="DefaultStyle" isDefault="true" fontName="SinaFont" fontSize="8"/>
<style name="DefaultTableStyle" style="DefaultStyle">
<box>
<pen lineWidth="0.5" lineColor="#888888"/>
</box>
</style>
<style name="DefaultTableHeaderStyle" style="DefaultTableStyle" mode="Opaque" backcolor="#F0F0F0"/>
<style name="Table_H" style="DefaultTableHeaderStyle"/>
<style name="Table_T" style="DefaultTableStyle"/>
<style name="Table_D" style="DefaultTableStyle"/>
<field name="NomeAnomalia" class="java.lang.String"/>
<field name="GruppiAnomalie" class="java.lang.Integer"/>
<field name="Total" class="java.lang.String"/>
<detail>
<band height="290">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<subreport>
<reportElement key="" x="10" y="0" width="535" height="290" uuid="37faa740-d0e0-457e-bb66-a9dbfc252683"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("pieChartData")]]></dataSourceExpression>
<subreportExpression><![CDATA["ReportAnomalies_pieChart.jasper"]]></subreportExpression>
</subreport>
</band>
<band height="80">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<subreport>
<reportElement key="" style="DefaultTableStyle" x="10" y="0" width="535" height="80" uuid="ca3470c0-044b-4905-9524-5c0a948961a5">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("anomalyList")]]></dataSourceExpression>
<subreportExpression><![CDATA["ReportAnomalies_crosstab.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>
The pie chart subreport (I use the workaround <printWhenExpression><![CDATA[$F{print} == 1]]></printWhenExpression> because it will print the pie chart 3 times if not used)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b -->
<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="ReportAnomalies_pieChart" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0a8e5b1c-8d35-4290-a283-c7fb4e197131">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<style name="DefaultStyle" isDefault="true" fontName="SinaFont" fontSize="8"/>
<style name="DefaultTableStyle" style="DefaultStyle">
<box>
<pen lineWidth="0.5" lineColor="#888888"/>
</box>
</style>
<style name="DefaultTableHeaderStyle" style="DefaultTableStyle" mode="Opaque" backcolor="#F0F0F0"/>
<style name="Table_H" style="DefaultTableHeaderStyle"/>
<style name="Table_T" style="DefaultTableStyle"/>
<style name="Table_D" style="DefaultTableStyle"/>
<field name="print" class="java.lang.Integer"/>
<field name="severityName" class="java.lang.String"/>
<field name="severityValue" class="java.lang.Integer"/>
<field name="severityLabel" class="java.lang.String"/>
<detail>
<band height="285" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<pieChart>
<chart evaluationTime="Report">
<reportElement style="DefaultTableStyle" x="40" y="0" width="420" height="280" uuid="65c16b4b-d856-4d7f-bb7b-a0c0aa0f3a3a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$F{print} == 1]]></printWhenExpression>
</reportElement>
<box>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset maxCount="3">
<keyExpression><![CDATA[$F{severityName}]]></keyExpression>
<valueExpression><![CDATA[$F{severityValue}]]></valueExpression>
<labelExpression><![CDATA[$F{severityLabel}]]></labelExpression>
</pieDataset>
<piePlot>
<plot>
<seriesColor seriesOrder="0" color="#80E31E"/>
<seriesColor seriesOrder="1" color="#F09918"/>
<seriesColor seriesOrder="2" color="#DE3700"/>
</plot>
<itemLabel/>
</piePlot>
</pieChart>
</band>
</detail>
</jasperReport>
Now the crosstab subreport
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b -->
<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="Prova" pageWidth="595" pageHeight="842" orientation="Landscape" whenNoDataType="NoPages" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true" isSummaryWithPageHeaderAndFooter="true" uuid="1916d28f-c2ed-4735-a541-6dfbd82fe676">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<style name="DefaultStyle" isDefault="true" fontName="SinaFont" fontSize="8"/>
<style name="DefaultTableStyle" style="DefaultStyle">
<box>
<pen lineWidth="0.5" lineColor="#888888"/>
</box>
</style>
<style name="DefaultTableHeaderStyle" style="DefaultTableStyle" mode="Opaque" backcolor="#F0F0F0"/>
<style name="Table_H" style="DefaultTableHeaderStyle"/>
<style name="Table_T" style="DefaultTableStyle"/>
<style name="Table_D" style="DefaultTableStyle"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="NomeAnomalia" class="java.lang.String"/>
<field name="Value" class="java.lang.String"/>
<field name="Code" class="java.lang.String"/>
<field name="Severity" class="java.lang.String"/>
<field name="GruppiAnomalie" class="java.lang.String"/>
<variable name="VI" class="java.lang.Float">
<variableExpression><![CDATA[Float.parseFloat($F{Value})]]></variableExpression>
</variable>
<variable name="GruppiAnomalieI" class="java.lang.Integer">
<variableExpression><![CDATA[Integer.parseInt($F{GruppiAnomalie})]]></variableExpression>
</variable>
<group name="Group1">
<groupExpression><![CDATA[$V{GruppiAnomalieI}]]></groupExpression>
<groupFooter>
<band height="80">
<crosstab columnBreakOffset="20">
<reportElement x="30" y="0" width="520" height="70" uuid="af9d4537-350c-4e0b-a338-009d92c884d5">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value=""/>
</reportElement>
<box leftPadding="3"/>
<crosstabDataset>
<dataset resetType="Group" resetGroup="Group1"/>
</crosstabDataset>
<rowGroup name="Severity1" width="30">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Severity}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Table_H">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<textField>
<reportElement x="0" y="0" width="30" height="20" uuid="683211f0-a5a5-4cb4-aadc-658e5185baca">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{Severity1}.substring(4)]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents mode="Opaque" style="Table_T">
<staticText>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="b709de74-24d7-42d1-975c-3ff583a2f091"/>
<text><![CDATA[Totale Severity1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="Code1" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Code}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Table_H">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<textField>
<reportElement x="0" y="0" width="25" height="20" uuid="8e897853-1771-4c8e-af55-24e5d5e3708a"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$V{Code1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents mode="Opaque" style="Table_T">
<staticText>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="0423ca98-83a4-48b4-828b-ecc91f72c6df"/>
<text><![CDATA[Totale Code1]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="Value_MEASURE1" class="java.lang.Float" calculation="Sum">
<measureExpression><![CDATA[$V{VI}]]></measureExpression>
</measure>
<measure name="NA" class="java.lang.String">
<measureExpression><![CDATA["n/a"]]></measureExpression>
</measure>
<crosstabCell width="25" height="20">
<cellContents mode="Opaque" style="Table_D">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<textField pattern="#,##0.##">
<reportElement x="0" y="0" width="25" height="20" uuid="8f7c6a83-bec1-4fdd-995b-c15df0712202"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$V{Value_MEASURE1} == -1 ? $V{NA} : $V{Value_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
</band>
</groupFooter>
</group>
</jasperReport>
And finally the json file, very simple
[
{
"NomeAnomalia": "MIT Impalcati,Travi,Traversi CA CAP",
"GruppiAnomalie": 201,
"Total": "6%",
"anomalyList": [
{
"GruppiAnomalie": 201,
"Code": "cacap1",
"Name": "Macchie di umidita passiva",
"Severity": "0 - Lieve",
"Value": 3.2736806021763885
},
{
"GruppiAnomalie": 201,
"Code": "cacap12",
"Name": "Macchie di umidita passiva",
"Severity": "0 - Lieve",
"Value": 1.2736806021763885
},
{
"GruppiAnomalie": 201,
"Code": "cacap16",
"Name": "Macchie di umidita passiva",
"Severity": "2 - Forte",
"Value": 0.7736806021763885
},
{
"GruppiAnomalie": 201,
"Code": "DifGen1",
"Name": "Macchie di umidita passiva",
"Severity": "1 - Media",
"Value": 1.571812154
}
],
"pieChartData": [
{"print": 1, "severityName": "Lieve", "severityValue": 25, "severityLabel": "25%"},
{"print": 0, "severityName": "Media", "severityValue": 15, "severityLabel": "15%"},
{"print": 0, "severityName": "Forte", "severityValue": 38, "severityLabel": "38%"}
]
},
{
"NomeAnomalia": "MIT Pile,Spalle,Fondazioni CLS",
"GruppiAnomalie": 202,
"Total": "6%",
"anomalyList": [
{
"GruppiAnomalie": 202,
"Code": "cacap1",
"Name": "Macchie di umidita passiva",
"Severity": "0 - Lieve",
"Value": 3.2736806021763885
},
{
"GruppiAnomalie": 202,
"Code": "cacap12",
"Name": "Macchie di umidita passiva",
"Severity": "0 - Lieve",
"Value": 1.2736806021763885
},
{
"GruppiAnomalie": 202,
"Code": "cacap16",
"Name": "Macchie di umidita passiva",
"Severity": "2 - Forte",
"Value": 0.7736806021763885
}
],
"pieChartData": [
{"print": 1, "severityName": "Lieve", "severityValue": 25, "severityLabel": "5%"},
{"print": 0, "severityName": "Media", "severityValue": 15, "severityLabel": "87%"},
{"print": 0, "severityName": "Forte", "severityValue": 38, "severityLabel": "47%"}
]
}
]
I don't think the problem is to be found in subreports...at least not in the operational part, but I still don't know why it appears like this (3 pages instead of 2 and weird positioning)...they are in order, first, second and third page
Any suggestion?
The workaround you use in the pie chart subreport is causing the empty space in the generated report.
You set the print when expression for the pie chart element. That makes the pie chart not print for the second and third records, but the detail band itself will still consume its declared height even if the chart doesn't print.
A simple way to fix this is to set the print when expression for the band instead of the chart element. That will make the whole band not printing for the second and third records.
But a more normal solution would be to place the chart element in the summary band (with no print when expression), and remove the detail band altogether.
Related
I have a task to generate PDFs with nodeJS, so i am working with the node-jasper library.
what i want to know is how can i send multiple datasets in order to fill multiple charts. I can only send one dataset (the main dataset):/
here is my complete code:
const express = require('express')
var fs = require('fs')
const app = express()
const port = 5000
var jasper = require('node-jasper')({
path: './lib/jasperreports-6.10.0',
reports: {
hw: {
jasper: './jasperFiles/test.jasper',
jrxml: './reports/test.jrxml',
conn: 'in_memory_json'
}
},
});
app.get('/jasper1', (req, res) => {
var report = {
report: 'hw',
data: {
title: "test title",
dataset1: jasper.toJsonDataSource(
{
dados: [
{
c: "ar",
x: 'Arabe',
y: 20,
},
{
c: "en",
x: 'English',
y: 40,
}
]
},
'dados'
),
dataset2: jasper.toJsonDataSource(
{
dados: [
{
c: "eu",
x: 'Euro',
y: 15,
},
{
c: "usd",
x: 'Dollar',
y: 35,
}
]
},
'dados'
)
}
,
dataset:{},
}
var pdf = jasper.pdf(report);
res.set({
'Content-type': 'application/pdf',
'Content-Length': pdf.length
});
res.send(pdf)
});
app.listen(port, () => {
console.log('app is runing on port: ', port)
})
This the the report Design:
enter image description here
And This is the two datasets that i have created:
enter image description here
and this is my jrxml file:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.10.0.final using JasperReports Library version 6.10.0-unknown -->
<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="test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d2376d66-daf9-486d-877e-cc7f2fe28426">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<subDataset name="dataset1" uuid="80298b05-e1fd-427e-b7b5-c6a9e571d151">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="x" class="java.lang.String"/>
<field name="y" class="java.lang.Integer"/>
<field name="c" class="java.lang.String"/>
</subDataset>
<subDataset name="dataset2" uuid="a4f9409d-a1fa-45a5-a00b-d2f95b31573e">
<queryString>
<![CDATA[]]>
</queryString>
<field name="x" class="java.lang.String"/>
<field name="y" class="java.lang.Integer"/>
<field name="c" class="java.lang.String"/>
</subDataset>
<parameter name="title" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="64" splitType="Stretch">
<staticText>
<reportElement x="50" y="0" width="103" height="64" uuid="6f999744-c4f9-48ef-a587-677dc644d77d"/>
<textElement>
<font size="26"/>
</textElement>
<text><![CDATA[Title]]></text>
</staticText>
<textField>
<reportElement x="140" y="10" width="100" height="30" uuid="e5a12f91-ddb4-445b-9f5b-57093703abaa"/>
<textFieldExpression><![CDATA[$P{title}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="604" splitType="Stretch">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/>
<pieChart>
<chart evaluationTime="Report">
<reportElement x="0" y="0" width="278" height="604" uuid="49052c41-6b67-42ed-9c84-c3089d3b2411"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset maxCount="10">
<dataset>
<datasetRun subDataset="dataset1" uuid="7466bccc-a18d-4c68-801f-caac7533de69"/>
</dataset>
<keyExpression><![CDATA[$F{c}]]></keyExpression>
<valueExpression><![CDATA[$F{y}]]></valueExpression>
<labelExpression><![CDATA[$F{x}]]></labelExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel/>
</piePlot>
</pieChart>
<pieChart>
<chart evaluationTime="Report">
<reportElement x="278" y="0" width="277" height="604" uuid="9f438f49-3f14-44b9-81a4-5f475ff6ecb2"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset maxCount="10">
<dataset>
<datasetRun subDataset="dataset2" uuid="ce453374-bcf5-4b02-b8d9-35b263f143bc"/>
</dataset>
<keyExpression><![CDATA[$F{c}]]></keyExpression>
<valueExpression><![CDATA[$F{y}]]></valueExpression>
<labelExpression><![CDATA[$F{x}]]></labelExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel/>
</piePlot>
</pieChart>
</band>
</detail>
<summary>
<band height="67" splitType="Stretch">
<staticText>
<reportElement x="180" y="10" width="151" height="51" uuid="da960c22-4947-49e0-9185-d2d39e21bcd7"/>
<textElement>
<font size="26"/>
</textElement>
<text><![CDATA[Footer]]></text>
</staticText>
</band>
</summary>
</jasperReport>
The problem is that when i run my code, the charts does not appear in the generated PDF, is this the right way to send datasets values ?
Can you help please ?
You need to declare the dataset1 and dataset2 parameters in the report and send them as data sources for the two chart subdatasets.
Like this (see the parameter definitions and the dataSourceExpression under datasetRun):
<parameter name="title" class="java.lang.String"/>
<parameter name="dataset1" class="net.sf.jasperreports.engine.JRDataSource"/>
<parameter name="dataset2" class="net.sf.jasperreports.engine.JRDataSource"/>
...
<detail>
<band height="604" splitType="Stretch">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/>
<pieChart>
<chart evaluationTime="Report">
<reportElement x="0" y="0" width="278" height="604" uuid="49052c41-6b67-42ed-9c84-c3089d3b2411"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset maxCount="10">
<dataset>
<datasetRun subDataset="dataset1" uuid="7466bccc-a18d-4c68-801f-caac7533de69">
<dataSourceExpression><![CDATA[$P{dataset1}]]></dataSourceExpression>
</datasetRun>
</dataset>
<keyExpression><![CDATA[$F{c}]]></keyExpression>
<valueExpression><![CDATA[$F{y}]]></valueExpression>
<labelExpression><![CDATA[$F{x}]]></labelExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel/>
</piePlot>
</pieChart>
<pieChart>
<chart evaluationTime="Report">
<reportElement x="278" y="0" width="277" height="604" uuid="9f438f49-3f14-44b9-81a4-5f475ff6ecb2"/>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset maxCount="10">
<dataset>
<datasetRun subDataset="dataset2" uuid="ce453374-bcf5-4b02-b8d9-35b263f143bc">
<dataSourceExpression><![CDATA[$P{dataset2}]]></dataSourceExpression>
</datasetRun>
</dataset>
<keyExpression><![CDATA[$F{c}]]></keyExpression>
<valueExpression><![CDATA[$F{y}]]></valueExpression>
<labelExpression><![CDATA[$F{x}]]></labelExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel/>
</piePlot>
</pieChart>
</band>
</detail>
I am working on a report where I am having the scenario like the following:
I have got the value of Col 3 & Row 1 from Sub-Report 1 to Main Report. Now, I want to hide the Sub-report 1 if the value returned by it is 1. The way I am trying to do this is as follows:
Get the value in Main Report using the Edit Return Values option in Jasper Studio.
Apply $V{rowNumberSum}==1 on Print When Expression
What is the result?
When I apply Print When Expression, the value of rowNumberSum becomes null.
Here is the code for sub-report named as Blank_A4
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.10.0.final using JasperReports Library version 6.10.0-unknown -->
<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="Blank_A4" pageWidth="300" pageHeight="300" columnWidth="260" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4fcf5f85-7a0c-44bc-b2ca-658905e3b408">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="FeaturesAnalyzedIn12MonthsAdapter"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="Table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Dataset1" uuid="a870c303-592a-48fa-b215-f208cbe6dd89">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="FeaturesAnalyzedAndReviewedIn12MonthsAdapter"/>
<property name="net.sf.jasperreports.data.adapter" value="/home/jamshaid/JaspersoftWorkspace/Line Chart/FeaturesAnalyzedAndReviewedIn12MonthsAdapter.xml"/>
<parameter name="JSON_INPUT_STREAM" class="java.io.InputStream" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.source" class="java.lang.String" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.sources" class="java.util.List" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.date.pattern" class="java.lang.String" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.number.pattern" class="java.lang.String" isForPrompting="false"/>
<parameter name="JSON_LOCALE" class="java.util.Locale" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.locale.code" class="java.lang.String" isForPrompting="false"/>
<parameter name="JSON_TIME_ZONE" class="java.util.TimeZone" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.timezone.id" class="java.lang.String" isForPrompting="false"/>
<queryString language="JSON">
<![CDATA[]]>
</queryString>
<field name="month" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="month"/>
<fieldDescription><![CDATA[month]]></fieldDescription>
</field>
<field name="percentage" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="percentage"/>
<fieldDescription><![CDATA[percentage]]></fieldDescription>
</field>
<variable name="rowNumber" class="java.lang.Integer">
<variableExpression><![CDATA[IF($V{REPORT_COUNT}==1,1,0)]]></variableExpression>
</variable>
<variable name="rowNumberSum" class="java.lang.Integer" calculation="First">
<variableExpression><![CDATA[$V{rowNumber}]]></variableExpression>
</variable>
</subDataset>
<parameter name="JSON_INPUT_STREAM" class="java.io.InputStream" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.source" class="java.lang.String" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.sources" class="java.util.List" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.date.pattern" class="java.lang.String" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.number.pattern" class="java.lang.String" isForPrompting="false"/>
<parameter name="JSON_LOCALE" class="java.util.Locale" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.locale.code" class="java.lang.String" isForPrompting="false"/>
<parameter name="JSON_TIME_ZONE" class="java.util.TimeZone" isForPrompting="false"/>
<parameter name="net.sf.jasperreports.json.timezone.id" class="java.lang.String" isForPrompting="false"/>
<queryString language="JSON">
<![CDATA[]]>
</queryString>
<field name="month" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="month"/>
<fieldDescription><![CDATA[month]]></fieldDescription>
</field>
<field name="percentage" class="java.lang.Double">
<property name="net.sf.jasperreports.json.field.expression" value="percentage"/>
<fieldDescription><![CDATA[percentage]]></fieldDescription>
</field>
<variable name="rowNumberSum" class="java.lang.Integer" resetType="None"/>
<summary>
<band height="239" splitType="Stretch">
<componentElement>
<reportElement x="-20" y="20" width="200" height="200" uuid="5d154620-3646-49fc-9702-8af059721751">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.table.style.table_header" value="Table 1_TH"/>
<property name="com.jaspersoft.studio.table.style.column_header" value="Table 1_CH"/>
<property name="com.jaspersoft.studio.table.style.detail" value="Table 1_TD"/>
<property name="com.jaspersoft.studio.components.autoresize.next" value="true"/>
<property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
</reportElement>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="Dataset1" uuid="acaf88bb-ff19-4d07-9e37-cbda2f2104a7">
<returnValue fromVariable="rowNumberSum" toVariable="rowNumberSum"/>
</datasetRun>
<jr:column width="84" uuid="8beb5156-7b6b-451a-a66d-489284355c75">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
<jr:detailCell style="Table 1_TD" height="30">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/>
<textField>
<reportElement x="0" y="0" width="84" height="30" uuid="844ce5da-a2b4-418a-a474-be9465b5dd67"/>
<textFieldExpression><![CDATA[$F{month}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="83" uuid="9e71d9b1-0260-4f14-98c6-5df57e36e6d7">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
<jr:detailCell style="Table 1_TD" height="30">
<textField>
<reportElement x="0" y="0" width="83" height="30" uuid="98bb8086-6a7e-47c7-aa09-60c8eb35de83"/>
<textFieldExpression><![CDATA[$F{percentage}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="33" uuid="d4746c5e-5a70-4a5a-9418-59e664a4e715">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
<jr:detailCell style="Table 1_TD" height="30">
<textField>
<reportElement x="0" y="0" width="33" height="30" uuid="b4329a51-bcc3-4fd0-8f85-1f3e5a614719"/>
<textFieldExpression><![CDATA[$V{rowNumberSum}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</summary>
</jasperReport>
Here is the code for my main report:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.10.0.final using JasperReports Library version 6.10.0-unknown -->
<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="main report" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f8bbb1cf-82a2-4390-8cd9-72d0a34c4ead">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="FeaturesAnalyzedAndReviewedIn12MonthsAdapter"/>
<queryString language="JSON">
<![CDATA[]]>
</queryString>
<field name="month" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="month"/>
<fieldDescription><![CDATA[month]]></fieldDescription>
</field>
<field name="percentage" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="percentage"/>
<fieldDescription><![CDATA[percentage]]></fieldDescription>
</field>
<variable name="rowNumberSum" class="java.lang.Integer" resetType="None"/>
<variable name="Variable_1" class="java.lang.Integer" resetType="None">
<variableExpression><![CDATA[$V{rowNumberSum}]]></variableExpression>
</variable>
<summary>
<band height="300" splitType="Stretch">
<textField evaluationTime="Band">
<reportElement x="404" y="199" width="100" height="30" uuid="ce192097-9d0e-484b-917b-371b2f1e7bdd"/>
<textFieldExpression><![CDATA["VAlue returned from Sub-Report: "+$V{rowNumberSum}]]></textFieldExpression>
</textField>
<subreport isUsingCache="true" runToBottom="true" overflowType="NoStretch">
<reportElement x="0" y="0" width="300" height="300" uuid="65b11cd3-98b7-4a13-9313-daa21e5a4bac">
<printWhenExpression><![CDATA[$V{rowNumberSum}==null]]></printWhenExpression>
</reportElement>
<parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<returnValue subreportVariable="rowNumberSum" toVariable="rowNumberSum"/>
<subreportExpression><![CDATA["Blank_A4.jasper"]]></subreportExpression>
</subreport>
</band>
</summary>
</jasperReport>
Here is my current output for main report without using print when expression
Output when using print when expression
What do I want to achieve?
Whenever the value returned by Sub-Report 1 is 1, I want main report to hide Sub-Report 1. How do I achieve that?
Sorry about that there are a bunch of places to get information on Scriptlets:
https://community.jaspersoft.com/blog/all-you-want-know-about-scriptlets
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRDefaultScriptlet.html
https://community.jaspersoft.com/questions/1084351/scriptlets-getting-connection-jdbc-jasper-studio-java-class
The last one discusses how to get the DATBASE_CONNECTION within the scriptlet. Based on how you're running this (Jasper Server, Spring or some other framework) you should have other methods available for injection.
Anyhow, here is a sample scriptlet that I had to write because our database implementation didn't have RANK():
public class GroupTopNCounterScriptlet extends JRDefaultScriptlet {
public static final String GROUP_COUNT_VAR = "GroupTopN_COUNT";
public static final String TOP_N_TOTAL = "TopNCountTotal";
int topNTotalCounter = 0;
#Override
public void beforeGroupInit(String groupName) throws JRScriptletException {
Integer groupCount = (Integer) getVariableValue(GROUP_COUNT_VAR);
topNTotalCounter += (groupCount == null) ? 0 : groupCount;
setVariableValue(TOP_N_TOTAL, topNTotalCounter);
}
}
Although you probably want to worry more about beforeDetailEval where you'll need to:
Get the DATABSE_CONNECTION
Query something, either:
the full data set that you can use for calculations and to pass into the List.
a query returning just the count so you can set the printWhen
Set the Variable(s) or Parameter(s) you choose
Update your printWhenExpression and Datasource accordingly
I am having my API where I am sending a request from POSTMAN and it takes less than a second to respond. But, when I use the same API in JasperReport using JSON DataAdapter, it takes about 7 to 15 seconds to respond and generate the report. Here is a snapshot is taken after uploading the report to the server using Mozilla.
Here is the same report on the POSTMAN
It is not fetching anything from the API but just the login key. Here is a snapshot from the JasperStudio
Here is my jrxml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.10.0.final using JasperReports Library version 6.10.0-unknown -->
<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="test_A4" language="javascript" pageWidth="595" pageHeight="200" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8fe94703-075f-4ae1-affc-bff8d7a8a4b8">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="POST_REQUEST_TO_GET_TOKEN"/>
<property name="ireport.jasperserver.url" value="http://server_address:port/jasperserver/"/>
<property name="ireport.jasperserver.user" value="user"/>
<property name="ireport.jasperserver.reportUnit" value="/Sub_Reports/test_A4"/>
<property name="ireport.jasperserver.report.resource" value="/Sub_Reports/test_A4_files/main_jrxml"/>
<property name="net.sf.jasperreports.data.adapter" value="POST_REQUEST_TO_GET_TOKEN.xml"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<queryString language="JSON">
<![CDATA[]]>
</queryString>
<title>
<band height="59" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="59" uuid="691c8e97-8888-4786-9350-62d5f187820b"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="19" isBold="true" isItalic="false"/>
</textElement>
<textFieldExpression><![CDATA["This is a drill down sample report"]]></textFieldExpression>
</textField>
</band>
</title>
<summary>
<band height="75" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="555" height="50" uuid="4aba0c46-cda3-4611-97a2-1f446bd4f85b"/>
<textElement>
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[It sends a POST request to an API and receives a token to put it into another POST request which will bring back the data from the API]]></text>
</staticText>
<textField>
<reportElement x="0" y="45" width="555" height="30" uuid="447eee49-5f57-4280-8f47-f5a5a8ff6503"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="16" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["This is in sub-reprots directory"]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>
I am unable to get the cause of many delays. Would anyone please help me figure this out? Thanks a lot.
I am using JasperSoft Studio 6.10 and JasperServer Version 7.
Is it possible to make to Jasper software so that when pressing a text element value of parameter changed?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
<!-- 2016-02-19T23:46:44 -->
<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="Main Menu" pageWidth="500" pageHeight="85" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="500" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="e7435a7b-5c14-49c7-8fe8-822df3de3810">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="ireport.jasperserver.url" value="http://stats.trackif.com/jasperserver-pro/services/repository/"/>
<property name="ireport.jasperserver.user" value="jasperadmin"/>
<property name="ireport.jasperserver.report.resource" value="/csi/New_Version/Main_Menu_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/csi/New_Version/Main_Menu"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<style name="MenuItem" mode="Opaque" forecolor="#E1FFE1" backcolor="#333333" hTextAlign="Center" vTextAlign="Middle" fontName="" fontSize="13"/>
<style name="MenuItem_Dashboard" style="MenuItem">
<conditionalStyle>
<conditionExpression><![CDATA[$P{SelectedMenuItem} == 0]]></conditionExpression>
<style backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="MenuItem_Members" style="MenuItem">
<conditionalStyle>
<conditionExpression><![CDATA[$P{SelectedMenuItem} == 1]]></conditionExpression>
<style backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="MenuItem_Trackers" style="MenuItem">
<conditionalStyle>
<conditionExpression><![CDATA[$P{SelectedMenuItem} == 2]]></conditionExpression>
<style backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="IconBackground"/>
<style name="IconBackground_Members_Table" style="IconBackground" pattern="">
<conditionalStyle>
<conditionExpression><![CDATA[AND($P{SelectedMenuItem} == 1, $P{SelectedIcon} == 0)]]></conditionExpression>
<style mode="Opaque" backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="IconBackground_Members_Chart" style="IconBackground">
<conditionalStyle>
<conditionExpression><![CDATA[AND($P{SelectedMenuItem} == 1, $P{SelectedIcon} == 1)]]></conditionExpression>
<style mode="Opaque" backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="IconBackground_Trackers_Table" style="IconBackground" pattern="">
<conditionalStyle>
<conditionExpression><![CDATA[AND($P{SelectedMenuItem} == 2, $P{SelectedIcon} == 0)]]></conditionExpression>
<style mode="Opaque" backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="IconBackground_Trackers_Chart" style="IconBackground">
<conditionalStyle>
<conditionExpression><![CDATA[AND($P{SelectedMenuItem} == 2, $P{SelectedIcon} == 1)]]></conditionExpression>
<style mode="Opaque" backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="MenuItem_Alerts" style="MenuItem">
<conditionalStyle>
<conditionExpression><![CDATA[$P{SelectedMenuItem} == 3]]></conditionExpression>
<style backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="IconBackground_Alerts_Table" style="IconBackground" pattern="">
<conditionalStyle>
<conditionExpression><![CDATA[AND($P{SelectedMenuItem} == 3, $P{SelectedIcon} == 0)]]></conditionExpression>
<style mode="Opaque" backcolor="#24AD80"/>
</conditionalStyle>
</style>
<style name="IconBackground_Alerts_Chart" style="IconBackground">
<conditionalStyle>
<conditionExpression><![CDATA[AND($P{SelectedMenuItem} == 3, $P{SelectedIcon} == 1)]]></conditionExpression>
<style mode="Opaque" backcolor="#24AD80"/>
</conditionalStyle>
</style>
<parameter name="SelectedMenuItem" class="java.lang.Integer">
<parameterDescription><![CDATA[]]></parameterDescription>
<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
</parameter>
<parameter name="SelectedIcon" class="java.lang.Integer">
<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
</parameter>
<parameter name="ClientId" class="java.lang.Integer">
<defaultValueExpression><![CDATA[37]]></defaultValueExpression>
</parameter>
<parameter name="StartDate" class="java.util.Date">
<parameterDescription><![CDATA[]]></parameterDescription>
<defaultValueExpression><![CDATA[new Date(new Date(System.currentTimeMillis()-15*24*60*60*1000).getTime()-1000*60*60*24*15)]]></defaultValueExpression>
</parameter>
<parameter name="EndDate" class="java.util.Date">
<defaultValueExpression><![CDATA[TODAY()]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<variable name="Count_Number" class="java.lang.Integer" calculation="Count">
<variableExpression><![CDATA[Boolean.TRUE]]></variableExpression>
</variable>
<title>
<band height="85" splitType="Stretch">
<textField evaluationTime="Report" isBlankWhenNull="true">
<reportElement style="IconBackground_Trackers_Chart" x="245" y="40" width="45" height="45" uuid="ddb8960a-425e-4ddf-8ab8-8bdce87b316c">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
</textField>
<textField evaluationTime="Report" isBlankWhenNull="true">
<reportElement style="IconBackground_Trackers_Table" x="200" y="40" width="45" height="45" uuid="b32db645-a654-44c6-a77b-03d296eacd69">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
</textField>
<textField evaluationTime="Report" isBlankWhenNull="true">
<reportElement style="IconBackground_Members_Chart" x="145" y="40" width="45" height="45" uuid="5960e8a3-3dcc-4e99-b410-7758820f469c">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
</textField>
<textField evaluationTime="Report" isBlankWhenNull="true">
<reportElement style="IconBackground_Members_Table" x="100" y="40" width="45" height="45" uuid="9f93dc32-99ba-4218-946e-f65ba0834c4a">
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
</reportElement>
</textField>
<textField evaluationTime="Band" hyperlinkType="ReportExecution">
<reportElement key="" style="MenuItem_Dashboard" x="0" y="0" width="100" height="40" uuid="17bba765-2b33-48ee-a157-4d091a553548">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textFieldExpression><![CDATA["Dashboard"]]></textFieldExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FMain_Page_Totals&ClientId=" + $P{ClientId}]]></hyperlinkReferenceExpression>
<hyperlinkParameter name="_report">
<hyperlinkParameterExpression><![CDATA["/csi/New_Version/main_page_totals"]]></hyperlinkParameterExpression>
</hyperlinkParameter>
<hyperlinkParameter name="ClientId">
<hyperlinkParameterExpression><![CDATA[$P{ClientId}]]></hyperlinkParameterExpression>
</hyperlinkParameter>
</textField>
<textField evaluationTime="Band" hyperlinkType="ReportExecution">
<reportElement style="MenuItem_Members" x="100" y="0" width="100" height="40" uuid="5cfc95a0-730c-423a-885e-a5c8f3e92f18">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textFieldExpression><![CDATA["Members"]]></textFieldExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FMembers_Table&ClientId=" + $P{ClientId} + "&SelectedMenuItem=1"]]></hyperlinkReferenceExpression>
</textField>
<textField evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement style="MenuItem_Trackers" x="200" y="0" width="100" height="40" uuid="4e6a3fb2-6a9a-4468-a457-b1d484e13e35">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textFieldExpression><![CDATA["Trackers"]]></textFieldExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FTrackers_Table&ClientId=" + $P{ClientId} + "&SelectedMenuItem=2"]]></hyperlinkReferenceExpression>
</textField>
<image evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement x="106" y="46" width="32" height="32" uuid="3440245e-27de-46c8-b516-c43b24953313">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$P{SelectedMenuItem} == 1]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["repo:table.png"]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FMembers_Table&ClientId=" + $P{ClientId} + "&SelectedMenuItem=1"]]></hyperlinkReferenceExpression>
</image>
<image evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement x="151" y="46" width="32" height="32" uuid="b67f389c-0e19-43f3-9b86-aa884ee4a3bc">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$P{SelectedMenuItem} == 1]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["repo:chart.png"]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FMembers_Chart_By_Day&ClientId=" + $P{ClientId} + "&SelectedMenuItem=1&SelectedIcon=1"]]></hyperlinkReferenceExpression>
<hyperlinkTooltipExpression><![CDATA["Daily"]]></hyperlinkTooltipExpression>
</image>
<image evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement x="206" y="46" width="32" height="32" uuid="55c06527-6e84-40fc-9691-2676bfb11b67">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$P{SelectedMenuItem} == 2]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["repo:table1.png"]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FTrackers_Table&ClientId=" + $P{ClientId} + "&SelectedMenuItem=2"]]></hyperlinkReferenceExpression>
</image>
<image evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement x="251" y="46" width="32" height="32" uuid="398f6b96-fd30-4fc9-99c8-79aaba500838">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$P{SelectedMenuItem} == 2]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["repo:chart1.png"]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FTrackers_Chart_By_Day&ClientId=" + $P{ClientId} + "&SelectedMenuItem=2&SelectedIcon=1"]]></hyperlinkReferenceExpression>
</image>
<textField evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement style="MenuItem_Alerts" x="300" y="0" width="100" height="40" uuid="c5e36e04-be9f-4051-a9a9-b8bafd1ceb3f">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textFieldExpression><![CDATA["Alerts"]]></textFieldExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FAlerts_Table&ClientId=" + $P{ClientId} + "&SelectedMenuItem=3"]]></hyperlinkReferenceExpression>
</textField>
<image evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement key="" style="IconBackground_Alerts_Table" x="306" y="46" width="32" height="32" uuid="613ae391-ef0a-487f-a79f-c3cbe92068b7">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$P{SelectedMenuItem} == 3]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["repo:table1.png"]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FAlerts_Table&ClientId=" + $P{ClientId} + "&SelectedMenuItem=3"]]></hyperlinkReferenceExpression>
</image>
<textField evaluationTime="Report" isBlankWhenNull="true">
<reportElement style="IconBackground_Alerts_Chart" x="345" y="40" width="45" height="45" uuid="e470ee22-217e-4362-ad5f-8ab5ef781b99">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.x" value="pixel"/>
</reportElement>
</textField>
<image evaluationTime="Band" hyperlinkType="Reference" hyperlinkTarget="Parent">
<reportElement x="351" y="46" width="32" height="32" uuid="5bbf9696-54ba-44dc-b025-dc7a52a1521c">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<printWhenExpression><![CDATA[$P{SelectedMenuItem} == 3]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["repo:chart1.png"]]></imageExpression>
<hyperlinkReferenceExpression><![CDATA["http://stats.trackif.com/jasperserver-pro/dashboard/viewer.html#%2Fcsi%2Fdashboards%2FAlerts_Chart_By_Day&ClientId=" + $P{ClientId} + "&SelectedMenuItem=3&SelectedIcon=1"]]></hyperlinkReferenceExpression>
</image>
</band>
</title>
</jasperReport>
In this example I want that when pressing "Members" the SelectedMenuItem parameter would change on value '1'. Default value this parameter = 0.
Is it possible to make this?
I am constructing a 'table' by having cells next to each other and they all have borders. But I have a problem where the borders won't show if the cell for workcode text doesn't have a value.
This is my jrxml - (it is a subreport so I have a extra dataset there, and workcodeText is handled this way because I don't know how many workcode text nodes I will have in the xml data.)
<?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="estimate-subreport" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" scriptletClass="com.cybage.mo.CostCalculation" uuid="2df6e224-aab9-42e3-a97c-aa614b05982c">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Normal-Text-Small" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false">
<box leftPadding="1" rightPadding="1"/>
</style>
<style name="Normal-Text-Small-with-borders" style="Normal-Text-Small" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false">
<box leftPadding="1" rightPadding="1">
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Normal-Text-Small-bold" style="Normal-Text-Small" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
<box leftPadding="1" rightPadding="1"/>
</style>
<style name="Normal-Text-Small-bold-with-borders" style="Normal-Text-Small-bold" hAlign="Left" vAlign="Top" fontName="Calibri" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
<box leftPadding="1" rightPadding="1">
<pen lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="WorkcodeText" uuid="3615899a-9e63-45db-a26e-d4e6d1670f84">
<queryString language="xPath">
<![CDATA[/MCSResponse/EstimateDisplayResponse/CategoryDetail/WorkcodeDetail/WorkcodeText]]>
</queryString>
<field name="WorkcodeText" class="java.lang.String">
<fieldDescription><![CDATA[child::text()]]></fieldDescription>
</field>
<field name="last_wct" class="java.lang.String">
<fieldDescription><![CDATA[../WorkcodeText[last()]]]></fieldDescription>
</field>
<field name="WorkcodeAmount" class="java.lang.String">
<fieldDescription><![CDATA[/MCSResponse/EstimateDisplayResponse/CategoryDetail/WorkcodeDetail/WorkcodeAmount]]></fieldDescription>
</field>
<variable name="varWorkcodeText" class="java.lang.String">
<variableExpression><![CDATA[$V{varWorkcodeText}+($F{WorkcodeText} != null? $F{WorkcodeText}:" test ")]]></variableExpression>
<initialValueExpression><![CDATA[""]]></initialValueExpression>
</variable>
</subDataset>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["D:\\iReport\\Saquib\\Single_Estimate_Report\\Test\\"]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[CategoryDetail/WorkcodeDetail]]>
</queryString>
<field name="Workcode" class="java.lang.String">
<fieldDescription><![CDATA[Workcode]]></fieldDescription>
</field>
<field name="WorkcodeName" class="java.lang.String">
<fieldDescription><![CDATA[WorkcodeName]]></fieldDescription>
</field>
<field name="ExtraWorkcodeName" class="java.lang.String">
<fieldDescription><![CDATA[ExtraWorkcodeName]]></fieldDescription>
</field>
<field name="WorkcodeAmount" class="java.lang.String">
<fieldDescription><![CDATA[WorkcodeAmount]]></fieldDescription>
</field>
<field name="WorkcodeText" class="java.lang.String">
<fieldDescription><![CDATA[WorkcodeText]]></fieldDescription>
</field>
<field name="ItemDetail" class="java.lang.String">
<fieldDescription><![CDATA[ItemDetail]]></fieldDescription>
</field>
<detail>
<band height="15">
<componentElement>
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="150" y="0" width="300" height="15" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="6b4ddd03-9978-4f83-a247-3fff22149cb1"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="WorkcodeText" uuid="7aeae23c-e1fe-4470-9ee5-98f84cd82159">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//WorkcodeText")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="15" width="300">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="Normal-Text-Small-with-borders" positionType="Float" stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="300" height="15" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#0000FF" uuid="03dd8f13-7604-41be-9155-ae02aa44500e">
<printWhenExpression><![CDATA[$F{WorkcodeText}.equals($F{last_wct})]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Top">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$V{varWorkcodeText}.replaceAll( "<nl>", "\n" )]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement style="Normal-Text-Small-with-borders" stretchType="RelativeToTallestObject" x="0" y="0" width="20" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" forecolor="#3333FF" uuid="8c9080c7-cb77-430c-be2e-b6252f9b8d8e"/>
<textElement verticalAlignment="Top">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{Workcode}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement style="Normal-Text-Small-with-borders" stretchType="RelativeToTallestObject" x="450" y="0" width="105" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" forecolor="#3300FF" uuid="ebdd4d26-bc29-4546-a9b5-24f2be132aa8"/>
<textElement textAlignment="Right">
<font size="9"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[($F{WorkcodeAmount}==""||$F{WorkcodeAmount}==null)?0.00:Float.valueOf($F{WorkcodeAmount})/100]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement style="Normal-Text-Small-with-borders" stretchType="RelativeToTallestObject" x="20" y="0" width="130" height="15" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" forecolor="#3333FF" uuid="f5fcc495-f401-4498-ac71-7352581cde59"/>
<textElement verticalAlignment="Top">
<font size="9"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{WorkcodeName}]]></textFieldExpression>
</textField>
</band>
</detail>
This is the XML I am testing with:
<?xml version="1.0" encoding="UTF-8"?>
<CategoryDetail>
<CategoryCode>1</CategoryCode>
<CategoryName>EXTERNAL CREATIVE</CategoryName>
<CategoryTotalName>TOTAL EXTERNAL CREAT</CategoryTotalName>
<CategoryType>1</CategoryType>
<CategoryStatus>YNNYN</CategoryStatus>
<WorkcodeDetail>
<WorkcodeCategory>1</WorkcodeCategory>
<Workcode>1B</Workcode>
<WorkcodeName>VISUALS</WorkcodeName>
<WorkcodeCommissionRate>150000</WorkcodeCommissionRate>
<WorkcodeFlags>NNNNNNNN</WorkcodeFlags>
<ExtraWorkcodeName>Concept and Development</ExtraWorkcodeName>
<WorkcodeType>C</WorkcodeType>
<WorkcodeEstimateCheck>Y</WorkcodeEstimateCheck>
</WorkcodeDetail>
<WorkcodeDetail>
<WorkcodeCategory>1</WorkcodeCategory>
<Workcode>1C</Workcode>
<WorkcodeName>COPY WRITING</WorkcodeName>
<WorkcodeCommissionRate>150000</WorkcodeCommissionRate>
<WorkcodeFlags>NNNNNNNN</WorkcodeFlags>
<ExtraWorkcodeName>Visualisation/Finished Art/Lasers</ExtraWorkcodeName>
<WorkcodeType>C</WorkcodeType>
<WorkcodeEstimateCheck>Y</WorkcodeEstimateCheck>
</WorkcodeDetail>
<WorkcodeDetail>
<WorkcodeCategory>1</WorkcodeCategory>
<Workcode>1E</Workcode>
<WorkcodeName>PHOTOGRAPHY</WorkcodeName>
<WorkcodeAmount>500</WorkcodeAmount>
<WorkcodeCommissionAmount>75</WorkcodeCommissionAmount>
<WorkcodeCommissionRate>150000</WorkcodeCommissionRate>
<WorkcodeFlags>NNNNNNNN</WorkcodeFlags>
<ExtraWorkcodeName>Setting</ExtraWorkcodeName>
<WorkcodeType>C</WorkcodeType>
<WorkcodeEstimateCheck>Y</WorkcodeEstimateCheck>
<WorkcodeText>Jaspersoft was originally called Panscopic, and was founded by Al Campa, CEO, and Raj Bhargava, VP of Products in 2001. Panscopic raised $23M from Doll Capital, Discovery Ventures, Morgenthaler Ventures, and Partech. In 2004 Panscopic teamed up with</WorkcodeText>
<WorkcodeText> Teodor Danciu,[7] acquired the intellectual property of JasperReports, and changed the name of the company to Jaspersoft. Brian Gentile became CEO in 2007.<nl><nl>Jaspersoft provides commercial software around the JasperReports product, and negotiat</WorkcodeText>
<WorkcodeText>e contracts with software developers that wish to embed the JasperReports engine into a closed source product.<nl><nl>Jaspersoft's main related product is JasperReports Server, a Java EE web application that provides advanced report server capabiliti</WorkcodeText>
<WorkcodeText>es such as report scheduling and permissions. It is available under an open source license for use in conjunction with open source infrastructure such as MySQL and JBoss, or a commercial license for enterprise deployments involving commercial databas</WorkcodeText>
<WorkcodeText>es and application servers.</WorkcodeText>
</WorkcodeDetail>
<WorkcodeDetail>
<WorkcodeCategory>1</WorkcodeCategory>
<Workcode>1F</Workcode>
<WorkcodeName>ILLUSTRATIONS</WorkcodeName>
<WorkcodeCommissionRate>150000</WorkcodeCommissionRate>
<WorkcodeFlags>NNNNNNNN</WorkcodeFlags>
<ExtraWorkcodeName>Photography</ExtraWorkcodeName>
<WorkcodeType>C</WorkcodeType>
<WorkcodeEstimateCheck>Y</WorkcodeEstimateCheck>
</WorkcodeDetail>
<WorkcodeDetail>
<WorkcodeCategory>1</WorkcodeCategory>
<Workcode>1G</Workcode>
<WorkcodeName>MODEL FEES</WorkcodeName>
<WorkcodeCommissionRate>150000</WorkcodeCommissionRate>
<WorkcodeFlags>NNNNNNNN</WorkcodeFlags>
<ExtraWorkcodeName>Models</ExtraWorkcodeName>
<WorkcodeType>C</WorkcodeType>
<WorkcodeEstimateCheck>Y</WorkcodeEstimateCheck>
</WorkcodeDetail>
<WorkcodeDetail>
<WorkcodeCategory>1</WorkcodeCategory>
<Workcode>T9</Workcode>
<WorkcodeName>T3 Overtime Pr.</WorkcodeName>
<WorkcodeCommissionRate>150000</WorkcodeCommissionRate>
<WorkcodeFlags>NNNNNNNN</WorkcodeFlags>
<ExtraWorkcodeName>T3 Overtime Pr.</ExtraWorkcodeName>
<WorkcodeType>T</WorkcodeType>
<WorkcodeEstimateCheck>Y</WorkcodeEstimateCheck>
</WorkcodeDetail>
</CategoryDetail>
try isRemoveLineWhenBlank="true" set to false in your textFields