NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

insert text into text

Hello,

 

I want to add some text in the reportheader.

I enabled "themodifyreportheader" callback and then I want to add extra text in the "parameters.reportheader".

 

What is the easiest way to add a string, for example " into the existing "parameters.reportheader"?

 

<tr><td class='hdr_name'><b>Product name: </b></td><td class='hdr_value'><b>MDU special</b></td></tr>

 

gr,

Bart

0 Kudos
Message 1 of 3
(4,226 Views)

What kind of report are you generating?  HTML, XML, Text etc...?

 

You can use the Find() function and the Replace() function to accomplish what you want.  It all depends on where you want to insert it in the header.

 

Replace(String string, Number startIndex, Number numCharsToReplace, String replacementString)

 

Find(String string, String stringToSearchFor, Number indexToSearchFrom = 0, Boolean ignoreCase = False, Boolean searchInReverse = False)

 

Use the Find function to determine the startIndex in the Replace function.  Set the numCharsToReplace to 0.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 3
(4,215 Views)

Hi Jiggawax,

 

Thank you for your reply.

I was hoping for a more elegant sollution.

 

I now use the Split() function, set the delimiter to "\n".

Next I can insert a string between any row.

This is all put in a sub sequence.

 

gr,

Bart

 

0 Kudos
Message 3 of 3
(4,203 Views)