Solved

Color Formatting

Posted on 2013-06-13
6
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

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…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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