Wednesday, May 9, 2012

Groups in Crystal Report. Tutorial part - 2


Here we will see only report design and rest of things you can refer from the Tutorial part - 1.
Here we will group CustomeràProductà Order and Quantity.
For details just go through figure 14.

Just add a report(.rpt) file to the solution. Select the appropriate dataset from popup window.
Once it’s done then select grouping option like figure 14.

Figure 14
Now right click on the report select Report à Group Experts and
Resulting window will look like figure 15

Figure 15
Now we want to group like Customer Name and Product name so first add Customer to the right Panel. Then move product name to the right panel like figure 16

Figure 16
This time crystal report design will be different than previous time. See figure 17
GroupHeaderSection1 and GroupHeaderSection2 are added to the report designer. Here Goup #1 Name refers Customer Name and Group #2 Name refer Product Name
And also GroupFooterSection1 and GroupFooterSection2 is added below if you want to add something to group footer.

Figure 17
Now under every group we want to show the number of order per customer and product wise so for that we have to add summary to the GroupFooterSection2. Refer Figure 18

Figure 18
Right Click on the GroupFooterSection select InsertàSummary. It will so you next screen (Figure 19). And I have also added Order_ID and Product_Qty field to the detail (section3) part.


Figure 19
In summary window select the column which you want to summarise in first dropdown.
Select Sum (First option) from the calculate drop down.
Summary Location is already set to the report footer. So just click ok to place that summary field to the report.
By default Summary field is added to the Report Footer section so move it to the groupFooterSection2 if you want to group product wise, move it to the GroupFooterSection1 if you want to group Customer Wise or keep it at original place if you want to sum all ordered product. I have move to the FooterSection1 so it will show Customer Wise Total Quantity. Refer Figure 20



Figure 20
Now save the report and run it finally it looks like figure 21

Figure 21

No comments:

Post a Comment