NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Horizontal HTML Report Questions

Solved!
Go to solution

I have a few questions in regards to customizing HTML reports.  I am looking to create a horizontal HTML report that looks identical to the XML horizontal report.  I have been able to extract the relevant formatting from the horizontal.xsl document to allow this.  The Statement expressions of the reportgen_html.seq document are easily modified, but it appears that multiple calls to the modelsupport2.dll are made in HTML report generation.


In attempt to extract the Measurement/Units/Low Limit/High Limit/Comparison type properties, it seems the modelsupport2.dll needs to be modified in the "Add Flagged Values" step of the PutOneResultInReport sequence.  The "Add Flagged Values" step seems to return the properties listed above that are "flagged" in an HTML format via a call to the GetFlaggedValuesForReport_Html() function.

 

20859i90DE297080D62504

 

The code for the GetFlaggedValuesForReport_Html is below:

int DLLEXPORT _stdcall GetFlaggedValuesForReport_Html(CAObjHandle context, CAObjHandle optionsHandle, CAObjHandle stepResult, int level, 
char *labelOnlyStart, char *labelStart, char *valueStart, CAObjHandle reportString)
{
int error = 0;
ERRORINFO errorInfo;
flaggedValueOptions flaggedValueOptions;
char * reportTextString = NULL;
ReportOptions reportOptions; // This is initialized in FindFlaggedValues() if necessary
ReportText reportText; // This is initialized in FindFlaggedValues() if necessary

// clear structure fields
memset(&flaggedValueOptions, 0, sizeof(flaggedValueOptions));
flaggedValueOptions.context = context;
flaggedValueOptions.optionsHandle = optionsHandle;
flaggedValueOptions.level = level;
flaggedValueOptions.indentationString = "";
flaggedValueOptions.labelOnlyStart = labelOnlyStart;
flaggedValueOptions.labelStart = labelStart;
flaggedValueOptions.valueStart = valueStart;
flaggedValueOptions.reportOptionsInited = FALSE;
flaggedValueOptions.reportOptions = &reportOptions;
flaggedValueOptions.reportTextInited = FALSE;
flaggedValueOptions.reportText = &reportText;

// get the report text for the measurements
errChk(TS_TraverseProperties (stepResult, &FindFlaggedValues, &flaggedValueOptions, kNormalTraversal, 0, ""));

if ((flaggedValueOptions.reportTextInited == TRUE) && (flaggedValueOptions.measurements > 0))
{
// concatenate the reportText into one giant string
errChk( ReportText_GetText(&reportText, &reportTextString));

// set report string object from report text pointer
tsErrChkMsgPopup( TS_PropertySetValString (reportString, &errorInfo, "", 0, reportTextString));
}
else
{
// set report string object from report text pointer
tsErrChkMsgPopup( TS_PropertySetValString (reportString, &errorInfo, "", 0, ""));
}


Error:
// release report text only if created
if (flaggedValueOptions.reportTextInited == TRUE)
ReportText_Clear(&reportText);

// release report options only if created
if (flaggedValueOptions.reportOptionsInited == TRUE)
ReportOptions_Clear(&reportOptions);

CLEAR(reportTextString, free);

return error;
}

 


When looking at the GetFlaggedValuesForReport_Html function and following the function calls, I do not see where each of the properties are wrapped with HTML tags.  The only function that contains "<td" is PutOneResultInReport_Html_Internal.

 

  • I would be greatly appreciated if someone could explain how the GetFlaggedValuesForReport_Html  function operates and where the properties are wrapped with HTML tags.  The goal is to output a horizontal row of properties for each step that looks identical to the horizontal XML report.

 

Thanks

CLA, CTA
0 Kudos
Message 1 of 2
(3,100 Views)
Solution
Accepted by LVB

Hey LVB,

I did some digging and I believe I've found some more details for you on exactly where your limits, measurements, etc are all pulled and formatted in the GetFlaggedValuesForReport function from modelsupport2.dll.

 

Here's a quick summary of the path it follows for each element of the report:

 

GetFlaggedValuesForReport_Html (Line 1760) >> TS_TraverseProperties (1785) >> FindFlaggedValues (1874) >> TS_TraverseProperties (1927) >> ProcessFlaggedValues (2409) >> ProcessFlaggedSingleValues (2027)

 

You'll notice that the TS_TraverseProperties function is essentially just a caller function for the FindFlaggedValues and ProcessFlaggedValues functions on lines 1785 and 1927 which probably made it a little more difficult to follow the flow of the code. Take a look at the ProcessFlaggedValues function as well as the ProcessFlaggedSingleValue and ProcessFlaggedArrayValue functions to get an idea of how each value is returned and formatted.

 

Lars L

NI Applications Engineer

0 Kudos
Message 2 of 2
(3,005 Views)