LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wired automatic number conversion during report generation

Hi,
I have a wired problem when trying to generate a report in Excel via Labview. The problem consists of wrong decimal placement. I have the numbers as double in labview and they're working fine there. But when i generate a report all numbers above one are multiplied by 1000, so Labview is somehow transforming the decimal place as a US system "thousand" mark.
-i have the international settings so that " , " is the decimal mark
-0,56 is displayed 0,56
-1,56 is displayed 1 560
-i've checked the "use computer settings" in labview
-i've tried 2 different subVIs to export the data
-writing data into XLT files which cells are put to general in the template

Another wired thing is that the cells that are displayed properly have the format "General" and are "Number stored as Text" and the cells displayed incorrectly have the format "Number".

Adding a pic of the block diagram.

Thank you for any help you can provide.
Download All
0 Kudos
Message 1 of 6
(2,561 Views)
Hi Englund,

international settings should use the '.' as decimal separator...
Are you sure it's the LabView formatting or is Excel displaying the values 'incorrectly'?

As a quick workaround: Could you try to save the values as CSV/TSV files?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,554 Views)
Ok. What i meant that my settings are using the comma "," as the decimal separator. Regional settings for the computer are put for Finland. I'm not sure which one of them has the problem, but the Excel file template is "untouched", meaning that cells have as format "General" before Labview opens and edits the files and saves them on another location.

One question, why would i like to save them as csv/tsv files. My VI is doing a measurement and calculation with the help of Excel, so i need to be able to run the VI as a subVI. That means that the VI needs to open excel and close excel and between that put in values and extract values to be able to determine is the calculation correct or not. So if there is some way to import the csv/tsv files automatically into excel then i think that solution is out of the question.

Other suggestions?
0 Kudos
Message 3 of 6
(2,551 Views)
There are three settings for international operation in Windows. You need to set the locale, the code page and the default input method. These are all tabs on that control panel. Set all of these to your language. The report tool kit will use the windows clip board in some instances to transfer data to the end user document. The default input method affects this operation because the clipboard is a unicode enabled program.
Message 4 of 6
(2,540 Views)
Ok, thanks. I can change everything but the code page. Can't get into the advanced tab under the regional settings. Not admin rights, so i have to get back to the problem when i have the admin rights. But it still feels wired because the values under 0 is transfered properly and I can't even write 0.23 (meaning the point) in Labview, so it could be a clipboard problem.

Thanks trying to solve the admin rights problem.
0 Kudos
Message 5 of 6
(2,535 Views)
I figured out anohter solution for my problem.
I made a macro inside each excel file, which checked if the value was over 1 and after that divided that value with 1000.
Is there any way to perform this kind operation without running a macro? Macro requires the sequrity settings to be changed for Excel.
0 Kudos
Message 6 of 6
(2,513 Views)