Jump to content
JasperReports Library 7.0 is now available ×

weird subreport layout


dirko

Recommended Posts

Hello,

 

I am observing some weird behaviour with the layout in my subreport. To investigate the problem I stripped down my master report (only including a subreport) and subreport (only containing columHeader with backcolor). When creating a pdf of the subreport itself it looks ok (a header with a grey background), but when creating a pdf from the master report, the first column in the subreport has a white background and the height of the grey area has increased (see attached image). Any clue what is going on here?

 

masterReport

Code:

<!DOCTYPE jasperReport
PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport name="InvoiceMaster" pageWidth="595" pageHeight="842"><!-- A4 -->
<style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<parameter name="overviewSubreport" class="net.sf.jasperreports.engine.JasperReport"></parameter>
<parameter name="overviewDataSource" class="net.sf.jasperreports.engine.JRDataSource"></parameter>
<parameter name="overviewParameterMap" class="java.util.Map"></parameter>


<detail>
<band height="200">
<subreport isUsingCache="false">
<reportElement x="0" y="5" width="555" height="100"/>
<parametersMapExpression>$P{overviewParameterMap}</parametersMapExpression>
<dataSourceExpression>$P{overviewDataSource}</dataSourceExpression>
<subreportExpression class="net.sf.jasperreports.engine.JasperReport">$P{overviewSubreport}</subreportExpression>
</subreport>
</band>
</detail>

</jasperReport>

 

subReport

Code:
[code]
<!DOCTYPE jasperReport
PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport name="InvoiceOverviewSubreport" pageWidth="555" pageHeight="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
<style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="9" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<parameter name="tArticle" class="java.lang.String"></parameter>
<parameter name="tNbrOfUnits" class="java.lang.String"></parameter>
<parameter name="tUnitPrice" class="java.lang.String"></parameter>
<parameter name="tExclVat" class="java.lang.String"></parameter>
<parameter name="tAmountVat" class="java.lang.String"></parameter>
<parameter name="tInclVat" class="java.lang.String"></parameter>
<parameter name="tTotals" class="java.lang.String"></parameter>
<parameter name="tVatRate" class="java.lang.String"></parameter>

<field name="clientInteractionNumber" class="java.lang.String"></field>
<field name="clientInteractionLegend" class="java.lang.String"></field>
<field name="article" class="java.lang.String"></field>
<field name="nbrOfUnits" class="java.lang.String"></field>
<field name="unitPrice" class="java.lang.String"></field>
<field name="exclVat" class="java.lang.String"></field>
<field name="amountVat" class="java.lang.String"></field>
<field name="inclVat" class="java.lang.String"></field>

<columnHeader>
<band height="30">
<textField>
<reportElement mode="Opaque" x="0" y="5" width="155" height="15" backcolor="#ededed"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$P{tArticle}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="155" y="5" width="80" height="15" backcolor="#ededed"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$P{tNbrOfUnits}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="235" y="5" width="80" height="15" backcolor="#ededed"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$P{tUnitPrice}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="315" y="5" width="80" height="15" backcolor="#ededed"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$P{tExclVat}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="395" y="5" width="80" height="15" backcolor="#ededed"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$P{tAmountVat}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Opaque" x="475" y="5" width="80" height="15" backcolor="#ededed"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$P{tInclVat}]]></textFieldExpression>
</textField>
</band>
</columnHeader>

</jasperReport>
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...