[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using quotes as a separator in exporting to txt file

Posted on 2012-09-06
5
Medium Priority
?
451 Views
Last Modified: 2012-09-07
I have a report that I am exporting as a txt file from Crystal to vendor.  It has subreports with the report, on one of the subreports there is a formula which joins several fields together with a + ", " + to act as a separator.  Part of the formula has a last/first name with a comma, I have been told that because of the comma between last and first name I need to surround the fields with double quotes ", not single quotes.  When I try to use the double quotes I receive an error "the matching for this string is missing".  Can I use double quotes in a field formula as a separator?

I tried the below formula, it does not work:
Replace({@Supervisor Name}, "___", chr(13))

This is the field formula I am working on, I need to use the double quotes on the third line surrounding the Last Name, First Name, results would be
Supervisor ID,1234,"Smith, Joe",

If {EMCS_CURRENT_SAL_JOB.SUPERVISOR_NUMBER} <> 0 then
"Supervisor ID" + "," + {EMPY_PAYROLL_INFO.PAYROLL_ID} + "," +
{EMGS_GENERAL_STATUS.LAST_NAME} + ", " + {EMGS_GENERAL_STATUS.FIRST_NAME}
+ ","
 
Any  suggestions?
0
Comment
Question by:Grapelady
5 Comments
 

Accepted Solution

by:
dgran earned 668 total points
ID: 38374446
Try this:

If {EMCS_CURRENT_SAL_JOB.SUPERVISOR_NUMBER} <> 0 then
"Supervisor ID" + "," + {EMPY_PAYROLL_INFO.PAYROLL_ID} + "," + Chr(34) + {EMGS_GENERAL_STATUS.LAST_NAME} + ", " + {EMGS_GENERAL_STATUS.FIRST_NAME} + Chr(34) + ","
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 668 total points
ID: 38374570
You can also use single quotes for strings in Crystal..

If {EMCS_CURRENT_SAL_JOB.SUPERVISOR_NUMBER} <> 0 then
'Supervisor ID' + ',' + {EMPY_PAYROLL_INFO.PAYROLL_ID} + ',' + '"' + {EMGS_GENERAL_STATUS.LAST_NAME} + ', ' + {EMGS_GENERAL_STATUS.FIRST_NAME} +  '",'

or even just

If {EMCS_CURRENT_SAL_JOB.SUPERVISOR_NUMBER} <> 0 then
"Supervisor ID" + "," + {EMPY_PAYROLL_INFO.PAYROLL_ID} + "," + '"' + {EMGS_GENERAL_STATUS.LAST_NAME} + ", " + {EMGS_GENERAL_STATUS.FIRST_NAME} + '"' + ","  

mlmcc
0
 
LVL 19

Assisted Solution

by:GJParker
GJParker earned 664 total points
ID: 38376434
Try this :

If {EMCS_CURRENT_SAL_JOB.SUPERVISOR_NUMBER} <> 0 then
"Supervisor ID" + "," + {EMPY_PAYROLL_INFO.PAYROLL_ID} + "," + """"
{EMGS_GENERAL_STATUS.LAST_NAME} + ", " + {EMGS_GENERAL_STATUS.FIRST_NAME} +""""
+ ","
0
 

Author Comment

by:Grapelady
ID: 38378540
Thank you both for a response and suggestion, I have tested both and they work.
0
 

Author Closing Comment

by:Grapelady
ID: 38378544
Thank you all for solutions.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question