Excel buffer ReadSheet() Ignore commas!!

Arturo
Member Posts: 30
Hello!
I have a problem loading a excel file to Nav. When I run the process manually everythink works fine, but when i use Powershell (as scheduled task with no user inteface) the process loads de decimal values with no commas.
If the value is 382,89 it load's 38289 to nav record.
Any idea how to solve this?
Thanks!
I have a problem loading a excel file to Nav. When I run the process manually everythink works fine, but when i use Powershell (as scheduled task with no user inteface) the process loads de decimal values with no commas.
If the value is 382,89 it load's 38289 to nav record.
Any idea how to solve this?
Thanks!
0
Comments
-
Make sure your automated Task uses the right locale. It's currently using one that uses comma as a thousands separator.0
-
Thanks for your answer!
I alredy check that (the problem persists even if I launch the task from powershell, with no task scheduler).
As you say i think that the problem is the locale, but the question is how I set the locale for excel if I'm not using any user interface?? I have been looking for a while for this, but nothign0 -
I tried to launch the task on a windows server with a windows spanish version, wich have a comma as decimal delimiter as default, i also check the international key on the winodws register, and the decimal separator is ok. Even like this, the scheduled task with no user interface keeps using the english decimal setup, ignoring the commas....0
-
Any ideas?
The Nav job queue is always hanging or failing... I really need to use power shell to launch my excel scheduled processes.0 -
Do I recall..
In functions as "format", "validate"... there is an option "9" for XML.
Take a look...Regards
Christer in Stockholm, Sweden0 -
Rikt-It wrote:Do I recall..
In functions as "format", "validate"... there is an option "9" for XML.
Take a look...
Thanks for your answer but still nothing. The problem is not Nav, is excel. If excel removes the commas on open it doesn't matter wich regional setup Nav uses to load data, the information is alredy lost, commas or points.
I will keep searching.
Regards0 -
Arturo wrote:The problem is not Nav, is excel.
How did you verify this?
What kind of "Excel file" do you actually have? is it a .csv, an .xls, a .xlsx or anything else? Does the actual file content match the extension?
How do you actually use Powershell in the process?
By what means do you read the excel cell values? Do you use NAV's Excel Buffer? Which version?0 -
Hi,
Thanks again for you time.
It's a xlsx file, i' m using powershell for launching tasks for multiple tenants/DBs with bucles and some other stuff.
And yes, i'm using excel buffer:
ExcelBufAux.SETRANGE(ExcelBufAux."Column No.",3);
IF ExcelBufAux.FINDFIRST THEN
Decimal := ExcelBufAux."Cell Value as Text";
I asume that Excel is the problem cause if i load same values from an another file type, .txt or something everything works perect, even launching tasks with no user interface using powershell.
And if i schedule the excel task using the NAV Job queue, everithing is correct because uses the NAS service loggin account and applies the ruser regional setup.
I fear that is an Excel bug, i searched and tried for a long time with no results.
Thanks again 4 your answer!
Regards.0 -
Finally I found the solution!
Before calling the report wich opens the excel (excelbuffer.openbook), i set the following parameters:
dnGlobalization := dnGlobalization.CultureInfo('es-ES');
dnThread.CurrentThread.CurrentCulture := (dnGlobalization);
And the Dotnet Variables used are:
dnThread DotNet System.Threading.Thread.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
dnGlobalization DotNet System.Globalization.CultureInfo.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Regards.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