LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write special text to EXCEL using report generation toolkit

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 10
(3,249 Views)

Use a template:

Format the cells as TEXT in Excel, and save it as template.

When Create Report in LabVIEW, use the template.

 

George Zou
0 Kudos
Message 2 of 10
(3,210 Views)

Try putting an apostrophe in front of values.  That seems to be Excel's way of interpreting anything as text. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 10
(3,205 Views)

I just tried that trick before I post.

It doesn't work with the easy table.vi

 

George Zou
0 Kudos
Message 4 of 10
(3,195 Views)
Solution
Accepted by topic author stevensung

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.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 10
(3,195 Views)

@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. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 6 of 10
(3,191 Views)

Double works; @ doesn't.

 

George Zou
0 Kudos
Message 7 of 10
(3,188 Views)

@zou wrote:

Double works; @ doesn't.

 


Does for me.  

Write to EXCEL_BD.png

2019-08-05_14-39-48.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 8 of 10
(3,183 Views)

You have to double apostrophe it.

Interesting. Only one gets written into the cell.

The first one serves as an escape key?

@ works too.

 

George Zou
0 Kudos
Message 9 of 10
(3,168 Views)

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.

0 Kudos
Message 10 of 10
(3,164 Views)