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

Combine multiple string records in one string

Status
Not open for further replies.

nina1

Programmer
Aug 14, 2001
31
CA
I use Crystal reports version 10 and Betriave database.
I am exporting invoices with multiple line items and my problem is with the description field.
The data look like this:
Invoice# item# Description Qty
3888 Order#4555 0
3888 BOL#000055 0
3888 PacKL:3888 0
3888 443V Bolt 50
3888 EX Part 0
3888 Order#4556 0
3888 BOL#000056 0
3888 PacKL:3888 0
3888 444D Bolt 75
3888 EX Part 0
I want to combine the Description field in on field .
I use this report to import it to MS Acces database table.
Any help would be appreciated

Thanks
 
Do you mean, you want to string together all of the descriptions for the invoice? I did something similar for postcodes, which you should be able to adapt:

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
Code:
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar pst;
left(pst,len(pst)-2)
Code:
//  Clear using a formula field using in the group header.
whileprintingrecords;
stringvar pst := "";

Note that clearing in the footer avoids problems with group headers repeating on a new page, which does clear everything for the group. Provided the 'clear' is placed in the section AFTER the display, it will do them in that order.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top