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!

second groupname index 1

Status
Not open for further replies.

mwmark

Technical User
Jun 5, 2007
23
US
using crystal 10 and sql db

i have a 3 step index in place for report and want to add an additional group index for group3.
*My goal is to show all groups printed in the index(s)*

Current working index:

//index 1 placed in group footer 2
WhilePrintingRecords;
StringVar GroupName;
StringVar PageNum;
if InStr (GroupName, {IC_SUBMANUFACTURER.LOOKUP}) = 0 then(GroupName:= GroupName + {IC_SUBMANUFACTURER.LOOKUP} + chr(13);
PageNum:= PageNum + ".........." + ToText(PageNumber,0) + chr(13));

//index2 placed in report footer
WhilePrintingRecords;
StringVar GroupName

//index3 placed next to index2 in report footer
WhilePrintingRecords;
StringVar PageNum
 
Can' you just duplicate the formulas, use a different variable name, put at group level and zeroise in the group header?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
When i duplicate with new variables all i get is the first goup name and page number regardless of where index 1 is placed. see below

// category index1
WhilePrintingRecords;
StringVar GroupName;
StringVar PageNum2;
StringVar GroupName1;
if InStr (GroupName, {IC_CATEGORY.LOOKUP}) = 0 then (GroupName1:= GroupName1 + {IC_CATEGORY.LOOKUP} + chr(13);PageNum2:= PageNum2 + ".........." + ToText(PageNumber,0) + chr(13));

//category index2
WhilePrintingRecords;
StringVar GroupName1

// category index3
WhilePrintingRecords;
StringVar PageNum2
 
// category index1
WhilePrintingRecords;
StringVar PageNum2;
StringVar GroupName1;
GroupName1:= GroupName1 + [red]{IC_CATEGORY_1.LOOKUP}[/red] + chr(13);
PageNum2:= PageNum2 + ".........." + ToText(PageNumber,0);

You don't need the test if you place the formula in the correct group section, since a group instance will only occur once within that section. This should be in the group section that you want to identify in the index, and should be a different formula from the one in your higher order group.

I also think you would need to add the lookup table a second time, since you would be linking the code to a different field.

-LB
 
Thanks for the help.
After lbass sent this it occured to me that i had not properly formatted the field to "can Grow" oops...

That was the reason i only saw 1 group and page#

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top