How to use Excel Alignment with DotNet variable
Bogdan_UA
Member Posts: 15
Hello!
I try to understand how to use variable with DataType DotNet, when we create export to Excel.
Rather, what we can use instead this code, etc.?
XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := -4108; //Center
XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := -4131; //Left
XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := -4152; //Right
Maybe someone did it.
Thank you!
I try to understand how to use variable with DataType DotNet, when we create export to Excel.
Rather, what we can use instead this code, etc.?
XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := -4108; //Center
XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := -4131; //Left
XlWrkSht.Range(xlColID + xlRowID).HorizontalAlignment := -4152; //Right
Maybe someone did it.
Thank you!
0
Comments
-
Hi, I suppose you are running NAV 2013: the main difference with previous version is that inside Excel Buffer table Excel .NET interoperabilities are used, which "wrap" standard functions. So, not all Excel features are available to use but only those ones published through .net interop.
My solution was create a custom copy of Excel Buffer working with OpenXml (I followed this article), which can be expandend with all the features needed.
Hope it helps.* Daniele Rebussi * | * Rebu NAV Diary *0 -
Yes, I am use NAV 2013 R2.
I thought that we can use this function with DotNet:(
I hope Microsoft implement it in NAV 2014:)
It helped. Thank you for answer!0 -
Hi geordie!
Can you please explain a little more about aligning text working with OpenXml?
I do not know even how to start
0 -
Hi, I think you can refer to the exhaustive posts of Kauffmann and Gunnar for an complete explanation. Basically you need to:
* Download and deploy the ClosedXML dll.
* Replace in the code the references of variables XlWrkBk, XlWrkSht, XlRange, etc...
* Upgrade the code interface with these new DotNet components.
* Add a new field in Excel Buffer table to be managed in CreateSheet function in order to set cells alignment.
Hope it helps!* Daniele Rebussi * | * Rebu NAV Diary *0 -
So it seems using ClosedXML is general approach when nice excel is needed.
And, as a developer, if I want to use it, I must convince my customer to install this tool on their server.
Ok, understood.
Thank you geordie!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
