Enclosing a single quote within single quotes

asmilie2b3
Member Posts: 40
I have an issue, where I need to put a single quote ' into C/AL, but not have it read as a close/start of a string.
I am exporting a report to excel with the excel buffer. All I need to do is enter a formula of a cell to reference another one. the problem is that the other cell I need to reference is on another sheet. So in excel the formula of the cell needs to be:
='AUC00232'!G35
(AUC00232 is the name of the other sheet).
So Excell needs the ' in the start and end of the sheet name, but NAV reads it as the first one as the start of a string and it throws the error below when trying to compile:
')' should come here.
Below is the code I am using. I was sure I read perhaps on Mibuso I could use to single quotes ('') and NAV would treat that as one. Could someone refresh my memory on how to do this as darned if I can find it from searching the forum..
xlsInsertCell(xRow,xCol,TmpStr := '=''' + Customer."No." = '''!' + LcyTotCell,TRUE,FALSE,FALSE,'','');
I am exporting a report to excel with the excel buffer. All I need to do is enter a formula of a cell to reference another one. the problem is that the other cell I need to reference is on another sheet. So in excel the formula of the cell needs to be:
='AUC00232'!G35
(AUC00232 is the name of the other sheet).
So Excell needs the ' in the start and end of the sheet name, but NAV reads it as the first one as the start of a string and it throws the error below when trying to compile:
')' should come here.
Below is the code I am using. I was sure I read perhaps on Mibuso I could use to single quotes ('') and NAV would treat that as one. Could someone refresh my memory on how to do this as darned if I can find it from searching the forum..
xlsInsertCell(xRow,xCol,TmpStr := '=''' + Customer."No." = '''!' + LcyTotCell,TRUE,FALSE,FALSE,'','');
0
Comments
-
You'll have to use 2 times the ' character to get one ' character in your output.
Try thisMESSAGE('%1','=''AUC00232''!G35');
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Hello Luc,
Many thanks for answering my trivial question. You are of course correct.
What I needed was in total 3 quotes:
xlsInsertCell(xRow,xCol,'=''' + FORMAT(Customer."No.") + '''!' + LcyTotCell,TRUE,FALSE,FALSE,'','');
Bruce Anderson0 -
generally when u deal with apostrophe
u replace the the single quote(')
with ('').
More about....handling single quotes
Antonio
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions