Serial Number and Alternate row Color in Crystal Report

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' . 
  1. WhilePrintingRecords;  
  2. numbervar srno;  
  3. 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'.