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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center Group Header

Status
Not open for further replies.

ravula2000

IS-IT--Management
Mar 8, 2002
205
0
0
US
I have a Group Header and detail records as follows..

State Name County
Pennsylvania Bucks
Phil
XXXX
YYYY
ZZZZ

My question is, can we center State name to the county detail records as follows?

State Name County
Bucks
Phil
Pennsylvania XXXX
YYYY
ZZZZ

Thanks
Srinivas
 
Can you give a little more information? What you have here is a little confusing.
 
I have say 2 fields State and county. Here in this report I showed Counties group by State. (For the State field 'Suppress on duplicate' is applied)

===================================================
State County
===================================================
Pennsylvania Bucks
Phil
XXXX
YYYY
ZZZZ

NewJersey Morristown
Montogony
Madison



My question is, can we center State to the county detail records as follows?

===================================================
State County
===================================================
Bucks
Phil
Pennsylvania XXXX
YYYY
ZZZZ

Morristown
NewJersey Montogony
Madison


The State Pennsylvania (Moved to 3rd row) is centered to its county records.

Thanks
rao
 
Here goes,

create 3 things;

One reset place in group header:

whileprintingrecords;
global numbervar count_names := 0;

2nd place in details section (can suppress it):

Whileprintingrecords;
global numbervar count_names := count_names + 1;

Create a count by group of the countys

Put the group name field in the detail section and conditionally suppress it with the following:

global numbervar count_names;
count_names <> round(Count ({County}, {State})/2)

This will suppress the items other than the one that is in the middle. I put the round in so it will work with odd numbers or even numbers.

Hope this helps,

Christine
Crystal Training and Consulting
crosenbaum@Strafford.com
 
Hi,
I understand the solution. While performing the last step Iam getting an error 'The Summary / running total field could not be created'.
Iam giving the following formula.
global numbervar count_names;
count_names <> round(Count ({rpt_TaxProfessionalActivity.OfficeID},{rpt_TaxProfessionalActivity.TaxProName})/2)

rpt_TaxProfessionalActivity stored procedure name and OfficeID is a group field.

Can you please help me..
Thanks
Srini
 
Yes I got it..



Can I extend this if for more groups (Supergroups)?

Also if I want to center the group for a page (in case if the group has 10 pages of detail records) what should be done?

Thanks very much
Srini
 
Iam doing this for one more group say Country, in which State is a group.
HI Christine,

The 3rd step Iam doing like this

global numbervar count_names;
count_names <> round(Count ({County}, {State},{Country})/2)

And Iam getting an error 'The Summary / running total field could not be created'.

Is there any error in this syntax?

Please advise me..

Thanks
Rao
 
You have given the count function 3 fields? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Then how can I find out the count? what is the notation?
Please advise me..

Thanks
Srinivas
 
You have to do each count separately:

Count ({County}, Country) counts the records by state

Count ({County}, {State}) counts the records by state

Count ({County}, Country) counts the records by state

The assumption in each case is that every record has the field county filled in. If not, use a different field that is always filled in for the first field.

By page would be very tricky, unless you know exactly how many records are on a page, then you could suppress based on half of that number when the count for the group is beyond the number for one page. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I need only one thing now..

What is the notation to find out the distinct states in a group? (I will add to the above count). To this totalcount/2
I will center the Country heading.

Your help is appreciated..

Thanks
Rao
 
DistinctCount ({state}, {groupfield})
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
HI Kenhandy,
I implemented the center groups format (Even if multiple pages are there) for 4 groups successfully.
I appreciate your help and suggestions.

Thanks
Rao
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top