Excel buff Want to export numbers as numbers in Excel

SPost29
Member Posts: 148
I want to have the numbers I export to Excel using the Excel buffer table to be numbers
when I open Excel.
I currently get "The number in this cell is formatted as text or preceded by an apostrophe"
Then there is a process I can choose: 'Convert to Number'
I want it to convert to number automatically so my users or I don't have to mess with it manually.
How can I get my exported numbers to be numbers?
Thanks
Steve
when I open Excel.
I currently get "The number in this cell is formatted as text or preceded by an apostrophe"
Then there is a process I can choose: 'Convert to Number'
I want it to convert to number automatically so my users or I don't have to mess with it manually.
How can I get my exported numbers to be numbers?
Thanks
Steve
0
Answers
-
Hi Steve,
How are using the Excel Buffer table?
Set the NumberFormat or set the last agrument on the AddColumn function as per formating a cell in Excel0 -
Hi Dave,
Thanks for your response
I am using on the OnPreSection of a report
EnterCell(RowNo,10,FORMAT("Outstanding Amount"),FALSE,FALSE,'@'); // for numbers
EnterCell(RowNo,3,"Vendor Item No.",FALSE,FALSE,''); // for textEnterCell(RowNo : Integer;ColumnNo : Integer;CellValue : Text[250];Bold : Boolean;UnderLine : Boolean;NumberFormat : Text[30]) ExcelBuf.INIT; ExcelBuf.VALIDATE("Row No.",RowNo); ExcelBuf.VALIDATE("Column No.",ColumnNo); ExcelBuf."Cell Value as Text" := CellValue; ExcelBuf.Formula := ''; ExcelBuf.Bold := Bold; ExcelBuf.Underline := UnderLine; ExcelBuf.NumberFormat := NumberFormat; ExcelBuf.INSERT;
This all works fine except:
This gives me the "The number in this cell is formatted as text or preceded by an apostrophe" message in Excel
Thanks
Steve0 -
Hi Steve,EnterCell(RowNo,10,FORMAT("Outstanding Amount"),FALSE,FALSE,'@'); // for numbers0
-
One tip that I found useful is when you want to accomplish something in Excel in C/AL code, is to turn on the macro recorder in Excel. Then do what you want to do, and look at the VBA that the macro recorder generated. Usually that translates almost directly into C/AL. I know formatting works that way, I've done something with that in the past.0
-
Thanks to both of you. That will do it.
Steve0
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