crystal report 4.6 - apostrophe in formula

how do I handle apostrophes in formula to be passed to a report without causing an error. I tried replace ' with '' but still wont work.
tsluuAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
Try

crpt.Formulas(0) = "ReportTitle='MacDonald' + chr(27) + "'s Burger'"

chr(27) is the '

mlmcc

0
 
mlmccCommented:
What are you trying to do?

Crystal formulas can use " " or ' ' for string data.  I would think you could use " " for the strings and a ' would then simply be a character.

mlmcc
0
 
tsluuAuthor Commented:
crpt.Formulas(0) = "ReportTitle='MacDonald's Burger'"
the above will give an error.

So I tried
crpt.Formulas(0) = "ReportTitle='MacDonald''s Burger'"
and still give an error.

How do I solve the apostrophe problem?


0
 
mlmccCommented:
Try
crpt.Formulas(0) = "ReportTitle='MacDonald""s Burger'"

That is a double double quote in Mconald's

mlmcc
0
 
tsluuAuthor Commented:
crpt.Formulas(0) = "ReportTitle='MacDonald""s Burger'" works fine but my report title will display:

MacDonald"s Burger

instead of :

MacDonald's Burger
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.