Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Make Alternate Green Bands in Crystal 7 Report 4

Status
Not open for further replies.

charleyhorse37

Programmer
Oct 25, 2001
6
How can I make my report display alternating green (or any other color) bands similar to the old style computer paper from years ago?

 
sure...
in your detail section you should be able to conditionaly change the color of the background with the following:

if recordnumber mod 2 = 0 then
crGreen
else
nocolor

(not sure if 7 provides the conditional format option)

noxum
 
v7 does offer conditional formatting, but not sure if 7 uses the mod function.

An alternative formula is:

If Remainder(RecordNumber,2)=0 then Green else NoColor

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
As an alternative to having the whole row colored you could overlay a textfield with a single space in it over the row and have its background color vary

using the conditional Background formula

I would not tie the detail line to the record number though...for example what if you do not process every record then your nice printout looks weird.

I usually set up a manual counter and base the formula on that.

In the Report header

@InitializeCounter

Numbervar CFlag :=1;


In the conditional suppress of the Blank Textfield

whilePrintingRecords;
Numbervar CFlag ;

//you can put in similar conditions as you would to
//suppress a detail line, here to prevent this flag
//incrementing.
Cflag := Cflag + 1;

if remainder(Cflag,2) = 0 then
crGreen
else
crNoColor;


the advantage of using the blank text box method is you control the amount of space you want colored....sometimes you set up nice margins and you want your colored lines to lie within those line...not one adge of the page to another.



Jim Broadbent
 
I checked, and this apparently worked as far back as CR 6:

if Remainder(RecordNumber, 2) = 0 then CrGreen Else NoColor

-k
 
Apparently this worked as far back as CR 6:

Right click the section, select Color->Background Color

If Remainder(RecordNumber, 2) = 0 then CrYellow else NoColor

-k
 
Thanks to all who replied with assistance. I failed to mention that I populated the report via DAO from an Access database in a Visual Basic 6.0 project I have been working on. The Crystal Report is accessed through the RDC in VB 6.0.

Any additional insight would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top