public static object[,] fUtilityDataTableSortAndGet(string handle, object[] headers, object SortAscending, object noHeadersInput) { var table = PersistentObjects.GetFromMap <DataTable>(handle, "DATATABLE"); var output = ExcelFriendlyConversion.ConvertDataTableToObjectArray(table); return(fUtilityTableSortByHeader(output, headers, SortAscending, noHeadersInput)); }
internal static string GetDefaultCsvPath(object arg) { if (arg is ExcelMissing) { return(PersistentObjects.GetFromMap <string>(Constant.DefaultCsvHandle, "PATH")); } else { return(arg.ToString()); } }
public static string DetermineIfSqlHandleOrSqlQuery(string sqlHandleOrString) { // Should be modified when more clever object store is implemented if (PersistentObjects.ContainsKey(sqlHandleOrString, "SQL")) { return(PersistentObjects.GetFromMap <string>(sqlHandleOrString, "SQL")); } else { return(sqlHandleOrString); } }
public static object[,] fUtilityDataTablesGetFields(string handle) { var table = PersistentObjects.GetFromMap <DataTable>(handle, "DATATABLE"); var fields = DataTableUtility.GetFields(table); var output = new object[fields.Count, 1]; for (int i = 0; i < fields.Count; i++) { output[i, 0] = fields[i]; } return(output); }
public static object[,] fUtilityGetDataTable(string handle, object noHeadersInput) { bool noHeaders = Optional.Check(noHeadersInput, false); if (ExcelDnaUtil.IsInFunctionWizard()) { return(new object[0, 0]); } else { var output = PersistentObjects.GetFromMap <DataTable>(handle, "DATATABLE"); return(ExcelFriendlyConversion.ConvertDataTableToObjectArray(output, noHeaders)); } }
public static int fUtilityDataTablesGetRowCount(string handle) { var table = PersistentObjects.GetFromMap <DataTable>(handle, "DATATABLE"); return(table.Rows.Count); }
public static object[,] DataTableGetInfoCsv(string handle) { var table = PersistentObjects.GetFromMap <DataTable>(handle, DEFINITIONS.DATATABLE_FIELD); return(CreateDataTableInfo(table)); }