Solved

Color Formatting

Posted on 2013-06-13
6
279 Views
Last Modified: 2013-06-13
I have a report where I have data grouped and, as each group comes up, it starts a new page. I have created a Variable for color formatting and formula for changing the color for each line on the report.
My problem is with the new page. It resets the color formatting and I don't know how to correct it. Here are my formula's, other than the "New Page Before" setting in the Section Expert for the Group:

Shared Variable:
    shared numbervar iCount := iCount +1;

Color Formula:
   shared numbervar iCount;
    if iCount mod 1 = 0 then
      Color (221,227,228)
    else
      crNoColor

This work fine if I "don't" use the  "New Page Before" setting in the Group Section but simple colors all the details on one page and no color on the other if I do use the setting.
I need it to alternate the color for each detail line on each page if that makes sense.

Let me know.

Thanks,
0
Comment
Question by:nathra
  • 3
  • 3
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39245612
Where are the formulas?

What formula is in the group header?

If you want every other line you really need to mod by 2 not 1


   shared numbervar iCount;
    if iCount mod 2 = 0 then
      Color (221,227,228)
    else
      crNoColor

mlmcc
0
 

Author Comment

by:nathra
ID: 39245637
The "New Page Before" is checked in the "Group Header" section
The "Shared Variable" field is setting in the "Page Header" section which is suppressed.
The "Color Formula" is in the formula editor of the "Color" tab in the "Details" Section.

No problem changing the "Color" formula to reflect a "mod 2".

Does this information help?
All I want is a color change on every other line for each new page. :)
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39245675
Is each line a record?
If so then just use the RecordNumber


    if RecordNumber mod 2 = 0 then
      Color (221,227,228)
    else
      crNoColor

mlmcc
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:nathra
ID: 39245701
That works with one exception. It does reset the coloring. IE.. If the last line on a particular page "No Color" then the next page starts with a colored line.

Not a big deal just curious if there is a way to reset the alternating color to start again for each page?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39245802
Put this in a formula in the page header

shared numbervar iCount :=  0;

Change the color formula to


   shared numbervar iCount;
    iCount := iCount + 1;
    if iCount mod 2 = 0 then
      Color (221,227,228)
    else
      crNoColor

mlmcc
0
 

Author Closing Comment

by:nathra
ID: 39246075
Excellent, as always! Thanks for the help!!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now