src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReportsPDF.jrxml
author Víctor Martínez Romanos <victor.martinez@openbravo.com>
Tue, 09 Aug 2016 09:50:55 +0200
changeset 30081 72acd4fea07e
parent 30080 87c9f038283f
child 30082 036a261e3b6f
permissions -rw-r--r--
Fixed issue 33460: code review improvements

Avoid NullPointerException in non-compartive mode
In JasperReport:
* Band height for details restored to 15, so we have the same number of lines as before the change
* Period N-1 label only shown in comparative mode
sandra@22140
     1
<?xml version="1.0" encoding="UTF-8"?>
sanjota@30080
     2
<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="GeneralAccountingReportsPDF" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20">
sandra@22140
     3
	<property name="ireport.scriptlethandling" value="0"/>
sandra@22140
     4
	<property name="ireport.encoding" value="UTF-8"/>
sanjota@30080
     5
	<property name="ireport.zoom" value="1.6500000000000001"/>
sanjota@30080
     6
	<property name="ireport.x" value="277"/>
sandra@22140
     7
	<property name="ireport.y" value="0"/>
sandra@22140
     8
	<import value="net.sf.jasperreports.engine.*"/>
sandra@22140
     9
	<import value="java.util.*"/>
sandra@22140
    10
	<import value="net.sf.jasperreports.engine.data.*"/>
sandra@22140
    11
	<style name="CustSatIndexMarkup" forecolor="#000000" pattern="###0.00;-###0.00" isBlankWhenNull="false" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
sandra@22140
    12
		<conditionalStyle>
sandra@22140
    13
			<conditionExpression><![CDATA[new Boolean($F{elementLevel} == 1)]]></conditionExpression>
sandra@22140
    14
			<style fontSize="12" isBold="true"/>
sandra@22140
    15
		</conditionalStyle>
sandra@22140
    16
		<conditionalStyle>
sandra@22140
    17
			<conditionExpression><![CDATA[new Boolean($F{elementLevel} == 2)]]></conditionExpression>
sandra@22140
    18
			<style fontSize="11" isBold="false"/>
sandra@22140
    19
		</conditionalStyle>
sandra@22140
    20
		<conditionalStyle>
sandra@22140
    21
			<conditionExpression><![CDATA[new Boolean($F{elementLevel} == 3)]]></conditionExpression>
sandra@22140
    22
			<style fontSize="10" isBold="false"/>
sandra@22140
    23
		</conditionalStyle>
sandra@22140
    24
		<conditionalStyle>
sandra@23253
    25
			<conditionExpression><![CDATA[new Boolean($F{elementLevel} >= 4)]]></conditionExpression>
sandra@22140
    26
			<style fontSize="9" isBold="false"/>
sandra@22140
    27
		</conditionalStyle>
sandra@22140
    28
	</style>
sandra@22140
    29
	<parameter name="REPORT_SUBTITLE" class="java.lang.String" isForPrompting="false"/>
sandra@22140
    30
	<parameter name="TOTAL" class="java.lang.String" isForPrompting="false"/>
sandra@22140
    31
	<parameter name="NUMBERFORMAT" class="java.text.DecimalFormat" isForPrompting="false"/>
sandra@22140
    32
	<parameter name="companyName" class="java.lang.String"/>
sandra@22140
    33
	<parameter name="agno" class="java.lang.String"/>
sandra@22140
    34
	<parameter name="agno2" class="java.lang.String"/>
sandra@22140
    35
	<parameter name="column" class="java.lang.String"/>
sandra@22140
    36
	<parameter name="columnRef" class="java.lang.String"/>
sandra@22140
    37
	<parameter name="org" class="java.lang.String"/>
sandra@22140
    38
	<parameter name="column1" class="java.lang.String"/>
sandra@22140
    39
	<parameter name="columnRef1" class="java.lang.String"/>
sandra@22140
    40
	<parameter name="date" class="java.lang.String"/>
sandra@22140
    41
	<parameter name="startingDate" class="java.lang.String"/>
