Beispiel #1
0
        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));
        }
Beispiel #2
0
 internal static string GetDefaultCsvPath(object arg)
 {
     if (arg is ExcelMissing)
     {
         return(PersistentObjects.GetFromMap <string>(Constant.DefaultCsvHandle, "PATH"));
     }
     else
     {
         return(arg.ToString());
     }
 }
Beispiel #3
0
        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);
            }
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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));
            }
        }
Beispiel #6
0
        public static int fUtilityDataTablesGetRowCount(string handle)
        {
            var table = PersistentObjects.GetFromMap <DataTable>(handle, "DATATABLE");

            return(table.Rows.Count);
        }
Beispiel #7
0
        public static object[,] DataTableGetInfoCsv(string handle)
        {
            var table = PersistentObjects.GetFromMap <DataTable>(handle, DEFINITIONS.DATATABLE_FIELD);

            return(CreateDataTableInfo(table));
        }