If you haven’t had a look at the first, then please click here: Crystal Report Using Stored Procedure
Adding Serial number in Crystal Report
Create new Formula Field by right clicking on Formula field tab from Field Explorer.

Give a name 'SrNo' and click Ok.
In this formula workshop for the Field 'SrNo' declare variable numbervar 'srno' and increment it (srno:= srno+1;) in a while loop 'WhilePrintingRecords' .
- WhilePrintingRecords;
- numbervar srno;
- srno := srno + 1;
So for each record in details section it will increase the number by 1.
Drag and drop the Formula in details section

Save the report and click on mail report Preview, it will display running Serial Number in detail section.

Adding alternate row color in Crystal Report
now click on Crystal Report - > Report -> Section Export and go to detail section and click on Color tab.
Add formula like:
if RecordNumber Mod 2 = 0 Then crSilver else crblue
So if the mode is zero then apply color 'Silver' else 'Blue'

Run the report and check the data by clicking on 'Main Report Preview'.



chirag patelPosted May 27, 2020, 5:58 AM
This article very useful ankur sir
Ankur MistryPosted Dec 8, 2015, 2:42 PM
Thank you Pinky
Pinky SolankiPosted Dec 8, 2015, 11:47 AM
nice article..keep it up.