sandra@22140
    42
	<parameter name="endingDate" class="java.lang.String"/>
sandra@22140
    43
	<parameter name="period" class="java.lang.String"/>
sandra@22140
    44
	<parameter name="periodRef" class="java.lang.String"/>
sandra@22140
    45
	<parameter name="agnoInitial" class="java.lang.String"/>
sandra@22140
    46
	<parameter name="agnoRef" class="java.lang.String"/>
sandra@22140
    47
	<parameter name="principalTitle" class="java.lang.String"/>
sandra@22140
    48
	<parameter name="pageNo" class="java.lang.String"/>
sanjota@30080
    49
	<parameter name="compareTo" class="java.lang.String">
sanjota@30080
    50
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
sanjota@30080
    51
	</parameter>
sandra@22140
    52
	<queryString>
sandra@22140
    53
		<![CDATA[]]>
sandra@22140
    54
	</queryString>
sandra@22140
    55
	<field name="name" class="java.lang.String"/>
sandra@22140
    56
	<field name="qty" class="java.math.BigDecimal"/>
sandra@22140
    57
	<field name="qtyRef" class="java.math.BigDecimal"/>
sandra@22140
    58
	<field name="elementLevel" class="java.lang.Integer"/>
sandra@23253
    59
	<field name="groupname" class="java.lang.String"/>
sandra@23253
    60
	<field name="pagebreak" class="java.lang.String"/>
sandra@23253
    61
	<group name="group" isStartNewPage="true">
sandra@23253
    62
		<groupExpression><![CDATA[$F{groupname}]]></groupExpression>
sandra@23253
    63
		<groupHeader>
sandra@23253
    64
			<band/>
sandra@23253
    65
		</groupHeader>
sandra@23253
    66
		<groupFooter>
sandra@23253
    67
			<band/>
sandra@23253
    68
		</groupFooter>
sandra@23253
    69
	</group>
sandra@22140
    70
	<background>
sandra@22140
    71
		<band splitType="Stretch"/>
sandra@22140
    72
	</background>
sandra@22140
    73
	<title>
sandra@22140
    74
		<band splitType="Stretch"/>
sandra@22140
    75
	</title>
sandra@22140
    76
	<pageHeader>
sandra@22140
    77
		<band height="121" splitType="Stretch">
sandra@22140
    78
			<textField>
sanjota@30080
    79
				<reportElement key="staticText-15" x="0" y="0" width="535" height="18"/>
sandra@22140
    80
				<textElement textAlignment="Center" markup="none">
sandra@22140
    81
					<font fontName="DejaVu Sans" size="12" isBold="true" pdfFontName="Helvetica-Bold"/>
sandra@22140
    82
				</textElement>
sanjota@30080
    83
				<textFieldExpression class="java.lang.String"><![CDATA[$P{principalTitle}]]></textFieldExpression>
sandra@22140
    84
			</textField>
sandra@22140
    85
			<line>
sanjota@30080
    86
				<reportElement key="line-1" x="0" y="71" width="535" height="1" forecolor="#555555"/>
sandra@22140
    87
			</line>
sandra@22140
    88
			<staticText>
sanjota@30080
    89
				<reportElement key="staticText-7" x="0" y="23" width="37" height="14"/>
sandra@22140
    90
				<box>
sandra@22140
    91
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
    92
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
    93
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
sandra@22140
    94
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
    95
				</box>
sandra@22140
    96
				<textElement>
sandra@22140
    97
					<font fontName="DejaVu Sans" size="9" isBold="true"/>
sandra@22140
    98
				</textElement>
sandra@22140
    99
				<text><![CDATA[Client:]]></text>
sandra@22140
   100
			</staticText>
sandra@22140
   101
			<textField>
sanjota@30080
   102
				<reportElement key="staticText-7" x="37" y="23" width="192" height="14"/>
sandra@22140
   103
				<textElement markup="none">
sandra@22140
   104
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   105
				</textElement>
