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

Fake group based value list? 1

Status
Not open for further replies.

beltmanjr

Technical User
Oct 29, 2007
333
NL
I need to create a fake group which acts as a normal group based on a table with 3 values in it:

The group names should be like
'A'
'B'
'C'

So I get:
Group Header 1: A
Details: 'Blah blah'

Group Header 1: B
Details: 'Blah blah'

Group Header 1: C
Details: 'Blah blah'

How can I get this done?
 
What is fake about this if as you say there are three values in the group field? What is the purpose of the group?

-LB
 
Well,
the values dont come from a table field, but from a list I put together myself in crystal.

I'll use it to group and display particular subreports. These sunreports should only be displayed for one of the list values of the group. For each set of subreports I need to be able to reset the page number and insert a page break too. So, creating this group to group these sets of subreports seemed an easy way out.
 
Just put the subreports in separate report footer sections, and then format the last two sections to "new page before" and set each to "reset page number after".

-LB
 
That is a thought.
Just wondering if it isnt possible to create the groups I was thinking about?
 
Create a formula:

whilereadingrecords;
stringvar array grp := ["A","B","C"];
numbervar i := i + 1;
numbervar j := ubound(grp);
stringvar k;

if i <= j then(
redim preserve grp[j];
k := grp
);
k

Insert a group on this formula.

-LB
 
Hi Lbass,
I tried the solution you gave above, but I can only see group 'A' and not 'B' and 'C'.

Have I missed something?
 
Please post exactly what you did, as I did test this and it worked perfectly.

-LB
 
I just tried this on the xtreme sample db.
The issue is that my main report only retrieves 1 single record.

The main report then uses this 1 single record to link to the many subreports. I wanted these subreports, that come in sets, to be nicely kept together and made visible based on which group (A,B,C) would be displayed.

However, I'm afraid that this would never work in this manner, unless I can somehow couple A,B,C to the data in the main report, creating 3 rows instead of 1 to return.

I can't picture this clearly yet though.
 
You just need to add a table that has at least three records, or a larger table that you limit to three or a few more records in the record selection formula, and place one field in the report header, in order for the formula to work.

-LB
 
Indeed I do need to add that table.

Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top