Forum Discussion
gsugunan
13 years agoOccasional Contributor
Sorry it took so long to get back, but here's what happens:
with the following testcase report code:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="ReportTemplate" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property name="ireport.encoding" value="UTF-8"/>
<template>"../../styles.jrtx"</template>
<!--FIELDS & PARAMS-->
<title>
<band height="70">
<textField>
<reportElement x="159" y="13" width="229" height="42"/>
<textElement>
<font size="26"/>
</textElement>
<textFieldExpression class="java.lang.String">$F{name} + " Report"</textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band/>
</pageHeader>
<detail>
<band height="122">
<staticText>
<reportElement style="MainHeader" x="0" y="0" width="535" height="35"/>
<textElement/>
<text>DataSink report</text>
</staticText>
<!--SUBREPORTS UNDER HERE-->
<subreport isUsingCache="true">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="0" width="500" height="30"/>
<dataSourceExpression>$P{DataSinksSubReport}</dataSourceExpression>
<subreportExpression>"subreport:testCaseSubRep"</subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>
using the following subreport code:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="report name" language="groovy" pageWidth="535" pageHeight="842" columnWidth="535" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<template>"../../styles.jrtx"</template>
<field name="runtime" class="java.lang.String"/>
<columnHeader>
<band height="59">
<staticText>
<reportElement style="ColumnHeader" x="0" y="35" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text>runtime</text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21">
<textField>
<reportElement x="0" y="1" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Top"/>
<textFieldExpression class="java.lang.String">$F{runtime}</textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
it's empty, even though viewing the data sink itself shows it contains data
by empty I mean the report compiles fine, but shows nothing; presumably, since this one is empty, the load test contains an array of them, leading to some sort of null pointer from not checking if the list of reports for each test case are empty; so why is it empty when the datasink contains values?
with the following testcase report code:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="ReportTemplate" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property name="ireport.encoding" value="UTF-8"/>
<template>"../../styles.jrtx"</template>
<!--FIELDS & PARAMS-->
<title>
<band height="70">
<textField>
<reportElement x="159" y="13" width="229" height="42"/>
<textElement>
<font size="26"/>
</textElement>
<textFieldExpression class="java.lang.String">$F{name} + " Report"</textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band/>
</pageHeader>
<detail>
<band height="122">
<staticText>
<reportElement style="MainHeader" x="0" y="0" width="535" height="35"/>
<textElement/>
<text>DataSink report</text>
</staticText>
<!--SUBREPORTS UNDER HERE-->
<subreport isUsingCache="true">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="0" width="500" height="30"/>
<dataSourceExpression>$P{DataSinksSubReport}</dataSourceExpression>
<subreportExpression>"subreport:testCaseSubRep"</subreportExpression>
</subreport>
</band>
</detail>
</jasperReport>
using the following subreport code:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xs ... report.xsd" name="report name" language="groovy" pageWidth="535" pageHeight="842" columnWidth="535" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<template>"../../styles.jrtx"</template>
<field name="runtime" class="java.lang.String"/>
<columnHeader>
<band height="59">
<staticText>
<reportElement style="ColumnHeader" x="0" y="35" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text>runtime</text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21">
<textField>
<reportElement x="0" y="1" width="122" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Top"/>
<textFieldExpression class="java.lang.String">$F{runtime}</textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
it's empty, even though viewing the data sink itself shows it contains data
by empty I mean the report compiles fine, but shows nothing; presumably, since this one is empty, the load test contains an array of them, leading to some sort of null pointer from not checking if the list of reports for each test case are empty; so why is it empty when the datasink contains values?
Related Content
- 3 years agoSteveGregory