LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Format spreadsheet file

Solved!
Go to solution

For some reason, the write to spreadsheet function is giving me problems.

If I input a 1D or 2D array of ints or dbls or sgls, I can format the spreadsheet as %3f or whatever I need it to be.

 

I wanted to have headings above the columns, so I made an array of strings.

I changed the 2D array of DBL to decimal strings, and used build array to add the strings in the first row.

 

What do I need to wire to 'format' in the write to spreadsheet function to not get an error.
I tried %s and it doesnt work.

Cory K
0 Kudos
Message 1 of 9
(2,988 Views)

Cory K wrote:

"is giving me problems"

"to not get an error."

"it doesnt work."


What kind of problems? What error? What doesn't work? Did you change the polymorphic version of the Write To Spreadsheet File to be the string version since you're using strings?

0 Kudos
Message 2 of 9
(2,984 Views)

smercurio_fc wrote:
What kind of problems? What error? What doesn't work? Did you change the polymorphic version of the Write To Spreadsheet File to be the string version since you're using strings?

Once I have my array (of strings) I try to wire it to the '2D array' input. LabVIEW then shows the wire as broken, as it should.
The error is a data type error, telling me that I input a 2D array of strings, and it wants a 2D array of Singles.

 

I'm just not sure what to wire to the 'format' input to make the function accept an array of strings.

Is that what you referred to as "changing the polymorphic version .... to the string version" ?

If so, could you please tell me how this is done?

Thanks for your help smercurio

Cory K
0 Kudos
Message 3 of 9
(2,982 Views)
Solution
Accepted by topic author Cory_K
Yes, that's what I'm referring to. The Write to Spreadheet File is a polymorphic VI, and the DBL version is the default one you get. To select another variant right-click on the VI icon and select Visible Items->Polymorphic VI Selector. This will display the polymorphic selection menu right below the VI. Click on this and select the "string" variant.
Message 4 of 9
(2,976 Views)

smercurio_fc a écrit:
Yes, that's what I'm referring to. The Write to Spreadheet File is a polymorphic VI, and the DBL version is the default one you get. To select another variant right-click on the VI icon and select Visible Items->Polymorphic VI Selector. This will display the polymorphic selection menu right below the VI. Click on this and select the "string" variant.
... or go a few lines below and select directly the variant 😉

 

Message Edité par chilly charly le 01-23-2009 08:14 PM
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 5 of 9
(2,973 Views)
Yeah, that works too. Smiley Very Happy
0 Kudos
Message 6 of 9
(2,970 Views)

Is this possible in 7.1?
I right clicked, went to visible items, and didnt see 'polymorphic vi selector'.

Is there a different method in this version?

Cory K
0 Kudos
Message 7 of 9
(2,878 Views)
No, that's not possible in 7.1 because that VI was not polymorphic in 7.1. In 7.1 you have to save the VI under a new name and change the controls and code. If you look at the front panel/block diagram it explains what you need to change.
Message 8 of 9
(2,876 Views)

Thanks smercurio, that worked perfectly.

Too bad I cant choose 2 different solutions :

A 7.1 solution and an 8.x solution.

Message Edited by Cory K on 02-04-2009 02:45 PM
Cory K
0 Kudos
Message 9 of 9
(2,862 Views)