Discussion:
How to reflect local variable value in Report heading
(too old to reply)
Vidula S.
2008-08-13 19:10:17 UTC
Permalink
I have variable Locals.a = 10;  My sequence is having 11 steps where every step does the necessary changes to locals.a, my report reflects only10 result.In 11th step I am doing some more calculations, but I don't want to display this step in report hence the Run Options for that step is set to do not record result. But the end result of that calculation I want to display in header. I can see that variable at RunState.ProcessModelClient.Data.Seq["MainSequence"].locals.a but the value is always default. Is there any way to access that variable in reportgen_html.seq file? Thanks in advance,Vidula
~jiggawax~
2008-08-13 21:40:11 UTC
Permalink
It most likely doens't exist with anything except the default value at that point in the execution because you are past calling the client sequence and any of the variables are runtime variables that get destroyed once execution for that scope is complete.   If you want it in the header here's what I do:Save it as a FileGlobal instead of a Local  Or at the end of your sequence assign it to a File Global.Add the Modify Report Header callbackPlace an expression step in there that looks something like this: Paramters.ReportHeader += "My Variable name = " + Str(FileGlobals.MyGlobalVar)  You can play around with adding html tags and stuff to your string and formatting but that's the general idea. This is just one way that seemed simple to me. Later,
Chris_G.
2008-08-14 17:40:15 UTC
Permalink
Hello All,
Thank you both for posting on the NI Discussion Forums.  ~jiggawax~, you have a good method of going about this.  For those who are not aware, to add a ModifyReportHeader callback to your client sequence file, you must right-click in the sequences pane and select Sequence File Callbacks…  Once in the Sequence File Callbacks dialogue, you can select the ModifyReportHeader callback and click the Add button, and then the OK button to go back to the sequence file and add steps to the callback sequence.  Since a FileGlobal’s scope is within the client sequence file, it will be able to see the FileGlobal when called by the callback.
The other option in this case would be to use a StationGlobal and modify the process model’s ModifyReportHeader callback, but the first method mentioned above is preferable since it does not modify the way other sequence files will run under the current process model.  Keeping modularity is always preferable!
Vidula S.
2008-08-14 18:10:13 UTC
Permalink
 Since the FileGlobal’s scope is limited to the sequence file, theModifyReportHeader callback option worked for me. Thank you ~jiggawax~ and Chris_G
Loading...