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

Display group values horizontally 1

Status
Not open for further replies.

ramc2000

Technical User
Nov 8, 2002
60
0
0
GT
Crystal version 11.0

I need to display group values horizontally instead of vertically, I know I can use the section expert and check the “format with multiple columns” option on my details section (which is currently hidden), this plus the "multiple columns format" option allows me to get the values to be printed horizontally but the issue now is this changes orientation for all groups in my report and I only want this behavior for group number 2.

Here’s a sample of what’s happening right now and how I want it.

Currently:
GH1 (value 1) GH2 (value 1) GH2 (value2) GH1 (value 2)
GH2 (value 1) GH2 (value 2) GH2 (value 3) GH1 (value 3) ...

Desired:
GH1 (value 1)
GH2 (value 1) GH2 (value2)
GH1 (value 2)
GH2 (value 1) GH2 (value 2) GH2 (value 3)
GH1 (value 3) ...

 
The only way I could think if this working is with a sub report for the one you require horizontally and the others in your main report as I think if you switch on multiple column format this applies to all however someone else may have a better solution
 
The subreport approach would work. Or you could collect the group two values in a variable and display them in the GH1 group footer, as in:

//{@accum} to be placed in a group #2 section:
whileprintingrecords;
stringvar grp2sum := grp2sum + totext(sum({table.value},{table.group2field},2)+ " "; //2 for two decimals

Add a reset formula to the group #1 header:
whileprintingrecords;
stringvar grp2sum;
if not inrepeatedgroupheader then
grp2sum := "";

Add a display formula to the group #1 footer:
whileprintingrecords;
stringvar grp2sum;

You can adjust the spaces by adding more into the {@accum} formula. Or you could break these out into separate fields, using ubound and split functions.

Then suppress the group 2 header.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top