07-13-2009 03:35 PM
Hi Folks,
I have regular HTML report from TestStand 4.2; particularly i want to change the header from "Station ID" name to "Test Bench ID" name.
Can anyone help me on this...?
Thanks for your help...!!!
SB_LV
07-13-2009 04:07 PM
Here are just 3 options:
1- Probably the easiest and best option. Open this file: C:\Program Files\National Instruments\TestStand 4.2\Components\Language\English\ModelStrings.ini. Search for RPT_HEADER_STATION_ID. Replace the Station ID in the quotes with Test Bench ID:. The ModelStrings.ini is a resource strings file that contains a bunch of basically "global values" that TS references.
2- If you don't want to change your resource strings then open this sequence file: C:\Program Files\National Instruments\TestStand 4.2\Components\Models\TestStandModels\reportgen_html.seq. Open the sequence in there titled- AddReportHeader. Find the step named- Add Station ID. It should be a statement step. In the Expression replace ResStr("MODEL", "RPT_HEADER_STATION_ID") with "Test Bench ID:". This directly edits your process model and every sequence ran on the machine will see the change.
3- Add the Modify Report Header callback to your sequence file. In there you will have ot search the Parameters.ReportHeader string for Station ID: and replace it with Test Bench ID. This will not affect the process model.
Hope that helps,
07-13-2009 05:24 PM
Hi Jigg,
Thanks for the reply.
I'd like to go for the 3rd option. Where do i get the "Modify Report Header" call back sequence...? Can you provide me the location...?
Thanks for the Help...!!!
SB_LV
07-13-2009 05:31 PM
Open the Sequence File you want to add the callback to.
Edit>>Sequence File Callbacks. Then click on ModifyReportHeader. Click Add. Click OK.
Now you should see a green sequence in your file called ModifyReportHeader. Open it and add a statement step. Put the following in as the Expression:
Replace(Parameters.ReportHeader, Find(Parameters.ReportHeader, "Station ID",0,False, False), 10, "Test Bench ID")
That should do the trick. You can play with that however you'd like as you can see.
Most callbacks in TS have parameters that you can modify.
Regards,
07-13-2009 05:34 PM
One more thing: make sure On-The-Fly reporting is unchecked in the Report Options as this will not work this way.
Regards,
08-30-2011 01:23 PM - edited 08-30-2011 01:24 PM
Ignore this it is for a different post:http://forums.ni.com/t5/NI-TestStand/how-to-edit-station-id-value/m-p/1688734/highlight/false#M34304
OK got it:
Place a Statement step in your sequence and put the following in there:
RunState.Root.Locals.StationInfo.StationID = Locals.MyModifiedMachineName
06-12-2012 10:05 AM
I changed the file horizontal.xsl (C: \ Program Files (x86) \ National Instruments \ TestStand 4.2.1 \ Components \ Models \ TestStandModels \ StyleSheets \ horizontal.xsl) .... look <b> Station ID </ b > Station ID and change the name you want .... but under Station ID shows the name of the computer ... Is there a way to change the content by modifying the file. xsl? Thanks for any replies
06-13-2012 02:21 PM
Hi,
I am guessing that changed the header "Station ID" but not the contents below it. There are a few things you need to change in the xsl file and in TestStand.
1. Add ModifyReportHeader Sequence File Callback to your sequence file.
2. Create a local variable. Store the information you want to show up under Station ID here.
3. Add a function statement with the following expression:
Parameters.ReportHeader += Locals.Local Variable Name.GetXML(XMLOption_NoOptions, 0, "Local Variable Name", Parameters.ReportOptions.NumericFormat)
Note: If your local variable is a type other then numeric, you will need to change the last parameter for "GetXML".
4. In the XML file, change everywhere you see "Prop[@Name='StationInfo']/Prop[@Name='StationID']" to Prop[@Name='Local Variable Name'].
5. Also, change <xsl:template match="Prop[@Name='StationID']"> to <xsl:template match="Prop[@Name='Local Variable Name']">
This should put the data under StationID.
I would recommend you make a copy of horizontal.xsl file and make changes to the copy and not the original file.
06-18-2012 02:50 AM
Hi Rohama,
I followed all your steps but under Station ID I'm writing what I write in UUT serial number. See attached
06-18-2012 12:51 PM
Do you see a shift in everything you are now seeing in the header? Attach a screenshot of the step you added to ModifyReportHeader and the local variable you created to store the information you wanted to see under Station ID and your XML file.