Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modulus -- alternate banding with group underlaying issue

Status
Not open for further replies.

jack91

Technical User
Apr 13, 2009
185
US
Hi,

I am using 2 different groupings and I am underlaying that to the details section below.

I am using
If RecordNumber Mod 2 = 0 Then
color(225, 225, 225)
Else
crWhite

But either because of the grouping/underlaying its screwing up the banding. When i drag the groups into details it looks good though.

Please advise
thanks
Jk
 
It is unclear in what way things are "screwed up" or how you would like the report to display. Do you only want the details banded? Why are you underlaying the group header?

-LB
 
I want the grouping and the details to be on the same line ------ so the reason for the underlay.I am uinderlaying the group not the header.

So, now when they are are on the same line I want to do alternate banding.
Thanks
Jk.



 
I want the grouping and the details to be on the same line ------ so the reason for the underlay.I am uinderlaying the group not the header.

So, now when they are are on the same line I want to do alternate banding.
Thanks
Jk.



 
Alternate bands are double the size -- I suspect it's because of the underlaying.

Is there no way to get alternate banding and have grouping with underlaying (with the details section below it)?

thanks
Jk
 
I assume that with banding you mean making the background colour change from group to group?

Are you suppressing records or groups?

Does each group have one or more records in the details?
 
>>>I assume that with banding you mean making the background colour change from group to group?

YES, alternate from one line to the other

>>>Are you suppressing records or groups?

Yes.One group

>>>Does each group have one or more records in the details?

yes it does.

THANKS
Jk
 
Perhaps try to replace your formula for alternating colours in the group header with
Code:
Shared NumberVar colourChange := colourChange + 1;

If colourChange Mod 2 = 0 Then
   color(225, 225, 225)
Else
   crWhite

I guess that should take care of some issues with alternating colours.

You could use the almost same for the details
Code:
Shared NumberVar colourChange;

If colourChange Mod 2 = 0 Then
   color(225, 225, 225)
Else
   crWhite

Hope this works, but if not, please give a more detailed description of what exactly is going wrong and how things fit together?
 
Hi,

I have the header background as silver so if the details below start with silver also -- it does not look good visually.

Is there a way to start banding with white band first on all pages?

Thanks
Jk

 
Since I dont have crystal installed here I'll only be able to give some pointers as to what might work.

You could insert a fakegroup and tell it to repeat groupheader on every page. In this groupheader you could reset the Shared NumberVar colourChange so a number so the page starts with white. Not sure but think it should be 1.

You could try something else to.. check on page number change and reset the shared numbervar on that.

And why not use a different colour as silver anyway? Like blue or so. The default templates might give you a good idea
 
If you don't color the group header--only the detail section--then the rows will alternate--unless your section suppression is interfering. Can you tell whether the issue arises right after a section is suppressed? If so, provide the formula you are using for section suppression and tell us what sections you are applying it to.

-LB
 
Hi LB,

I have 3 group headers.
PH b -- being used (Silver background)
PH c -- suppressed
GH 1 -- is suppressed (checked "new page before" -- and notonlastrecord)
GH 2 -- is suppressed (checked "new page before" -- and notonlastrecord)
GH 3 -- not suppressed (but no data/stuff in there)

Detail a -- is suppressed
Detail b -- is being used (section has silver background)
GF 2 --- is being used for Totals
GF 1 -- not being used and not suppressed.

note: the banding is occurring but I want the first band in Detail b to start in white as PH b on top has silver background.

Thanks
Jk



 
please note:

I am using 3 groups, with group by being in "specified order" with leave others in their own groups.

Thanks
Jk
 
From your first post I understood that you were underlaying one of the group headers?

I am using 2 different groupings and I am underlaying that to the details section below

I believe that you could actually simply use the formula I gave and use that shared variable to do the alternating.

And simply put a reset of the shared variable in the page header.

 
Not on this report -- no underlaying.

(The initial that had the underlaying -- there was a data issue which the dba corrected and that helped to set the banding right -- although I am certain to encounter that issue soon)

I will try your shared var solution and let you know how it worked out.

Thanks
Jk
 
Ah well, crystal is almost reinstalled... so if it doesnt work and LBass doesnt supply the solution.......
 
The shared var did not make a difference for what i was using before which was:

if {#RTotal0} mod 2 = 0 then color(225, 225, 225)
Else
crWhite

Some pages do start with a white band but other pages don't.

It is certainly not critical (especially on a friday evening :).

But it's good to know.
(fyi, using crystal v 10).

Thanks
Jk
 
In a fake group that is set as group 1 put in the groupheader under color in the section expert:
Code:
Shared NumberVar colourChange := 0;

crwhite
surpress the group sections and make sure that you set the 'repeat group header on each page' in the Options tab in Change Group Options.

In the details section in the section expert color tab:
Code:
Shared NumberVar colourChange := colourChange+1;

If remainder(colourChange, 2) = 0 Then
   color(225, 225, 225)
Else
   crWhite;

A fake group is made by using a formula for a group:
Code:
whilereadingrecords;

I'm curious to learn of alternative solutions....
 
You didn't think it was necessary to tell us that you had changed your requirements? That wastes everyone's time.

It is hard to tell from all these posts what your actual issue is. If it is just that you want the starting detail to be colorless, then you need a page count. Add a formula in the PAGE FOOTER section:

whileprintingrecords;
numbervar cnt := 0;

Add another formula to detail_b:

whileprintingrecords;
numbervar cnt := cnt + 1;

Then use a formula like this to color detail_b:

whileprintingrecords;
numbervar cnt;
if remainder(cnt,2) = 0 then
crSilver else
crNoColor

-LB
 
sorry about that Lb.I just did not want to start another thread.

A basic related question :)

I understand the banding when i have records in the detail section.

But if i have record in the group footer section the alternate banding did not work. I am using:

if groupnumber Mod 2 = 0
then
color(225, 225, 225) else crWhite

If its better to start a new thread then i will do so - pl let me know.

Thanks
Jk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top