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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Image attachment in teststand report header from teststand

Hi,

 

Teststand version : 4.2

XSL for report generation: expand.xsl

I wanted to attach an image to the report header generated by teststand from teststand instead of hard coding it in the XSL sheet as specified/explained in user manual.

Can anyone help me in this regard.

 

Advance thanks

Surya.

 

0 Kudos
Message 1 of 17
(4,348 Views)

Surya,

 

One option for adding an image to the test stand Report Header is to use the "ModifyReportHeader" callback and changing the "ReportHeader" parameter. The ReportHeader parameter gives you access to the XML code generated, which you can modify to add the image tags. However, TestStand in itself does not allow you to easily manipulate that XML file to add in the images. You can parse the generated XML codeusing an external code module, add the necessary tags for adding an image, since this cannot be easily done from within TestStand. 

 

We do strongly suggest using the XSL stylesheet method mentioned in the help as it has been more thoroughly tested. Even though the image location itself is being hardcoded in that sheet, the data is being dynamically generated by TestStand each time. 

Raj
National Instruments
Applications Engineer
0 Kudos
Message 2 of 17
(4,324 Views)

We have a custom report generation and we use relative stylesheet path as we wanted to open the reports even from remote location or any PC.

For one seqeunce we have more than one report being generated at two different locations. We were planning to add a logo at the report header and wanted to place that logo image in stylesheets folder. As we have more reports being generated, hardcoding the image path is not going to work because if we move the reports folder to a PC which does not have teststand installed, user need to copy image folder for one single image along with the reports folder which we are not willing to do.

 

Thank you for the inputs.

 

Surya.

 

0 Kudos
Message 3 of 17
(4,316 Views)

Surya,

 

a few questions to clarify your application.

 

1.) What exactly do you mean when you say you use relative stylesheet path? Do you change the first line of your XML file to point to a location for the XSL file relative to it?

2.) When you move your report files to another machine without teststand installed, do you also move your stylesheet file along with it? 

 

Raj
National Instruments
Applications Engineer
0 Kudos
Message 4 of 17
(4,303 Views)

1. In the report stylesheet path of report options we disable absolute path and give relative path.

2. yes we do move stylesheets along with the report in another PC as we want the user to give a option of opening of report in any pc any place. 

0 Kudos
Message 5 of 17
(4,299 Views)

Surya -

 

I'm slightly confused as there seems to be some inconsistency between your posts. Could you please clarify if I have misunderstood your situation in any way:

 

In the Report Options dialog, you have unchecked the Store Absolute Path box for the XML report, meaning that the XML Style Sheet (.xsl) file must reside in a path relative to the generated XML report file. You've configured it this way so that you can easily move the reports and style sheets from one PC to the other (possibly without TestStand installed), maintain the same relative paths between the XML report and the XML style sheet, and still be able to open the XML report with the style sheet applied.

 

Now, you'd like to include a logo in the header of your report. Will the same logo be displayed in the header of every report? If so, I'm not clear on what is keeping you from simply placing the logo next to the style sheet, adding it to the style sheet to be displayed in the report, and then, when moving the XML report file and style sheet from one PC to the other, simply moving the logo file as well.

 

If this is not an option, could you please provide some detail and clarification as to why? Thanks.

Manooch H.
National Instruments
0 Kudos
Message 6 of 17
(4,272 Views)

Manooch you are on the right path. Our plan was to keep the logo in the stylesheet folder and give relative path of that logo in expand.xsl.

But the issue is we create new reports for sequences which are executed parallel and keep them is a folder parallel to actual report. So we wont be able to open these reports because image path is not correct. This is the reason why we were willing for a programmatic change of image(logo) path in report header.

 

Regrads,

Surya.

0 Kudos
Message 7 of 17
(4,255 Views)
Sorry I forgot to say in the sequences which we execute parallel, we change the relative path of stylesheet programmatically in teststand by using "Report Options" callback.
0 Kudos
Message 8 of 17
(4,254 Views)

Surya -

 

I'm not sure I understand. As long as the report has the correct relative path to the style sheet and the style sheet has the correct relative path to the logo image in the header section, then when you open the report, it should be displayed using the style sheet and the logo should also be displayed.

 

Is this not the behavior you are seeing?

Manooch H.
National Instruments
0 Kudos
Message 9 of 17
(4,245 Views)
Manooch, Relative Path for the stylesheets works for us but the relative path for the logo image in expand.xsl is not working for us.
0 Kudos
Message 10 of 17
(4,221 Views)