sanjota@30080
   106
				<textFieldExpression class="java.lang.String"><![CDATA[$P{companyName}+ " "+ $P{agnoInitial}]]></textFieldExpression>
sandra@22140
   107
			</textField>
sandra@22140
   108
			<textField>
sanjota@30080
   109
				<reportElement key="staticText-7" x="464" y="23" width="71" height="14"/>
sandra@22140
   110
				<textElement markup="none">
sandra@22140
   111
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   112
				</textElement>
sanjota@30080
   113
				<textFieldExpression class="java.lang.String"><![CDATA[$P{date}]]></textFieldExpression>
sandra@22140
   114
			</textField>
sandra@22140
   115
			<staticText>
sanjota@30080
   116
				<reportElement key="staticText-7" x="436" y="23" width="28" height="14"/>
sandra@22140
   117
				<box>
sandra@22140
   118
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   119
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   120
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
sandra@22140
   121
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   122
				</box>
sandra@22140
   123
				<textElement>
sandra@22140
   124
					<font fontName="DejaVu Sans" size="9" isBold="true"/>
sandra@22140
   125
				</textElement>
sandra@22140
   126
				<text><![CDATA[Date:]]></text>
sandra@22140
   127
			</staticText>
sandra@22140
   128
			<textField>
sanjota@30080
   129
				<reportElement key="staticText-7" x="298" y="23" width="138" height="14"/>
sandra@22140
   130
				<textElement markup="none">
sandra@22140
   131
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   132
				</textElement>
sanjota@30080
   133
				<textFieldExpression class="java.lang.String"><![CDATA[$P{org}]]></textFieldExpression>
sandra@22140
   134
			</textField>
sandra@22140
   135
			<staticText>
sanjota@30080
   136
				<reportElement key="staticText-7" x="229" y="23" width="69" height="14"/>
sandra@22140
   137
				<box>
sandra@22140
   138
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   139
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   140
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
sandra@22140
   141
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   142
				</box>
sandra@22140
   143
				<textElement>
sandra@22140
   144
					<font fontName="DejaVu Sans" size="9" isBold="true"/>
sandra@22140
   145
				</textElement>
sandra@22140
   146
				<text><![CDATA[Organization:]]></text>
sandra@22140
   147
			</staticText>
sandra@22140
   148
			<textField>
sanjota@30080
   149
				<reportElement key="staticText-7" x="62" y="39" width="473" height="14"/>
sandra@22140
   150
				<textElement markup="none">
sandra@22140
   151
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   152
				</textElement>
victor@30081
   153
				<textFieldExpression class="java.lang.String"><![CDATA["Period:" + $P{period} + (($P{compareTo}.equals("Y")) ? "   Period N-1: "+ $P{periodRef}:"")]]></textFieldExpression>
sandra@22140
   154
			</textField>
sandra@22140
   155
			<staticText>
sanjota@30080
   156
				<reportElement key="staticText-7" x="0" y="39" width="62" height="14"/>
sandra@22140
   157
				<box>
sandra@22140
   158
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   159
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   160
					<bottomPen lineWidth="0.0" lineColor="#000000"/>
sandra@22140
   161
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
sandra@22140
   162
				</box>
sandra@22140
   163
				<textElement>
sandra@22140
   164
					<font fontName="DejaVu Sans" size="9" isBold="true"/>
sandra@22140
   165
				</textElement>
sandra@22140
   166
				<text><![CDATA[Conditions:]]></text>
sandra@22140
   167
			</staticText>
sandra@22140
   168
			<line>
sanjota@30080
   169
				<reportElement key="line-1" x="0" y="19" width="535" height="1"/>
sandra@22140
   170
			</line>
sandra@22140
   171
			<textField>
sanjota@30080
   172
				<reportElement key="staticText-7" x="63" y="55" width="472" height="14"/>
sandra@22140
   173
				<textElement markup="none">
sandra@22140
   174
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   175
				</textElement>
