Jump to content

Please help with grouping


Recommended Posts

By: Yong Wang - wymz

Please help with grouping

2002-09-13 09:00

Hi, I have the following table and group section:

 

OID status location

------------------------------

001 A loc1

002 A loc2

003 B loc3

004 B loc4

005 A loc5

 

<group isReprintHeaderOnEachPage="true" isResetPageNumber="false" isStartNewColumn="true" name="StatusGroup">

<groupExpression>$F{status}</groupExpression>

<groupHeader>

<band height="25">

<rectangle>

<reportElement backcolor="#FFDDDD" forecolor="#FFDDDD" height="10" width="540" y="15" x="0"/>

<graphicElement stretchType="NoStretch"/>

</rectangle>

<staticText>

<reportElement forecolor="#FF0000" height="10" y="15" x="0" width="150"/>

<textElement lineSpacing="Single" textAlignment="Left">

<font isUnderline="true" reportFont="Arial_Italic"/>

</textElement>

<text>Status: </text>

</staticText>

<textField>

<reportElement forecolor="#FF0000" height="10" y="15" x="160" width="250"/>

<textElement textAlignment="Left">

<font reportFont="Arial_Bold"/>

</textElement>

<textFieldExpression class="java.lang.String">$F{status}</textFieldExpression>

</textField>

</band>

</groupHeader>

<groupFooter>

<band height="15">

<rectangle>

<reportElement backcolor="#DDDDDD" forecolor="#DDDDDD" height="10" width="555" y="0" x="0"/>

<graphicElement stretchType="NoStretch"/>

</rectangle>

<staticText>

<reportElement height="10" y="0" x="0" width="150"/>

<textElement lineSpacing="Single" textAlignment="Right">

<font reportFont="Arial_Bold"/>

</textElement>

<text>Status record count: </text>

</staticText>

<textField>

<reportElement height="10" y="0" x="160" width="140"/>

<textElement lineSpacing="Single" textAlignment="Right">

<font reportFont="Arial_Bold"/>

</textElement>

<textFieldExpression class="java.lang.Integer">

$V{StatusGroup_COUNT}

</textFieldExpression>

</textField>

<staticText>

<reportElement height="10" y="0" x="210" width="140"/>

<textElement lineSpacing="Single" textAlignment="Right">

<font reportFont="Arial_Bold"/>

</textElement>

<text>Total: </text>

</staticText>

<textField>

<reportElement height="10" y="0" x="350" width="200"/>

<textElement lineSpacing="Single" textAlignment="Right">

<font reportFont="Arial_Bold"/>

</textElement>

<textFieldExpression class="java.lang.Double">

$V{StatusGroup_TOTAL}

</textFieldExpression>

</textField>

</band>

</groupFooter>

</group>

 

when I run the report and got the something like this:

 

Status: A

001 A loc1

002 A loc2

<..footer>

 

Status: B

003 B loc3

004 B loc4

<..footer>

 

Status: A

005 A loc5

<..footer>

 

I am really confused. what am i doing wrong? appreciate any help. Thanks.

 

---Yong

 

 

By: Yong Wang - wymz

RE: Please help with grouping

2002-09-13 09:50

Sorry, I just realized I need to specify the sort order in the query string. pls ignore my previous question...

Link to comment
Share on other sites

  • 6 years later...
  • Replies 1
  • 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...