bogdangh Posted December 8, 2006 Share Posted December 8, 2006 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 | X4Total ----------------| X1+X3 | X2+X4 D | E | X5 | X6 D | F | X7 | X8Total ------------------| 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 | X8Total -----------------|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 More sharing options...
lucianc Posted December 11, 2006 Share Posted December 11, 2006 If "reference" your first or second row group? Based on your description, you should add the total row for the second row group.. HTH,Lucian Link to comment Share on other sites More sharing options...
bogdangh Posted December 11, 2006 Author Share Posted December 11, 2006 I managed to make it work, thank you. Bogdan Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now