BlueFrog
BlueFrog

Reputation: 131

Remove Double Quotes From Formula Results - Crystal Reports

I am having an issue when building a CSV report in Crystal Reports (using the Visual Studio plug in)

I have three columns of data (UserID, Name, Location), I have used a formula to create a comma separated entry for each row of date:

CSTR({Command.USERID},0,'') + ',' + {Command.NAME} + ',' + {Command.LOCATION}

However the output is:

“0009,John Smith,London”

“0008,Johann Schmidt,R101”

Each row is starts and finishes with double quotes.

How do I remove/prevent double quotes from appear around formula results?

The desired result is:

0009,John Smith,London

0008,Johann Schmidt,R101

Thanks

Upvotes: 0

Views: 1592

Answers (1)

Hexxx
Hexxx

Reputation: 423

A simple REPLACE function would do the trick. Try this:

Replace(CSTR({Command.USERID},0,'') + ',' + {Command.NAME} + ',' + {Command.LOCATION},""""," " ) 

Note:The extra double quote, i.e. a quadruple double quote.This is known as escaping a character. The extra double quote escapes the action normally triggered by the second double quote.

OR

Replace(CSTR({Command.USERID},0,'') + ',' + {Command.NAME} + ',' + {Command.LOCATION},chrW(34)," " ) 

chrW(34) is equivalent to double quotes.

Upvotes: 0

Related Questions