I am afraid we only have LabTalk calling of XF in current version. OC calling is supported for some but not all variable types, and ReportTree is one such variable type that lack OC level support. The following code shows how you can call with LabTalk syntax in Origin C to control the result sheet:
// Group Col = wcol(nCGroup+1)
// Data Co = wcol(nCData+1)
void test_mw(int nCGroup = 0, int nCData = 2)
{
Worksheet wks = Project.ActiveLayer();
WorksheetPage wp = wks.GetPage();
// add a result sheet
int nSheet = wp.AddLayer();
string strCmd;
strCmd.Format("i:=%s!(%d,%d) rt:=[<input>]%d!", wks.m_strBookSheet, nCGroup+1, nCData+1, nSheet+1);
string strXFNameToCall = "mwtest";
XFBase xf(strXFNameToCall);
int nRet = -1;
if(xf)
nRet = xf.ExecuteLabTalk(strCmd, NULL);
if(nRet == 0) // no error
{
Worksheet wksResult = wp.Layers(nSheet);
wksResult.SetName("My MW Result Sheet");
}
}
So the ExecuteLabTalk call will allow XF execution done in exactly the same fashion as if calling from LT but still somewhat better error handling.
CP