Solved

Color Formatting

Posted on 2013-06-13
6
286 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

861 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