sanjota@30080
   176
				<textFieldExpression class="java.lang.String"><![CDATA["Client N-1: "+ $P{companyName}+ " " +$P{agnoRef}]]></textFieldExpression>
sandra@22140
   177
			</textField>
sandra@22140
   178
			<textField>
sanjota@30080
   179
				<reportElement key="staticText-7" x="211" y="84" width="112" height="11"/>
sandra@22140
   180
				<textElement markup="none">
sandra@22140
   181
					<font fontName="DejaVu Sans" size="9" isBold="true"/>
sandra@22140
   182
				</textElement>
sanjota@30080
   183
				<textFieldExpression class="java.lang.String"><![CDATA[$P{agno}]]></textFieldExpression>
sandra@22140
   184
			</textField>
sandra@22140
   185
			<staticText>
sanjota@30080
   186
				<reportElement key="staticText-7" mode="Transparent" x="0" y="94" width="112" height="10" forecolor="#000000" backcolor="#FFFFFF"/>
carlos@26769
   187
				<textElement textAlignment="Left" rotation="None" markup="none">
sandra@22140
   188
					<font fontName="DejaVu Sans" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
sandra@22140
   189
				</textElement>
sandra@22140
   190
				<text><![CDATA[Element]]></text>
sandra@22140
   191
			</staticText>
sandra@22140
   192
			<textField>
sanjota@30080
   193
				<reportElement key="staticText-7" x="376" y="94" width="80" height="10">
sanjota@30080
   194
					<printWhenExpression><![CDATA[$P{compareTo}.equals("Y")]]></printWhenExpression>
sanjota@30080
   195
				</reportElement>
sandra@22140
   196
				<textElement textAlignment="Right" markup="none">
sandra@22140
   197
					<font fontName="DejaVu Sans" size="8" isBold="true"/>
sandra@22140
   198
				</textElement>
sanjota@30080
   199
				<textFieldExpression class="java.lang.String"><![CDATA[$P{column}]]></textFieldExpression>
sandra@22140
   200
			</textField>
sandra@22140
   201
			<textField>
sanjota@30080
   202
				<reportElement key="staticText-7" x="455" y="94" width="80" height="10">
sanjota@30080
   203
					<printWhenExpression><![CDATA[$P{compareTo}.equals("Y")]]></printWhenExpression>
sanjota@30080
   204
				</reportElement>
sandra@22140
   205
				<textElement textAlignment="Right" markup="none">
sandra@22140
   206
					<font fontName="DejaVu Sans" size="8" isBold="true"/>
sandra@22140
   207
				</textElement>
sanjota@30080
   208
				<textFieldExpression class="java.lang.String"><![CDATA[$P{columnRef}]]></textFieldExpression>
sandra@22140
   209
			</textField>
sandra@23253
   210
			<textField>
sanjota@30080
   211
				<reportElement key="staticText-7" x="0" y="74" width="229" height="12"/>
sandra@23253
   212
				<textElement markup="none">
sandra@23253
   213
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@23253
   214
				</textElement>
sanjota@30080
   215
				<textFieldExpression class="java.lang.String"><![CDATA[$F{groupname}]]></textFieldExpression>
sanjota@30080
   216
			</textField>
sanjota@30080
   217
			<textField>
sanjota@30080
   218
				<reportElement key="staticText-7" x="376" y="95" width="157" height="10">
sanjota@30080
   219
					<printWhenExpression><![CDATA[$P{compareTo}.equals("N")]]></printWhenExpression>
sanjota@30080
   220
				</reportElement>
sanjota@30080
   221
				<textElement textAlignment="Right" markup="none">
sanjota@30080
   222
					<font fontName="DejaVu Sans" size="8" isBold="true"/>
sanjota@30080
   223
				</textElement>
sanjota@30080
   224
				<textFieldExpression class="java.lang.String"><![CDATA[$P{column}]]></textFieldExpression>
sandra@23253
   225
			</textField>
sandra@22140
   226
		</band>
sandra@22140
   227
	</pageHeader>
