NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

add to header without altering model

I cant seem to find a way to alter the header (adding result-lines in addition to Operator, S/N and such) without having to alter the reportgen_html.seq. Since other testsequences on the concerned station uses this sequence I cannot alter it. Is it possible to do this in a different manner?
0 Kudos
Message 1 of 6
(4,747 Views)
Howdy Long number with a kk at the end,
 
So there is a callback called ModifyReportHeader for exactly what you are doing.  To insert this callback into your sequence go to Edit->Sequence File Callbacks and look for ModifyReportHeader.  Click on it and click the Add button.  Then click OK.  Now you will see a new sequence in your sequence file.  It is being passed a parameter called Report Header.  You can add to the report header by having a statement in this sequence that looks something like this:
 
Parameters.ReportHeader += "Some HTML Stuffs here"
 
To overide the Header completely do this:
 
Parameters.ReportHeader = "<br>some HTML Stuffs here<br>Hello Crazy World<br>"
 
Only read this part if you aren't familiar with Callbacks.  Basically a callback is a function, Sequence, whatever.  that gets called instead of what is normally called.  In this case the Process Model has a call to a sequence called Modify Report Header.  This sequence is inside the process model.  If you add the callback to your sequence (The Client Sequence) the process model automatically calls that one instead of the one that resides within itself.  Therefore you get to change the process model without affecting other people.
 
Let me know if you have any questions,
 
 
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 6
(4,738 Views)

Hi Jigg !

You are faster than speed of light !
While i was writing an example you have posted! Good answer 5 !

Ok. Same solution but with an example

Juergen

 



Message Edited by j_dodek on 03-31-2008 03:31 PM
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 6
(4,730 Views)
I've used the modify report header with the html report generation.  Can this callback be used with XML reports too?  I remember thinking that modifing HTML reports was much easier when I first looked into modifying the report.
0 Kudos
Message 4 of 6
(4,699 Views)
This is doable.  It is not supported by NI however.
 
What you will have to do is modify the stylesheet to be able to handle your new header property.  Then you can add the property the same way that you  did with HTML.  So a couple things you need to understand here:
XML and stylesheets.  If you don't know those and aren't willing to learn them then forget about attempting this.  Otherwise, it's just pretty straight forward XML. 
 
One thing you can do is but a breakpoint in your Modify Report Header sequence and change your report to be xml.  Then when you get to that breakpoint look at Parameters.ReportHeader.  You will see a huge string with a whole bunch of xml tags.  You will have to add your new property to this string. 
 
If you just want to modify an existing property then it will be a lot easier.  Because you won't have to change the stylesheet at all.  In order to modify an existing property  then look at the string like I told you before and then you'll have to parse it and change the value tag for that property to be what you want. 
 
For a good tutorial on XML look here: http://www.w3schools.com/xml/default.asp
 
For a good tutorial on Stylesheets look here: http://www.w3schools.com/xsl/xsl_languages.asp
 
Regards,


Message Edited by ~jiggawax~ on 04-01-2008 11:09 AM

Message Edited by ~jiggawax~ on 04-01-2008 11:12 AM
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 6
(4,692 Views)
Hi
Thanks for the quick response!
What I didn´t realize was that one could exclude the default header in order to make an completely custom one.  And my first attempt looked like crap cause, well, I didnt get the HTML stuff. But thanks to your tips, its looking just fine now!


Thanks again!

/7879870kk

a.k.a. Magnus
0 Kudos
Message 6 of 6
(4,677 Views)