NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Str function not working

Solved!
Go to solution

I am using an post-expression in an additional results step type step to add a comment in my report as below.

 

Step.Result.ReportText = Str("A", "Mode: % 50s", True). While executing if i see the resultlist variables the step output is 50 characters aligned. But when i see the report at the end of the execution the output is simply "Mode: A" with 50 characters alignment.

 

Pl let me know where i am doing mistake.

 

regards,

ramjee v

0 Kudos
Message 1 of 8
(4,349 Views)

I dont have TestStand to hand, but dont you need a second boolean to say use formated  string.

eg str("A", "Model %50s", false, true)

 

regard

ray farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 8
(4,343 Views)

Hi,

 

When i run as per the above comment, getting error say that "Error in argument 3, 'False', in call to the expression funcrtion 'Str'.

 

Pl let me know how shall i proceed.

 

Regards,

Ramjee

0 Kudos
Message 3 of 8
(4,336 Views)

sorry, parameter 3, <decimalPointOption>, is probably not a boolean I suggest you check the help to see what is a  valid entry.

 

regards

ray farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 8
(4,331 Views)

When I ran your statement using a TEXT report I got the following:

 

Mode:   < 50 spaces> A

 

You are generating a text report, right?  Is that what you were expecting?

 

PH

0 Kudos
Message 5 of 8
(4,326 Views)
Solution
Accepted by topic author ramjeev
Going along with what Teds said - if you use HTML/XML/ATML reports, your browser will likely render the report text with only one space. To pad a field in a browser-compliant manner, use &nbsp; instead of a space.
0 Kudos
Message 6 of 8
(4,317 Views)

hi Asbo,

 

I am using html report.

 

What is nbsb stands for in html report generation?

 

regards,

ramjee

0 Kudos
Message 7 of 8
(4,299 Views)
"&nbsp;" is rendered as a non-breaking space.
0 Kudos
Message 8 of 8
(4,276 Views)