sandra@22140
   228
	<columnHeader>
sandra@22140
   229
		<band splitType="Stretch"/>
sandra@22140
   230
	</columnHeader>
sandra@22140
   231
	<detail>
victor@30081
   232
		<band height="15" splitType="Stretch">
sandra@22140
   233
			<textField>
sanjota@30080
   234
				<reportElement key="staticText-7" style="CustSatIndexMarkup" x="0" y="0" width="376" height="14"/>
sandra@22140
   235
				<textElement markup="none">
sandra@22140
   236
					<font fontName="DejaVu Sans"/>
sandra@22140
   237
				</textElement>
sanjota@30080
   238
				<textFieldExpression class="java.lang.String"><![CDATA[$F{elementLevel}>=4 ? "      " + $F{name}: $F{elementLevel}==3 ? "     " + $F{name}: $F{elementLevel}==2 ? "  " + $F{name}:$F{name}]]></textFieldExpression>
sandra@22140
   239
			</textField>
sandra@22140
   240
			<textField isBlankWhenNull="true">
sanjota@30080
   241
				<reportElement key="staticText-7" x="376" y="0" width="80" height="14">
sanjota@30080
   242
					<printWhenExpression><![CDATA[$P{compareTo}.equals("Y")]]></printWhenExpression>
sanjota@30080
   243
				</reportElement>
sandra@22140
   244
				<textElement textAlignment="Right" markup="none">
sandra@22140
   245
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   246
				</textElement>
sanjota@30080
   247
				<textFieldExpression class="java.lang.String"><![CDATA[($F{qty}!=null) ? $P{NUMBERFORMAT}.format($F{qty}).toString() : new String(" ")]]></textFieldExpression>
sandra@22140
   248
			</textField>
sandra@22140
   249
			<textField isBlankWhenNull="true">
sanjota@30080
   250
				<reportElement key="staticText-7" x="455" y="0" width="80" height="14">
sanjota@30080
   251
					<printWhenExpression><![CDATA[$P{compareTo}.equals("Y")]]></printWhenExpression>
sanjota@30080
   252
				</reportElement>
sandra@22140
   253
				<textElement textAlignment="Right" markup="none">
sandra@22140
   254
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sandra@22140
   255
				</textElement>
sanjota@30080
   256
				<textFieldExpression class="java.lang.String"><![CDATA[($F{qtyRef}!=null) ? $P{NUMBERFORMAT}.format($F{qtyRef}).toString() : new String(" ")]]></textFieldExpression>
sanjota@30080
   257
			</textField>
sanjota@30080
   258
			<textField isBlankWhenNull="true">
sanjota@30080
   259
				<reportElement key="staticText-7" x="374" y="0" width="159" height="14">
sanjota@30080
   260
					<printWhenExpression><![CDATA[$P{compareTo}.equals("N")]]></printWhenExpression>
sanjota@30080
   261
				</reportElement>
sanjota@30080
   262
				<textElement textAlignment="Right" markup="none">
sanjota@30080
   263
					<font fontName="DejaVu Sans" size="9" isBold="false"/>
sanjota@30080
   264
				</textElement>
sanjota@30080
   265
				<textFieldExpression class="java.lang.String"><![CDATA[($F{qty}!=null) ? $P{NUMBERFORMAT}.format($F{qty}).toString() : new String(" ")]]></textFieldExpression>
sandra@22140
   266
			</textField>
sandra@22140
   267
		</band>
sandra@22140
   268
	</detail>
sandra@22140
   269
	<columnFooter>
sandra@22140
   270
		<band splitType="Stretch"/>
sandra@22140
   271
	</columnFooter>
sandra@22140
   272
	<pageFooter>
sandra@22140
   273
		<band height="40" splitType="Stretch"/>
sandra@22140
   274
	</pageFooter>
sandra@22140
   275
	<summary>
sandra@22140
   276
		<band splitType="Stretch"/>
sandra@22140
   277
	</summary>
sandra@22140
   278
</jasperReport>