Print Page | Close Window

Alternate row color in blank line

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20918
Printed Date: 16 May 2024 at 6:11pm


Topic: Alternate row color in blank line
Posted By: aspfun
Subject: Alternate row color in blank line
Date Posted: 28 Jul 2014 at 5:26am

I designed to print 20 lines in detail section.


If records are 53 lines the report will print 3 pages.


I code in CR detail section to make Alternate Row Color


if recordnumber mod 2 =0 then CrSilver else CrNocolor (this works fine)


How to make alternate row color working after line 53 until line 60? (this is no data)




Replies:
Posted By: lockwelle
Date Posted: 29 Jul 2014 at 4:56am
you could include a number for each row that is printed (a small formula in the detail section like:
shared numbervar rowid;
rowid := rowid +1;
""

and reset the rowid in the page header...now change the color logic to reference rowid like:
shared numbervar rowid;
if rowid mod 2 = 0 then ...


since there is no data for the extra rows, there is no record number, so CR has nothing to work with. Creating a variable give CR something that it understands and can use regardless of dummy data or not.

HTH



Print Page | Close Window