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.
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.
04-04-2010 09:31 AM
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.
04-05-2010 01:01 PM
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.
04-05-2010 02:06 PM
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.
04-05-2010 06:25 PM
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?
04-05-2010 10:39 PM
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.
04-06-2010 11:39 AM
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.
04-07-2010 10:20 AM
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.
04-07-2010 10:24 AM
04-07-2010 02:37 PM
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?
04-08-2010 09:41 AM