Solved

Color Formatting

Posted on 2013-06-13
6
280 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

18 Experts available now in Live!

Get 1:1 Help Now