Solved

crystal report 4.6 - apostrophe in formula

Posted on 2004-08-12
7
948 Views
Last Modified: 2012-06-22
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.
0
Comment
Question by:tsluu
  • 3
  • 2
7 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 11790517
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
 

Author Comment

by:tsluu
ID: 11790634
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 11791862
Try
crpt.Formulas(0) = "ReportTitle='MacDonald""s Burger'"

That is a double double quote in Mconald's

mlmcc
0
 

Author Comment

by:tsluu
ID: 11798089
crpt.Formulas(0) = "ReportTitle='MacDonald""s Burger'" works fine but my report title will display:

MacDonald"s Burger

instead of :

MacDonald's Burger
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 50 total points
ID: 11798250
Try

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

chr(27) is the '

mlmcc

0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports - Display Last Invoice in Group 15 69
String to Date Formula Failure 2 48
Crystal Reports - group header 2 44
Field in crystal 2011 is being cut off. 9 33
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

776 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