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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alternate Row Coloring 1

Status
Not open for further replies.

sam1one

MIS
Aug 30, 2002
49
US
Hello:

How does one alternate the row coloring in Crystal 10?

We would like every other row in a cross-tab report to be shaded a different color?

Thanks
Sam
 
Please respond in your own thread, not in the referenced thread. Please provide your row and column fields and your summary.

-LB
 
Thanks LBass.

I created a formula named Number as you indicated in your previous post.

I then formatted the field with the formula you provided which is the Qual_ID_Root and the result was the first five rows were gray, then green.

Where would I insert the second part of the formula (as you indicated in your prior post in the inner cells/totals?

Thank you
 
Please answer my question above, and also provide the actual formula you used and indicate where you placed it.

-LB
 
Hello LB, I created the following formula.

{@number}:

whilereadingrecords;
numbervar cnt;
stringvar product;

if instr(product,{Qual_ID}) = 0 then
(product := product + {Qual_ID};
cnt := cnt + 1);
cnt

I then formatted the border, background X+2 in the column area:

(val(CurrentFieldValue),2)= 0 then crGray else crGreen


Then where do I put this?

if remainder(GridRowColumnValue ("@number"),2)

Thanks,
Sam
 
Please answer my question about your row, column, and summary fields. Also, provide the datatype of each.

-LB
 
Hello LB:

The row of each color is a string field and it is alternating every few rows to another color.

I would like to print my screen and post it here?
How can I do that?

Thanks
 
This is my final request. What is your row field, what is your column field, what is your summary field?

-LB
 
Hello LB:

My 1st row field is a string: 1850015 is , my 2nd row is also a string 185008, and my 3nd row field is also a string text. Is this what you were looking for?

Sorry, if I have not answered correctly and I really appreciate your help.

Sam
 
Could it be something to do with the stringvar and numbervar count?

 
Please note that you must have your report sorted on the Qual_ID field for this to work. Also, it looks like your ID can be of varying lengths. Try:

//{@rowlabel}:
whilereadingrecords;
numbervar cnt;
stringvar product;

if instr(product,totext(val({table.Qual_ID}),"0000000")) = 0 then
(product := product + totext(val({table.Qual_ID}),"0000000");
cnt := cnt + 1);
totext(cnt,0,"")+"- "+{table.Qual_ID}

The number of zeros should reflect the maximum number of digits in the ID field. For the last line, if you have more that 9 rows, then you should format cnt like: totext(cnt,"000").

Right click on the fields in preview mode->format field->border->color->background->x+2 and enter:

if remainder(val(gridrowcolumnvalue("@rowlabel")),2) = 0 then crgreen else crgray

Use the name of the formula between the quotes, but remove the curly brackets. You can use this formula to format the row labels, the inner cells and the totals.

An alternative method would be to use the following in the field formatting formula area.

For the row label:
whileprintingrecords;
numbervar d;
d:= if d = 200 then 255 else 200;
color(200,d,200)

For the inner cells:
whileprintingrecords;
numbervar c;
c := if c = 255 then 200 else 255;
color (200,c,200)

For the row totals:
whileprintingrecords;
numbervar e;
e := if e = 255 then 200 else 255;
color (200,e,200)

-LB
 
Hello LB:

Thank you very much. This worked out wonderfully!

I really appreciate your expertise and am glad that you have so much knowledge to share!

Sorry for the delay in responding.

Sam
 
Hello LB:

Thank you very much. This worked out wonderfully!

I really appreciate your expertise and am glad that you have so much knowledge to share!

Sorry for the delay in responding, I was buried in work.

I will talk to you later and definitely have more questions!

Sam

P.S. Is there a way to add a spell check button to a Crystal Report?
 
Hi LB,

You should be given a Star for your patience and especially for your politeness and modesty!!!

You are really wonderful not just in giving great solutions but also for the above said things.

Thank you so much for the knowledge you share with us.

Regards,
JK.



 
Thank you for your nice comments. You made my day.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top