NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

modify xml reports

I would like to modify the xml report files of TestStand in the following way:

< p>
< xml version="1.0" encoding=UTF-8"?>
< report>
< product_number>xxxx< /product_number>
< serial_number>xxxxx< /serial_number>
< spec_info>< /spec_info>
< options>< /options>
< workstation>< /workstation>
< operator>< /operator>
< test>
< name>< /name>
< /test>
< /report>
< /p>

So the xml file looks totally different like the xml files produced by TestStand.

Is there any way to make this change - and how could it be done?

Thanks in advance
nicole e.

Message Edited by Support on 06-17-2005 10:21 AM

0 Kudos
Message 1 of 10
(4,534 Views)
I would like to modify the xml report files of TestStand in the following way:


< report >
< product_number>xxxxx< /product_number>
< serial_number>xxxx< /serial_number>
< options>xxx< /options>
< workstation>xxxx< /workstation>
< operator>xxxx< /operator>
< test>
< name>xxxx< /name>>
< short_description>xxxx< /short_description>
< start_time>xxxx< /start_time>
< end_time>xxxx< /end_time>
< result>xxxx< /result>
< /test>
< /report>


So the xml file looks totally different like the xml files produced by TestStand.

Is there any way to make this change - and how could it be done?

Thanks in advance
nicole e.

Message Edited by Support on 06-17-2005 10:17 AM

0 Kudos
Message 2 of 10
(4,507 Views)
I'm sorry for my stupid mistake. Attached you'll find the corresponding new xml file.

Thanks for reading this messages anyway.
0 Kudos
Message 3 of 10
(4,497 Views)
hi nicole,

found this link which deals with the same. perhaps you can modify the "reportgen_xml.seq" the way you need (but don't forget to make a backup!).

greets!
0 Kudos
Message 4 of 10
(4,456 Views)
Thanks for the link. It explains that the changes I want to do are possible, but not how to do it.
For example: The Results of a test which are inserted in the report body are stored in the ResultList Array. I don't really know how to access the elements such as "Status" or "ReportText" in this array. In the report body this information seems to be inserted by a function of modellsupport2.dll.
Another question is, which is the best way to produce my own xml tags if I want to replace the Prob and Value tags? It is possible to insert a Statement Step and insert the expression I want to see in my report. But how can I produce nested elements in my xml report?

I would appreciate very much getting an answer to my questions.

nicole e.
0 Kudos
Message 5 of 10
(4,445 Views)
Nicole -
The sequences in reportgen_xml.seq work with the existing reporting mechanism that TestStand uses for on-the-fly and post UUT result report generation. TestStand uses the PropertyObject.GetXML call to generate the XML for each single results for on-the-fly or once for the entire post UUT result collection. It also uses this method for generating other XML objects for Report Options and UUT Info. What this method returns is defined internally. You would have to either transform our XML to your or you would have to replace this call with your own custom calls to generate your XML that adheres to your custom XML schema.
Scott Richardson
0 Kudos
Message 6 of 10
(4,428 Views)
In reportgen_xml.seq is a sequence call named AddReportBody. AddReportBody itself contains two calls: "Call AddCriticalFailureStack" and "Get XML for Result". The module pathname of AddCriticalFailureStack is modelsupport2.dll, so the corresponding function should be a part of the library and contained in one of the c-files or header files in the Models/TestStandModels directory. I can't find the header or the whole function anywhere.
But this function should give something back so it can be passed to PropertyObject.GetMXL. The call for Property is done as follows:
Call PropertyObject{Parameters.Result}.GetXML(0x95,0,"",Parameters.ResultOptions.NumericFormat). Since Parameters.Result is the object reference and it is of type container, what is really passed to the function and what is given back?
If I want to write my own calls for generating XML I need to understand how this works. Then I can access the parameters and objects I need and pass them to my own calls.
Furthermore in the "specify module" dialog of the call "AddCriticalFailureStack" is a tab where source code can be specified. Could the option be interesting for my problem?

Thanks a lot and regards

Nicole
0 Kudos
Message 7 of 10
(4,410 Views)
Nicole -
The function AddCriticalFailureStack() is defined in c_report.c. This function updates the Parameters.UUT.CriticalFailureStack array property. Later in the AddReportHeader sequence, the "Get XML for UUT" step calls GetXML on the UUT, so the failture chain is included in the XML for the UUT. I agree that the code could have been written more clearly by passin in the specific array instead of ending the array subproperty of another container.
Scott Richardson
0 Kudos
Message 8 of 10
(4,406 Views)
If I want to write my own GetXML call like recommended before, what exactly do I have to pass to my call to build my own report out of it?
0 Kudos
Message 9 of 10
(4,388 Views)
Nicole -
It all depends as to whether you want to just update the GetXML calls or you want to control the format of the entire XML file.

Internally GetXML recursively traverses a generic property object structure by going to its children and so on. It generates a list of strings that are eventually all concatinated together before returning.

The default XML report schema contains the output from multiple calls to a GetXML all concatinated together. Separate calls are made to generate XML for various pieces of typed data like UUT, ReportOptions, StartTime, StartDate, StationInfo, and the result from the MainSequence call step in the Single Pass or the Test UUTs sequence.

Since all the above components are built by the GetXML stream and you wish to simplify the entire schema, trying to make a single change to replace the GetXML calls in the XML sequence might not be possible.

If you are only going to be doing post UUT results and not on-the-fly, you could write your own routine that replaces the Test Report sequence in the SequentialModel.seq. This sequence generates the report for a single UUT. You may want to consider writing your own routine using the parameters to the sequence which include UUT, ReportOptions, StartTime, StartDate, StationInfo, and the main sequence results. This way you can create the schema that you want.
Scott Richardson
0 Kudos
Message 10 of 10
(4,353 Views)