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

Trouble with a multi-instance table

Status
Not open for further replies.

Pete271

Instructor
Feb 16, 2005
61
GB
Hi

First time poster so please let me know if I'm not providing enough information.

I'm using Crystal 8.5 and trying to write a report that includes a table with multiple values.

The report should look like this

Name Solicit Attribute1 Attribute2
Code
----- -------- ----------- -------------
Smith 1 Value1 Value1
Value2

Attrbute1 will only ever have one value, but Attribute2 could have up to 6 instances. When I write the report the row is repeated for each change in Attribute2.

Any help would be greatly appreciated and if you need me to give more information just let me know.

Thanks
Pete
 
That's how Crystal works. It views the data as six 'rows', each row being a set of linked records.

Group by name, then suppress the details. Display just the group header or group footer. Group footers are mostly more useful because you can use Running Totals.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Try formatting each field to suppress if duplicated. Go to format field->common->suppress if duplicated.

-LB
 
Thanks for your replies, but I'm hopeful that there may be a formula which will do it for me.

I have been told on a different forum that a something along the lines of

whileprintingrecords;
if stringvar Test = "" then
stringvar Test := Attribute 1 field
else
stringvar Test := stringvar Test + ", " + Attribute 1 field

should solve the problem, however when I have entered this formula it does not work and I don't know enough to correct it!
 
Are you saying you want to accumulate values from several records and then show them together? I did a similar things to collect postcodes from groups of customers:

Code:
// Accumulate using a formula field (suppressed) in the detail line.  Allow for nulls and blanks.
whileprintingrecords;
if not isnull({Recc.Postcode}) and {Recc.Postcode} <> " "
then stringvar pst := pst + {Recc.Postcode} + ", "
else if length(pst) = 0 
then stringvar pst := pst + "Excluding blanks; "
else stringvar pst := pst
The logic of this was to accumulate postcodes in a field called pst, by adding the record field to pst. I'd also note when there were blanks, which came first because I had sorted the group by postcode.

You'll need to work out something of your own from this. Field names like 'pst' are arbitrary but the field name has to be the one used in your database.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Again, I believe all you need to do is format each field to suppress if duplicated.

-LB
 
the problem with 'suppress if duplicated' is that for the 'solicit code' column it suppresses the value for the entire page when it should appear for the next individual who has the same solicit code.

thanks for your help though
 
Then all you need to do is use the x+2 formula area next to "suppress if duplicated" and add the formula:

{table.name} = previous({table.name})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top