LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP - Report generation toolkit - excel - autosize columns dimension

Hello,

 

I have another question...i would (i don't know if it is possible) autosize the column dimension...see the string inside the cell and size the cell to make possible read the string without problem. (in excel is possible do it double-clicking on the top level of the column)

 

i see there is a vi to set the dimension (inch or cm)...but i don't know the max dimension..

 

there is a way to solve my little-big problem? 

Thank you 🙂

0 Kudos
Message 1 of 12
(4,446 Views)

Hi,

 

I suppose it would work like in this example: Autofit

But you would have to get the reference to the file from somewhere. I'll try it out and get back to you.



Remember Cunningham's Law
0 Kudos
Message 2 of 12
(4,442 Views)

Just as I suspected (with the distinction that we're using ActiveX and not .Net)

AutoFit.png 



Remember Cunningham's Law
Message 3 of 12
(4,434 Views)

and if i want autofit just 1 column? 🙂 there is a way to do that? 🙂

0 Kudos
Message 4 of 12
(4,420 Views)

@Gianluca1985 wrote:

and if i want autofit just 1 column? 🙂 there is a way to do that? 🙂


Yes, but it's a little bit more tricky. This following example will autofit the C column.

 

Excel Autofit Single Column.png

 

Ben64

Message 5 of 12
(4,398 Views)

I couldn't get that to work yesterday since I didn't know what the Cell Input had to look like...

Also: Having to use a completely different class, to do something slightly different seems redundant to me. I don't want to talk badly about the Office activeX connection, since it has been good to me, but this seems odd.



Remember Cunningham's Law
0 Kudos
Message 6 of 12
(4,377 Views)

PeterFoerster a écrit :

I couldn't get that to work yesterday since I didn't know what the Cell Input had to look like...

Also: Having to use a completely different class, to do something slightly different seems redundant to me. I don't want to talk badly about the Office activeX connection, since it has been good to me, but this seems odd.


I agree it seems odd. From what I understang the Autofit method works only on columns and rows type range and will fit all the columns (or rows) in the selected range. So I had to select a worksheet range that is a single column and "convert" it to the more specific columns type class.

 

Ben64

0 Kudos
Message 7 of 12
(4,368 Views)

hello...thanks...but in my program doesn't work 😞

 

i have done as in figure...could you tell me where i have make mistake please?

 

x NI.jpg

0 Kudos
Message 8 of 12
(4,355 Views)

Look at your wiring between Range:  Columns and Range:  Autofit

 

Ben's screenshot is also a VI snippet which lets you drag and drop the image to a block diagram to get real code in a VI.

Message 9 of 12
(4,350 Views)

IT WORKS!!! 😄 thanks to all!!!!!!! you have made a man happy!

0 Kudos
Message 10 of 12
(4,340 Views)