08-05-2019 11:56 AM
I have been searching for a solution to this issue for quite a while but not able to get a good one yet. What I try to do is to write an array of text data to EXCEL with the Report generation toolkit. What makes this difficult is some such array elements are of the pattern resembling to an exponential numerical value, such as "20e00". In this particular case I would like the exact text of "20e00" withing the quotation mark to be written. However, with my simple code as attached, EXCEL sheet gets "2.00E+01" or 20 depending how I format in EXCEL. So my question is, is it possible to have some further configuration or formatting on the LabVIEW side to get output as I expect?
Thanks,
Tao
Solved! Go to Solution.
08-05-2019 01:59 PM
Use a template:
Format the cells as TEXT in Excel, and save it as template.
When Create Report in LabVIEW, use the template.
08-05-2019 02:07 PM
Try putting an apostrophe in front of values. That seems to be Excel's way of interpreting anything as text.
08-05-2019 02:26 PM
I just tried that trick before I post.
It doesn't work with the easy table.vi
08-05-2019 02:27 PM
You can also use the Set Cell Format VI with an ampersand @ as the format code. You have to do this before you add the text, otherwise Excel makes its own decision first and you lose the scientific notation.
08-05-2019 02:30 PM
@zou wrote:
I just tried that trick before I post.
It doesn't work with the easy table.vi
You have to double apostrophe it.
08-05-2019 02:37 PM
Double works; @ doesn't.
08-05-2019 02:41 PM - edited 08-05-2019 02:52 PM
@zou wrote:
Double works; @ doesn't.
Does for me.
08-05-2019 03:05 PM
> You have to double apostrophe it.
Interesting. Only one gets written into the cell.
The first one serves as an escape key?
@ works too.
08-05-2019 03:07 PM
Thanks aputman. I tried to insert that subVI that formats the output table as text by setting "@" but put it after setting table data. Swapping order of these two as you suggest actually solve the problem.