Excel Buffer + Formula

taher.bha
Member Posts: 48
Hi all,
Am trying to export Some data to excel using excel buffer. I cannot find out how to export a formula. Can anyone give me some code lines to do this ?
I already searched Mibuso for this matter, this question was already posted but i can't find any real answer.
To be a little bit clearer am trying to export an invoice line's "unit price" into excel and calculate the LCY price by multiplying the line's unit price by the Header's Currency Factor
Am using the following code to export data as it is :
Am trying to export Some data to excel using excel buffer. I cannot find out how to export a formula. Can anyone give me some code lines to do this ?
I already searched Mibuso for this matter, this question was already posted but i can't find any real answer.
To be a little bit clearer am trying to export an invoice line's "unit price" into excel and calculate the LCY price by multiplying the line's unit price by the Header's Currency Factor
Am using the following code to export data as it is :
ExcelBuf.AddColumn("Sales Invoice Line"."Unit Price" ,FALSE,'',TRUE,FALSE,TRUE,'');Another solution would be to make Nav do all the job, but i'd like to see Excel in action

0
Comments
-
I would probably do it on the fly
SalesInvHeader.GET("Document No.");
var_LCYPrice := SalesInvLine."Unit Price" * SalesInvHeader."Currency Factor";
(or whatever the formula is)
You are going to have all the info needed to export available already so 1 more calculation isn't such a big deal.
Then export the var_LCYPrice.0 -
Just as a suggestion since Nav's Excel export method is rather slow when it comes to even small to moderate sized exports. (since they use a Cell by Cell algorithm)
Check out a little something I have managed to whip up...
(Sure you may spend a little more time creating some code but the overall efficiency and performance is unequivocal)
http://www.mibuso.com/forum/viewtopic.php?t=26657
[One of these days I will create a codeunit with all the user friendly procedures to create a fast Excel export]0 -
Take a look at report 82 and EnterFormula function.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