Sunday, October 24, 2021

Alternate Row Color in Crystal Report

 Most of the time while developing reports people wonder how to have alternating row colors in the report like below.

 
Customer NameAddressCityStateZip
Suparba panda123 olive rdSt LouisMO 54678
John Doe456 Tree driveRaleighNC14676
Jane Doe768 Hudson rdAtlantaGA76555
 
There is a cool trick to it.
 
Go to the format section of the Details. Click the Color Tab. Then click the button next to the Background Color CheckBox...
 
CR1.gif
 
In the formula editor of background color, type the following:
 
if RecordNumber mod 2 = 0 then crSilver else crNoColor.
 
CR2.gif
 
Save and close the editor.
 
And now when you run the report you will see alternate colors of silver and white in the details section.

No comments:

Post a Comment

No String Argument Constructor/Factory Method to Deserialize From String Value

  In this short article, we will cover in-depth the   JsonMappingException: no String-argument constructor/factory method to deserialize fro...