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

CRXI: display all group names on a page

Status
Not open for further replies.

glyrocks

Technical User
Nov 16, 2006
57
US
I'm trying to write a formula that will display all the group names on a page. Does anyone know the syntax to call the group name for all groups that appear on a page? Thanks,

dylan
 
Are you talking about showing the group instances of one group, or the group instances of multiple groups? Does the group cross pages or is it always fully displayed on one page? Where would you want to display the result of the formula?

-LB
 
I want to show the group name for multiple groups on a single page. I'm building a hydrology table so I have data grouped by streams. If I have more than one stream on a page, I need to display both stream names in the page footer. The groups may cross pages and, in fact, must have crossed at least one page for this to be an issue. Meaning, I only need to concatenate stream names if one group didn't fit on a single page. Hope that clarifies...

I suppose I could do this with variables, couldn't I? Something like declare a variable that concatenates groups names and resets on each page? But I don't know the syntax to do that. Thanks a lot,

dylan
 
Well, I got it working for two group names using InRepeatedGroupHeader and some variables. It's not pretty, but it works for two groups on a page. It's not likely that more than two groups will show up on a single page, but it is possible so I could still use some ideas on that. Thanks!

dylan
 
Create three formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
stringvar x := "";

//{@accum} to be placed in the group header section:
whileprintingrecords;
stringvar x := x + {table.groupfield} + ", ";

//{@display} to be placed in the page footer:
whileprintingrecords;
left(x,len(x)-2);

-LB
 
Yikes, that's way more complicated-looking than what I scratched out. But I bet it works a lot better too. Thanks a lot lbass, I appreciate the help. I'll work with that and see where I can get.

dylan
 
I am trying to implement your code, but am getting a "The ) is missing." error for the last formula, and I don't know what that means. Thanks,

dylan
 
The last formula is missing the declaration of the variable.
This should work:
Code:
//{@display} to be placed in the page footer:
whileprintingrecords;
StringVar x ;
left(x,len(x)-2);

Bob Suruncle
 
Ah, okay. I should have known that. I'm obviously just beginning a long and prosperous career with Crystal Reports and VB in general. Thanks for all you help,

dylan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top