Solved

Color Formatting

Posted on 2013-06-13
6
290 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 101

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 101

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
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

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 101

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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. …
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

688 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