Jump to content
Changes to the Jaspersoft community edition download ×

Column headers are coming in all the pages


Karamveer

Recommended Posts

Hi,

 

When I am exporting the data to cvs file the column headers are coming again & again in all the pages, along with that some white space is also coming. I want that there sholud not be any white spaces between the pages & also the column header will come only one time. the code of the jrxml file is

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport name="IssueListReport" pageWidth="1500" pageHeight="842" columnWidth="1355" leftMargin="5" rightMargin="40" topMargin="50" bottomMargin="50">
<style name="Arial_Normal" isDefault="true" fontName="Arial" fontSize="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="Arial_Bold" isDefault="false" fontName="Arial" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="Arial_Italic" isDefault="false" fontName="Arial" fontSize="12" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<style name="detail" isDefault="false" isBold="false" style="Arial_Normal" backcolor="#EDE6DE"/>
<style name="pageHeader" isDefault="false" style="Arial_Bold" forecolor="#ffffff" backcolor="#BEA793"/>
<style name="columnHeader" isDefault="false" style="Arial_Bold" forecolor="#ffffff" backcolor="#BEA793"/>
<style name="title" isDefault="false" fontName="Arial" fontSize="12" forecolor="#663300" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<parameter name="ReportTitle" class="java.lang.String">
</parameter>
<field name="issueId" class="java.lang.String">
</field>
<field name="name" class="java.lang.String">
</field>
<field name="cost" class="java.lang.String">
</field>
<field name="estimatedCost" class="java.lang.String">
</field>
<field name="statusName" class="java.lang.String">
</field>
<field name="sourceApplication" class="java.lang.String">
</field>
<field name="sourceValue" class="java.lang.String">
</field>
<field name="targetScore" class="java.lang.String">
</field>
<field name="targetCompletionDate" class="java.lang.String">
</field>
<field name="criticalName" class="java.lang.String">
</field>
<field name="approverEmail" class="java.lang.String">
</field>
<field name="revisedTargetCompletionDate" class="java.lang.String">
</field>
<title>
<band height="20">
<frame>
<reportElement x="0" y="0" width="1355" height="20" backcolor="#E0E0E0" style="title"/>
<box topBorder="None"/>
<textField isBlankWhenNull="true" isStretchWithOverflow="true">
<reportElement x="0" y="0" width="335" height="15" style="title"/>
<textElement textAlignment="Left">
<font size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{ReportTitle}]]></textFieldExpression>
</textField>
</frame>
</band>
</title>
<pageHeader>
<band>
</band>
</pageHeader>
<columnHeader>
<band height="15">
<rectangle>
<reportElement x="0" y="0" width="1355" height="15" forecolor="#333333" backcolor="#333333"/>
<graphicElement/>
</rectangle>
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="100" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement textAlignment="Left"/>
<text><![CDATA[issue Id]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="100" y="0" width="105" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement textAlignment="Left"/>
<text><![CDATA[issue Name]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="205" y="0" width="100" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Cost]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="305" y="0" width="150" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Estimated Cost]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="455" y="0" width="100" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[status]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="555" y="0" width="100" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[source]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="655" y="0" width="100" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Value]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="755" y="0" width="100" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[score]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="855" y="0" width="200" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Target Completion Date]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="1055" y="0" width="150" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Criticality]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="1205" y="0" width="150" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Approver Email]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="1355" y="0" width="200" height="15" style="pageHeader"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<text><![CDATA[Revised Target Completion Date]]></text>
</staticText>

</band>
</columnHeader>
<detail>
<band height="16" >
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="100" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{issueId}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement x="100" y="0" width="105" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="205" y="0" width="100" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{cost}==null?"0":«»($F{cost})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="305" y="0" width="150" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{estimatedCost}==null?"0":«»($F{estimatedCost})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="455" y="0" width="100" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{statusName}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="555" y="0" width="100" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{sourceApplication}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="655" y="0" width="100" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{sourceValue}==null?"0":«»($F{sourceValue})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="755" y="0" width="100" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{targetScore}==null?"0":«»($F{targetScore})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="855" y="0" width="200" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{targetCompletionDate}==null?"":«»($F{targetCompletionDate})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="1055" y="0" width="150" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{criticalName} == null?"":«»($F{criticalName})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="1205" y="0" width="150" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{approverEmail} == null?"":«»($F{approverEmail})]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="1355" y="0" width="200" height="15" mode="Opaque" stretchType="RelativeToTallestObject" style="detail"/>
<box leftPadding="10" leftBorder="2Point" bottomBorder="None" leftBorderColor="white"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{revisedTargetCompletionDate}==null?"":«»($F{revisedTargetCompletionDate})]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

Also i have attached the excel sheet of the report which i am getting.

 

Please help me...

 

Thanks in Advance,

Karamveer [file name=issueList.xls size=135168]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/issueList.xls[/file]

Link to comment
Share on other sites

  • 10 months later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I have a problem with a repeating columnheader. I use an XML file as a datasource and all the elements are displayed fine in detail band (different every time, the way it should be). But in the columnheader it's just the same value everytime. I understand that it's a static band and doesn't behave the same way as detail, but how can I solve the problem and select the new value for every column, in the columnheader ?
Link to comment
Share on other sites

Karamveer, are you still following this thread? I found out how to avoid the repeating columnHeader values !

 

Don't use columnHeaders! Use the title band and remove (if you can) or collapse the surrounding bands. That way - at least for me - I had a report with a different title value from my XML source in every column.

Link to comment
Share on other sites

Hi,

Try to set isIgnorePagination="true" in your jrxml's <jasperReport /> tag, and use the JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS export parameter set to Boolean.TRUE.

Hope it will improve your result.

 

hth,

sanda

Link to comment
Share on other sites

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...