NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resize a picture in a Testreport?

Solved!
Go to solution

Hello

for the testreports I am using TS 2020 with the stylesheet "TR6_Expand.xsl" from NI. Now I generate a picture in LV which is used in the generated report - so far so good. What I see in the generated xml or pdf report is a picture which is has a different width as I would like to have. Changing of the picture in LV was not the solution. Below is an example how it looks like:

 

Graph.png

 

Questions:

  • How can I change the width size of the graph that it has the same width as the report (red rectangle)?
  • Can I center the graph inside the report?

 

Thanks!

0 Kudos
Message 1 of 3
(1,037 Views)
Solution
Accepted by topic author Norick17

From what I remember, inserting images into reports uses an HTML string to instruct the report generation plugin how to handle the picture.

I did a quick test, and found that I could make the image take up the full space of the report by setting the width style to 100%

 

My actual Post-Expression string:
Step.Result.ReportText = "<IMG ALT = 'test' src='test.jpg' style='width:100%;'>"

 

I presume you could also use similar HTML formatting tags to center your image as well, using class='center' in your ReportText HTML string

 

JorrEl_0-1665755942379.png

 

Jorr-El
Systems Engineer
Testeract: Automated Test Specialists
0 Kudos
Message 2 of 3
(1,002 Views)
Hello, thanks for your answer - it works!
0 Kudos
Message 3 of 3
(961 Views)