NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Test Executive report naming

How do I set the report filename within the TestStand 2.0 CVI Test Executive
when I press the Launch Report Viewer button?
(I don't want it in a temp report)
The code for the button shows the following..

TERetval Eng_ShowReportInExternalViewer(tExeRec *exeRec)
{
HRESULT res = 0;
ERRORINFO errorInfo;
TEObject rptH = 0;

oleErrChkReportErrInfo(TS_ExecutionGetProperty (exeRec->exeH, &errorInfo, TS_ExecutionReport,
CAVT_OBJHANDLE, &rptH));

oleErrChkReportErrInfo(TS_ReportLaunchViewer (rptH, &errorInfo,
TS_ReportConv_ToCRLF));
Error:

if(rptH)
CA_DiscardObjHandle(rptH);


return !(res < 0);
}


I've tried adding the function call...


oleErrChkReportErrInfo(TS_ReportSetProperty (rptH, NULL, T
S_ReportLocation, CAVT_CSTRING, "c:\\myresult.txt"));

in-between the function calls but it does nothing, the test report is still a temporary report.
(I'm using a custom process model but do use the Report object)

Any help would be appreciated!

Thanks!
0 Kudos
Message 1 of 3
(3,301 Views)
Hi Brian,

I dont think the Report.LaunchViewer is intended to use the actual report file. If you were to return the Report location property, you would find has already been set to with the full path to your actual report.

What you could use instead in the Engine.LaunchExternalViewer(filePath)

The default OI will actual launch the viewer at the end of the execution, if External Report Viewer has been set to launch automically by using this API call.

This is done in the DisplayExternalViewerDialog which is launched via the menu item Configure | External Viewers...
There you will find a checkbox call 'Automatically Launch Default External Viewer'.

hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 3
(3,301 Views)
Thanks for your comments Ray, very useful!

(I just wish there was better, more complete documentation for the API....)

Regards,
Brian
0 Kudos
Message 3 of 3
(3,301 Views)