Group Name Field in Crystal Report
The group is a set of records that are related to each other in some way. For instance, you might group together all of your employees in the same Zone. The Group Name field is created when you insert a group into your report.
Today, I am trying to explain how to group the data in crystal report by using Group Name Field in Visual studio 2010.
After creating a report, right-click on the Group Name Fields option in the Field Explorer and select Group Expert option.
As you select Group Expert option from Group Name Field, Group Expert Dialog Box will open. After that select the field name from the object of the database and add it into Group By list and click Ok button to close the current window.
After selecting a field, the group name is automatically added into the group section of the Crystal Report and a field also added in the Group Name Fields.
You can format the report by yourself as I here change the back color of the group name and also change the text and font of Page Header fields from the Properties window.
You can see the output or preview of a report from
Main Report Preview or run an application.
After that, I also use a formula field to display the age of the employee, for that, I had used a date_different function because I have columns employee_DOB(date-of-birth), employee_joining (joining date) and on the basis of that columns I can find the difference of a year or employee age.
If you see the preview of the report it displays the age in decimal floating-point so in order to change the format right-click on the formula field in the crystal report and change the format according to you.
Now if you see the report it will display the age in the correct format.
you should read also this Article - Non-Blocking Synchronization in C#