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

Exporting concatenated field to CSV

Status
Not open for further replies.

thatgirlinMS

Programmer
Jun 27, 2002
8
US
I have some formulas that are populating a string variable with detail data into one fat string. No matter how I seperate the values (*,/~) only the first value is exported in csv format. I am exporting my values | delimited....any ideas? Below are my formulas.

1) In the Group Header place the @reset formula:

WhilePrintingRecords;
StringVar chain := '';
NumberVar ChCnt := 1


2) On the Details place the @Accum formula, putting your field into the second line:

WhilePrintingRecords;
StringVar Item:= {Axis1.code};
StringVar Chain;
NumberVar ChCnt;

if ChCnt = 1 then (ChCnt:= 2; chain := Item)
else
chain := chain + '*' + Item

3) On the Group Footer place the @Display formula:

WhilePrintingRecords;
StringVar Chain
 
I've done similar things and it has always worked. The difference I notice is that I set up the values in formula fields which show the value followed by a comma, and then reference them from other formula fields. I don't use StrongVar because it is mostly not necessary.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
I am using crystal reports 11 and I replaced the * with a comma just to check and it still does the same thing. When I export to CSV with no delimiter and seperated with a pipe |

The first value shows in notepad but the rest are dropped. I am viewing the exported file in notepad.

I then placed the display formula in a text box and still the same result.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top