From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Set the cursor position of the current added text (to make the part of text in subscript) in WORD using Report Generation Toolkit

Solved!
Go to solution

 

I would like to generate a report in WORD using Report generation tool kit.

Whenever a text is added to the report, program should make a part of text in subscript. The problem I am facing is to set the cursor position to the current text location.

Any suggestions?

 

 

0 Kudos
Message 1 of 7
(5,438 Views)
Solution
Accepted by topic author nik35324

Hello!
I think this is what you wanted (see attachement).

Firstly, you need to set position for each for loop, so after adding the table, your cursor index need to increase by the number of characters added. That's why I included Append Report Text - to get the cursor position at the end. 

Indexing starts with 0, so you need to set them 3 and 7.

Hope you get what I mean 

0 Kudos
Message 2 of 7
(5,415 Views)

 

Thank you for the solution.

 

I made few changes. Please find the attached files.

Download All
0 Kudos
Message 3 of 7
(5,400 Views)

What are the attached files for? Is it what you're expecting to be?

0 Kudos
Message 4 of 7
(5,386 Views)

If so, try this version.

Within an array in word_Subscript.vi you define the ranges for each element from array of string. Therefore for your application it should go 1,2,4,7, and the second row also 1,2,4,7.

Message 5 of 7
(5,376 Views)

@AdamTrojak wrote:

If so, try this version.

Within an array in word_Subscript.vi you define the ranges for each element from array of string. Therefore for your application it should go 1,2,4,7, and the second row also 1,2,4,7.


You need to offset with the value of the current position. In your code you are just resetting to subscript the characters you have subscripted (if this english?) at the first iteration. Here's how to do it.

 

Ben64

0 Kudos
Message 6 of 7
(5,345 Views)

I didn't look at the latest reply from Adam before sending my post, the use of Append Report Text.vi to get the end position is way better than what I used.

 

Ben64

0 Kudos
Message 7 of 7
(5,336 Views)