PropertyObject.CreateReportSection

Syntax

PropertyObject.CreateReportSection( GenerationOptions, InitialIndentation, DefaultName = "", FormatString = "", Format = "")

Return Value

ReportSection

Purpose

Generates the corresponding serialization for a PropertyObject based on the format specified and returns the serialized data as a ReportSection object.

Remarks

Refer to the World Wide Web Consortium-compliant XML schema file, PropertyObject.xsd , located in the <TestStand> \Components\Models\TestStandModels directory, for more information about the XML serialization of this method.

Parameters

GenerationOptions As Long

[In] Use this parameter to control the XML generation. You can use any combination of the flags in the XMLOptions constants.

InitialIndentation As Long

[In] Specifies the number of tab characters in front of each line of generated XML source.

DefaultName As String

[In] Specifies a default name when you call this method on a nameless object.

Pass an empty string if you want to use the name of the PropertyObject on which this method was called. This applies only to the root PropertyObject and not subproperties.

This parameter has a default value of "" .

FormatString As String

[In] Use this parameter to control the format of numeric values in the resulting XML. When you pass an empty string, this method uses the following default TestStand format strings based on the numeric representation of the numeric property objects:

  • %.17g for double-precision, 64-bit floating-point values
  • %d for signed 64-bit integer values
  • %u for unsigned 64-bit integer values
Note TestStand ignores format strings of the %g type when the representation is signed 64-bit integer or unsigned 64-bit integer.

This parameter has a default value of "" .

Format As String

[In] Specifies the format of the generated serialization. This method supports values of XML , XML-OTF , or an empty string, which is the default value. Values are not case-sensitive.

When you specify the XML value or an empty string, this method returns a ReportSection object that contains an XML representation of the PropertyObject object. Call the ReportSection.GetAllText method to retrieve the XML content, which might be spread across the ReportSection Header , Body , Footer , and ReportSubsections properties.

National Instruments recommends that you do not use the XML-OTF option unless you are modifying National Instruments code that depends on it or you are implementing a custom on-the-fly XML report generator. Although the ReportSection objects the XML-OTF option returns contain equivalent data as the ReportSection objects the XML option returns, the XML-OTF option output differs from the standard XML in the following ways:

  • The XML-OTF output never contains any data in the ReportSection.Body property.
  • Except as explained below, the XML-OTF output writes data to the ReportSection.Header property.
  • The XML-OTF output inserts data for each TS.SequenceCall and TS.PostAction subproperty of the PropertyObject into its own ReportSection object that the ReportSection.ReportSubsections property contains. Each subsection includes the following data:
    • The Header property contains the first line of XML content.
    • The Footer property contains all remaining XML content.
    • Additional TS.SequenceCall and TS.PostAction properties within the subsection receive no special processing and are included in the Footer property just like any other TestStand property.
  • After the XML-OTF output processes a TS.SequenceCall or TS.PostAction property, the XML-OTF output inserts all remaining data of other types in the Footer property of the returned ReportSection object. The XML-OTF output inserts additional TS.SequenceCall and TS.PostAction properties in new subsections, as described above.

Because the XML-OTF output handles the TS.SequenceCall and TS.PostAction properties in a special way, the order of subproperties in the XML content the ReportSection.GetAllText method returns might not be identical in the two cases.

This parameter has a default value of "" .

See Also

PropertyObject

Report.ReportSection

ReportSection

Thread Safety of the PropertyObject API and TestStand Variables

XMLOptions