Jump to content
We've recently updated our Privacy Statement, available here ×

crosstab row total


bogdangh

Recommended Posts

Hi,

can anyone help me with the calculation of the total for the rows ? I have the following problem: i want to show the total after each row group like this :

 

Code:

---------------------------------------------
RowHeader1 | RowHeader2 | column1 | column2
---------------------------------------------
A | B | X1 | X2
A | C | X3 | X4
Total ----------------| X1+X3 | X2+X4
D | E | X5 | X6
D | F | X7 | X8
Total ------------------| X5+X7 | X6+X8

 

but I get :

 

 

Code:
[code]
---------------------------------------------
RowHeader1 | RowHeader2 | column1 | column2
---------------------------------------------
A | B | X1 | X2
A | C | X3 | X4
D | E | X5 | X6
D | F | X7 | X8
Total -----------------|X1+X3+X5+X7|X2+X4+X6+X8

 

the code i used:

Code:
[code]
<rowGroup name="reference" width="100" totalPosition="End">
<bucket>
<bucketExpression class="java.lang.String"><![CDATA[$F{reference}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Transparent">
<box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="0"
y="0"
width="100"
height="17"
key="textField"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$V{reference}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents mode="Transparent">
<box topBorder="1Point" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>
<staticText>
<reportElement
x="0"
y="0"
width="100"
height="17"
key="staticText-1"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement>
<font/>
</textElement>
<text><![CDATA[Reference total]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>


<crosstabCell width="100" height="17" rowTotalGroup="reference">
<cellContents mode="Transparent">
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="1Point" rightBorderColor="#000000" bottomBorder="1Point" bottomBorderColor="#000000"/>
<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="0"
y="0"
width="100"
height="17"
key="textField-1"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font/>
</textElement>
<textFieldExpression class="java.lang.Double"><![CDATA[$V{Value_Count}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>

 

Thanks in advance

 

Bogdan.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

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