1

I want to group the shown result set in the image to the shown Report Format in JasperReports. I am using JasperReports 4.5. I googled a lot but could not found the required xml tag to meet my requirement.

Image Showing Required Report Format In Jasper Reports And The Result Set Of SQL Server Query for the resultset is as follows

   select Design, ProfitPer, LabourChg, WgtY, WgtR, TypeName, SetName, ShapeName, Size,
   Pieces, Weight, Price, sum(ProfitPer) Profit, round(sum(Cus2),3) Charges from 
   VDetaillist  where design like 'B101E' 
   group by  Design, ProfitPer, LabourChg, CompCost, WgtY, WgtR , TypeName, SetName, ShapeName, Size, Pieces, Weight, Price, SetCost, USS

where Dsign Profit and Charges are the sum values.Design (B101E),ProfitPer,LabourChg,WgtY,WgtR are the non repeated values. And TypeName(Dia,Emarld),Shpae(Round,Square) and Size(4,2.2 * 2.2), Pieces, Weight are repeated values.

Lots of thanks in advance

Alex K
  • 22,315
  • 19
  • 108
  • 236

2 Answers2

0

In the Group Header Band you're using go to properties and for the 'group expression' property try adding this:

$F{Design}+' '+$F{ProfitPer}+' '+$F{LabourChg}+' '+$F{CompCost}+' '+$F{WgtY}+'     '+$F{WgtR}+' '+$F{TypeName}+' '+$F{SetName}+' '+$F{ShapeName}+' '+$F{Size}+' '+$F{Pieces+'   '+$F{Weight}+' '+$F{Price}+' '+$F{SetCost}+' '+$F{USS}

make sure all of your groupby items are $Fields in your iReport document

precose
  • 614
  • 1
  • 13
  • 36
0

In the Group Header Band by adding following code in the 'group expression' property :

  $F{Design}

Solves my problem.