I have created a report fetching a record teacher name from database and generating serial# against it. i have applied a group on teacher name and pass the serial# and teacher name on group header. for serial# number i have created a variable.
///////For group on teacher/////
<group name="teacher">
<groupExpression><![CDATA[$F{TCHR_NME}]]></groupExpression>
<groupHeader>
<band height="21">
<rectangle>
<reportElement x="0" y="0" width="29" height="21" forecolor="#666666"/>
</rectangle>
<textField>
<reportElement x="0" y="0" width="29" height="21"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$V{sr}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement x="29" y="0" width="524" height="21" forecolor="#666666"/>
</rectangle>
<textField>
<reportElement x="29" y="0" width="130" height="21"/>
<textElement verticalAlignment="Middle">
<font size="7"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{TCHR_NME}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
Now the problem is. it display the output like.
Sr#|Teacher
1 A
1 B
2 C
3 D
4 E
why 1 is occurring 2 times, either it has to show like 1,2,3,4 like a counting.....Please Help...Any help will be highly appreciated..A B C D E are teacher names.Thanks
no need to do all this thing.....put a jrxml in a specified folder and then call a method from the action class with a condition specified for that particular report if any parameter for the report is mentioned in it...
Thanks praneel for the solution, but i have got the solution by giving the evaluationTime="Group" and evaluationGroup on the textField and now it is working fine. Thanks once again.