#include <origin.h>
#include <GetNBox.h>
#include <xfutils.h>
//put additional include files here

//put your own support static functions here
		/// ML 6/20/2007 TRANSLATE_TREE_OPTIONALLY
		///Echo 7/10/07 PUT_ERROR_MSG_IN_DLL


void getresults(TreeNode& tr, const Worksheet& iw, const int& escstr)
{
	if(iw)
	{
		uint uid;
		Tree trTemp;
		/// ML 6/20/2007 TRANSLATE_TREE_OPTIONALLY
		//if(iw.GetReportTree(tr, &uid))
		if(iw.GetReportTree(tr, &uid, 0, GRT_TYPE_RESULTS, escstr))
		/// end TRANSLATE_TREE_OPTIONALLY
		{
			//string strBooksheet = wks_get_book_sheet_name(iw);			
			//printf("For %s, report UID = %d\n\n", strBooksheet, uid);
			//out_tree(tr);
		//	tr = trTemp;
			return;
		}
		else
			//out_str("there is no valid results tree to obtain"); ///Echo 7/10/07 PUT_ERROR_MSG_IN_DLL
			XF_THROW(CER_INVALID_RESULT_TREE);
	}
	else
		//out_str("worksheet invalid");///Echo 7/10/07 PUT_ERROR_MSG_IN_DLL
		XF_THROW(CER_NO_WORKSHEET);
	
}

//nGetNDialog = 0,1,2, corresponding to the XF GetN dropdown, 0 = dialog is not used
//you can change nRet to be one of XFEVT_PROCEED (defualt), XFEVT_ABORT, XFEVT_PROCEED_NO_DLG or XFEVT_PROCEED_WITH_DLG(when nGetNDialog = 0)
//nGetNDialog = -1 when Ok on GetN dialog to allow handler to preocess <auto> etc variables
//dwCntrl is combination of bits
//LTXF_FROM_GUI_MENU, LTXF_FROM_GUI_PROMPT, LTXF_FROM_AUTO_UPDATE, LTXF_FROM_FUNCTION, LTXF_THEME_USED, LTXF_CHANGE_PARAM
void getresults_before_execute(TreeNode& trGetN, int nGetNDialog, int& nRet, int dwCntrl)
{

}
