From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with 'Word edit cell.vi' , Inputs transduced with the value of every row repeated

Hello,

 

Im using LV2013 with office 2013 report tool kit. I am trying to use Word edit cell to input values in table previously created in template .doc.

 

Indeed, i trying the example Generate report from template and didnt works well. I search for solution and I see it was a problem with previous version but it seems not solve totally in this version for word office 2010. 

 

http://digital.ni.com/public.nsf/allkb/4041ECB5D02BA57D862579A00002FE8D

 

I checked this thread but i didnt get it to works. http://forums.ni.com/t5/LabVIEW/Problem-with-append-table-and-Word-2010/m-p/2190960#M702610

 

Any way to solve it?.

Thanks for help.

Fred

 

Download All
0 Kudos
Message 1 of 4
(2,724 Views)

Hello, I solve it adding this to Word_insert_Table.

http://forums.ni.com/t5/LabVIEW/Report-Generation-MS-Word-Table-Bug/td-p/1605170

Thanks.

 

 

Open [LabVIEW installation folder]\vi.lib\addons\_office\_wordsub.llb\Word_Insert_Table.vi

There is a nested for loop that interprets the provided string array data and reformats it into a long ASCII string for the copy buffer. It should look like this:

NIreporttoolkitorig.jpg

 

Change the nested loop to look like this:

NIreporttoolkitnew.jpg

 

The changes I've made are twofold:

1. Within the inner loop, replace the "\n" char with a Tab character

2. Just after the inner loop, add a new "concatenate strings" function that adds "\n".

0 Kudos
Message 2 of 4
(2,713 Views)

Hi folks,

 

I need to add images and text data to the particular cell of the table.

I used word edit cell to append data to the cell. But it overwrites the data and only the last value remains.

I have attached the vi with this.

 

Thanks in advance!

 

Best regards,

Shree

0 Kudos
Message 3 of 4
(2,479 Views)

shree_bala a écrit :

Hi folks,

 

I need to add images and text data to the particular cell of the table.

I used word edit cell to append data to the cell. But it overwrites the data and only the last value remains.

I have attached the vi with this.

 

Thanks in advance!

 

Best regards,

Shree


Word Edit Cell.vi uses the cell range text property so when you use it again on the same cell it overwrite it. Is there a specific reason why you don't write all the cell text at once? Then you can add the picture..

 

What you're asking is very specific and can't be accomplished using only the Report Generation Toolkit vis, you will also have to use some ActiveX methods and properties if you can't insert all the cell text at once.

 

Using only the RGT vis you can add the picture to a cell without overwriting its text content but the picture will be placed before the text (at the range start position).

 

To insert it after the text you need to move the cell range start to the next character formatting (set wdUnits input of the Range.Move.Start method to 13) which is tthe end of cell character.

 

You can have a look at the code inside Word Edit Cell.vi in the text and picture case to get an idea on how to use ActiveX methods and properties. In the Word Advanced palette there is a vi called Get ActiveX references , you will have to use it to get the references to the InlineShapes and Tables collections references.

 

Ben64

0 Kudos
Message 4 of 4
(2,455 Views)