Adding Columns and Rows to an XML Report

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Before you add extra information to a report, confirm that other XSL templates do not already add to the report the result information you want to include.

horizontal.xsl

To add custom columns to reports using the horizontal.xsl file, you must modify the XSL templates and JavaScript code to add a column and then add data to the new column. Complete the following steps to add an extra StepID column to the right side of the report table using the horizontal.xsl file.

  1. Open the horizontal.xsl file.
  2. Search for the CREATE_EXTRA_COLUMNS comment in the BeginTable function of the JavaScript section.
  3. Uncomment the following code to add a new StepID column:

    "<td rowspan='2' valign='bottom' align='center' style='width:30%'><span style='font-size:0.6em'><b>StepID</b></span></td>\n" +
  4. Search for the INITIALIZE_COLUMN_SPAN_VARIABLES comment and increment all the variables by the number of extra columns you are adding to set the column span for result data you add as rows to the report. Using column span information ensures that each row in the report includes the same number of columns and uses the correct formatting. Because you are adding only the StepID column in this example, replace the following code:

    <xsl:variable name="gSecondColumnSpan5" select="5"/>
    <xsl:variable name="gSecondColumnSpan6" select="6"/>
    <xsl:variable name="gSecondColumnSpan7" select="7"/>
    <xsl:variable name="gSecondColumnSpan8" select="8"/>

    with the following code:

    <xsl:variable name="gSecondColumnSpan5" select="6"/>
    <xsl:variable name="gSecondColumnSpan6" select="7"/>
    <xsl:variable name="gSecondColumnSpan7" select="8"/>
    <xsl:variable name="gSecondColumnSpan8" select="9"/>
  5. Search for each of three instances of the ADD_COLUMN_DATA_1 comment and uncomment the following code for each instance:

    <td><xsl:value-of select="@testReferenceID"/></td>

    The expression "@testReferenceID" specifies the XPath expression to obtain the testReferenceID from the XML file. You must customize this XPath expression to match the data you want to add to the additional columns. Refer to the W3Schools website for more information on XPath. Refer to ATML Test Results 6.01 and 5.0 Report Structure for the XML object structure.

  6. Repeat steps 2 through 5 to add additional columns.

The following figure shows a modified report with a StepID column for Sequence Call steps using horizontal.xsl:

Modified Report with StepID Column for Sequence Call Steps Using horzontal.xsl

report.xsl and expand.xsl

Complete the following steps to add an extra row with StepID information under each step in the report table using the report.xsl file and the expand.xsl file.

  1. Open the report.xsl or expand.xsl file.
  2. Search for the ADD_EXTRA_ROWS comment.
  3. Uncomment the following code after the ADD_EXTRA_ROWS comment:

    <tr>

    <td>

    <xsl:attribute name="style">border-color:<xsl:value-of select="$reportOptions/Prop[2Name='Colors']/Prop[@Name='TableBorder']/Value"/></xsl:attribute>

    <span style='font-size:82%;'>StepID</span>

    </td>

    <td>

    <xsl:attribute name="style">border-color:<xsl:value-of select="$reportOptions/Prop[2Name='Colors']/Prop[@Name='TableBorder']/Value"/></xsl:attribute>

    <span style='font-size:82%;'><xsl:value-of select='./Prop[@Name='TS']/Prop[@Name='StepId']/Value"/></span></td>

    </tr>

The following figure shows a modified report with a StepID row using report.xsl:

Modified Report with StepID Row Using report.xsl

The following figure shows a modified report with a StepID row using expand.xsl:

Modified Report with StepID Row Using expand.xsl


See Also

TestStand Report Schema

WAS THIS ARTICLE HELPFUL?

Not Helpful