private static string LoadDataSourceExt(ServerDataSource dataSource, string sheetOrTablename) 
        {
            //uaopendataset(typeoffile, directory,filename,uaperformance)
            string dirPath = Path.GetDirectoryName(dataSource.FileNameWithPath);
            string fileName = Path.GetFileName(dataSource.FileNameWithPath);
            string fullpathfilename = Path.Combine(dirPath, fileName); //dirPath + "\\" + fileName;
            string datasetname = dataSource.Name;
            string filetype = dataSource.Extension.ToUpper();

            string worksheetname = null;
            bool replaceDataset = false;
            bool csvHeader = true;
            string loadMissingValue="FALSE";//21Apr2014

            if (filetype.Equals("SAV"))
            {
                filetype = "SPSS";

                //21Apr2014 Missing Values loading is optional.
                string LoadMisVal = confService.AppSettings.Get("loadSavMissingValue");
                // load default value if no value is set 
                if (LoadMisVal.Trim().Length == 0)
                    LoadMisVal = confService.DefaultSettings["loadSavMissingValue"];
                loadMissingValue = LoadMisVal.ToLower().Equals("true") ? "TRUE" : "FALSE"; /// 
            }

            if (sheetOrTablename!=null)// filetype.Equals("XLS") || filetype.Equals("XLSX"))
            {
                worksheetname = sheetOrTablename;// "Sheet1";
            }

            ////UAloadDataset(fullpathfilename,  filetype, worksheetName=NULL, replace_ds=FALSE, csvHeader=TRUE, datasetName )//Change this, if uadatapackage is changed
            return string.Format("UAloadDataset(fullpathfilename='{0}', filetype='{1}', worksheetName='{2}',load.missing={4}, datasetName='{3}')", FormatFileName(fullpathfilename), filetype, worksheetname, datasetname, loadMissingValue);
            //return string.Format("UAloadDataset(fullpathfilename='{0}', filetype='{1}', worksheetName='{2}', datasetName='{3}')", FormatFileName(fullpathfilename), filetype, worksheetname, datasetname);
        }
        public UAReturn DataFrameLoad(string dframename, string datasetName, string sheetname)//13Feb2014
        {
            UAReturn r;

            ServerDataSource dataSource = new ServerDataSource(_userSession.DefaultDispatcher, dframename, datasetName, sheetname); //empty filename sent.
            r = _userSession.DefaultDispatcher.DataFrameLoad(dataSource, datasetName);
            return r;
        }
        public UAReturn DataSourceLoad(string datasetName, string fileName, string sheetname)
        {
            UAReturn r;

            ServerDataSource dataSource = new ServerDataSource(_userSession.DefaultDispatcher, fileName, datasetName, sheetname);
            r = _userSession.DefaultDispatcher.DataSourceLoad(dataSource, sheetname);
            return r; //08Jun2013
        }
Exemple #4
0
        public ServerDataSource DataSourceLoad(string sourceName, string filePath)
        {
            //Load datasource
            ServerDataSource ds = new ServerDataSource(this, filePath, sourceName);

            ds.Load();

            this.DataSources.Add(ds);

            return(ds);
        }
        public ServerDataSource DataSourceLoad(string sourceName, string filePath)
        {
            //Load datasource
            ServerDataSource ds = new ServerDataSource(this, filePath, sourceName);

            ds.Load();

            this.DataSources.Add(ds);

            return ds;
        }
        public static string LoadDataSource(ServerDataSource dataSource, string tableOrSheetname="Sheet1")
        {
            dataSource.DataSetType = GetDataSetTypeFromExtension(dataSource.Extension);

            if (dataSource.DataSetType != ServerDataSourceTypeEnum.Unknown)
            {
                //for Excel sheet name must also be set before opening. Anil
                dataSource.HasHeader = true;
                dataSource.FieldSperator = ",";
                return LoadDataSourceExt(dataSource, tableOrSheetname);
            }
            return string.Empty;
        }
        public UAReturn UABinomial(ServerDataSource dataSource, List<string> vars, double p, string alternative, double confidenceLevel, bool descriptives, bool quartiles, int missing)
        {
            UAReturn result = new UAReturn();

            if (string.IsNullOrEmpty(alternative)) alternative = "two.sided";

            result.CommandString = string.Format(PrototypeBinomial, toRCollection(vars), p, alternative, confidenceLevel, descriptives, quartiles, dataSource.FileName, missing);

            result.Data = EvaluateToObjectXml(result.CommandString);

            result.Success = true;

            return result;
        }
        public static string LoadDataframe(ServerDataSource dataSource, string dframe)
        {
            dataSource.DataSetType = GetDataSetTypeFromExtension(dataSource.Extension);

            if (dataSource.DataSetType == ServerDataSourceTypeEnum.Unknown)
            {
                //for Excel sheet name must also be set before opening. Anil
                dataSource.HasHeader = true;
                dataSource.FieldSperator = ",";
                string datasetname = dataSource.Name;
                return string.Format("BSky.LoadRefresh.Dataframe('{0}')", dframe);
            }
            return string.Empty;
        }
 public abstract UAReturn DataSourceSave(ServerDataSource dataSource);
 public abstract UAReturn DatasetSaveas(ServerDataSource dataSource);//Anil 
 
 public abstract UAReturn CloseDataset(ServerDataSource dataSource);//Anil 
Exemple #11
0
        public abstract UAReturn changeMissing(string colName, string colProp, List <string> newMisVal, string mistype, ServerDataSource dataSource); //change levels

        public abstract object getColNumFactors(string colName, ServerDataSource dataSource);
        public abstract UAReturn GetRodbcTables(string fname); //27Jan2014

        public abstract UAReturn DataSourceRefresh(ServerDataSource dataSource);//25Mar2013
 public abstract UAReturn setNominalOrOrdinalToScale(string colName, List<FactorMap> fmap, string changeTo, ServerDataSource dataSource);
        public abstract UAReturn EmptyDataSourceLoad(ServerDataSource dataSource);        //03Jan2014

        public abstract UAReturn DataSourceLoad(ServerDataSource dataSource, string sheetname);
Exemple #15
0
        public abstract UAReturn removeDatagridRow(int rowindex, ServerDataSource dataSource);                                             //remove data row

        public abstract UAReturn sortDatagridColumn(string colname, string sortorder, ServerDataSource dataSource);                        //sort ascending then desending then ascending
        public abstract UAReturn changeColLevels(string colName, List<ValLvlListItem> finalLevelList, ServerDataSource dataSource);//change levels

        public abstract UAReturn addColLevels(string colName, List<string> finalLevelList, ServerDataSource dataSource);//add levels
Exemple #17
0
        public abstract UAReturn editDatagridCell(string colName, string celdata, int rowindex, ServerDataSource dataSource);              //edit existing data row

        public abstract UAReturn addNewDataRow(string colName, string celdata, string rowdata, int rowindex, ServerDataSource dataSource); //add new data row
Exemple #18
0
        public abstract UAReturn addNewDataRow(string colName, string celdata, string rowdata, int rowindex, ServerDataSource dataSource); //add new data row

        public abstract UAReturn removeDatagridRow(int rowindex, ServerDataSource dataSource);                                             //remove data row
Exemple #19
0
 public abstract UAReturn editDatagridCell(string colName, string celdata, int rowindex, ServerDataSource dataSource);              //edit existing data row
Exemple #20
0
 public abstract UAReturn setNominalOrOrdinalToScale(string colName, List <FactorMap> fmap, string changeTo, ServerDataSource dataSource);
Exemple #21
0
 public abstract List <FactorMap> getColFactormap(string colName, ServerDataSource dataSource);
        public abstract UAReturn editDatasetVarGrid(ServerDataSource dataSource, string colName, string colProp, string newValue, List<string> colLevels);//var grid

        public abstract UAReturn makeColumnFactor(ServerDataSource dataSource, string colName);//var grid
Exemple #23
0
        public abstract UAReturn removeVarGridCol(string colName, ServerDataSource dataSource);                                                             //remove row from variable grid

        //public abstract UAReturn removeMultipleVarGridCol(string[] colName, ServerDataSource dataSource); //04Aug2016 remove multiple rows from var grid. ie delete multi cols

        public abstract UAReturn changeColLevels(string colName, List <ValLvlListItem> finalLevelList, ServerDataSource dataSource);                  //change levels
        public abstract UAReturn addNewColDatagrid(string colName, string dgridval, int rowindex, ServerDataSource dataSource);//add row in vargrid and col in datagrid

        public abstract UAReturn removeVarGridCol(string colName, ServerDataSource dataSource);//remove row from variable grid
Exemple #25
0
        public abstract UAReturn makeColumnNumeric(ServerDataSource dataSource, string colName);                                                            //var grid 11Oct2017

        public abstract UAReturn addNewColDatagrid(string colName, string rdataType, string dgridval, int rowindex, ServerDataSource dataSource);           //add row in vargrid and col in datagrid //15Oct2015 modified
        public abstract UAReturn changeMissing(string colName, string colProp, List<string> newMisVal, string mistype, ServerDataSource dataSource);//change levels

        public abstract object getColNumFactors(string colName, ServerDataSource dataSource);
        public abstract UAReturn EmptyDataSourceLoad(ServerDataSource dataSource);                                                 //03Jan2014

        public abstract UAReturn DataSourceLoad(ServerDataSource dataSource, string sheetname, bool removeSpacesSPSS = false);     //, IOpenDataFileOptions odfo=null
        public abstract UAReturn editDatagridCell(string colName, string celdata, int rowindex, ServerDataSource dataSource);//edit existing data row

        public abstract UAReturn addNewDataRow(string colName, string celdata, string rowdata, int rowindex, ServerDataSource dataSource);//add new data row
        public abstract UAReturn EmptyDataSourceLoad(ServerDataSource dataSource);//03Jan2014

        public abstract UAReturn DataSourceLoad(ServerDataSource dataSource, string sheetname);
Exemple #30
0
        public abstract UAReturn makeColumnString(ServerDataSource dataSource, string colName);                                                             //var grid

        public abstract UAReturn makeColumnNumeric(ServerDataSource dataSource, string colName);                                                            //var grid 11Oct2017
Exemple #31
0
        public abstract UAReturn addColLevels(string colName, List <string> finalLevelList, ServerDataSource dataSource);                             //add levels

        public abstract UAReturn changeMissing(string colName, string colProp, List <string> newMisVal, string mistype, ServerDataSource dataSource); //change levels
Exemple #32
0
        public abstract UAReturn addNewColDatagrid(string colName, string rdataType, string dgridval, int rowindex, ServerDataSource dataSource);           //add row in vargrid and col in datagrid //15Oct2015 modified

        public abstract UAReturn removeVarGridCol(string colName, ServerDataSource dataSource);                                                             //remove row from variable grid
 public abstract UAReturn DataSourceReadRow(ServerDataSource dataSource, int row); //23Jan2014
Exemple #34
0
        public abstract UAReturn changeColLevels(string colName, List <ValLvlListItem> finalLevelList, ServerDataSource dataSource);                  //change levels

        public abstract UAReturn addColLevels(string colName, List <string> finalLevelList, ServerDataSource dataSource);                             //add levels
Exemple #35
0
 public abstract UAReturn DataSourceReadRows(ServerDataSource dataSource, int start, int end);
 public abstract UAReturn DataSourceReadCell(ServerDataSource dataSource, int row, int col);
Exemple #37
0
 public abstract UAReturn DataSourceReadCell(ServerDataSource dataSource, int row, int col);
        public abstract UAReturn DataSourceReadRow(ServerDataSource dataSource, int row); //23Jan2014

        public abstract UAReturn EmptyDataSourceLoad(ServerDataSource dataSource);//03Jan2014
Exemple #39
0
 public abstract UAReturn DataSourceReadRow(ServerDataSource dataSource, int row);                                          //23Jan2014
 public abstract UAReturn DataFrameLoad(ServerDataSource dataSource, string dframe); //13Feb2014
Exemple #41
0
        public abstract UAReturn DataSourceReadRow(ServerDataSource dataSource, int row);                                          //23Jan2014

        public abstract UAReturn EmptyDataSourceLoad(ServerDataSource dataSource);                                                 //03Jan2014
        public virtual UAReturn DataSourceClose(ServerDataSource dataSource)
        {
            this.DataSources.Remove(dataSource);

            return new UAReturn();
        }
Exemple #43
0
        public abstract UAReturn EmptyDataSourceLoad(ServerDataSource dataSource);                                                 //03Jan2014

        public abstract UAReturn DataSourceLoad(ServerDataSource dataSource, string sheetname);                                    //, IOpenDataFileOptions odfo=null
 public abstract UAReturn DatasetSaveas(ServerDataSource dataSource);//Anil 
Exemple #45
0
        public abstract UAReturn DataSourceLoad(ServerDataSource dataSource, string sheetname);                                    //, IOpenDataFileOptions odfo=null

        public abstract UAReturn DataFrameLoad(ServerDataSource dataSource, string dframe);                                        //13Feb2014
        public abstract UAReturn CloseDataset(ServerDataSource dataSource);//Anil 

        #region variablegrid 
        public abstract UAReturn editDatasetVarGrid(ServerDataSource dataSource, string colName, string colProp, string newValue, List<string> colLevels);//var grid
Exemple #47
0
        public abstract object GetAllModels(string classtype);                                                                     //09Sep2016

        public abstract UAReturn DataSourceRefresh(ServerDataSource dataSource);                                                   //25Mar2013
        public abstract UAReturn makeColumnFactor(ServerDataSource dataSource, string colName);//var grid

        public abstract UAReturn addNewColDatagrid(string colName, string dgridval, int rowindex, ServerDataSource dataSource);//add row in vargrid and col in datagrid
Exemple #49
0
        public virtual UAReturn DataSourceClose(ServerDataSource dataSource)
        {
            this.DataSources.Remove(dataSource);

            return(new UAReturn());
        }
        public abstract UAReturn removeVarGridCol(string colName, ServerDataSource dataSource);//remove row from variable grid

        public abstract UAReturn changeColLevels(string colName, List<ValLvlListItem> finalLevelList, ServerDataSource dataSource);//change levels
Exemple #51
0
 public abstract UAReturn DataSourceSave(ServerDataSource dataSource);
        public abstract UAReturn addColLevels(string colName, List<string> finalLevelList, ServerDataSource dataSource);//add levels

        public abstract UAReturn changeMissing(string colName, string colProp, List<string> newMisVal, string mistype, ServerDataSource dataSource);//change levels
Exemple #53
0
        public abstract UAReturn DontExecuteJustLogCommand(string CommandScript); //16Aug2016

        public abstract UAReturn DatasetSaveas(ServerDataSource dataSource);      //Anil
 public abstract List<FactorMap> getColFactormap(string colName, ServerDataSource dataSource);
Exemple #55
0
        public abstract UAReturn DatasetSaveas(ServerDataSource dataSource);      //Anil

        public abstract UAReturn CloseDataset(ServerDataSource dataSource);       //Anil
 public abstract UAReturn editDatagridCell(string colName, string celdata, int rowindex, ServerDataSource dataSource);//edit existing data row
Exemple #57
0
        public abstract UAReturn CloseDataset(ServerDataSource dataSource);       //Anil

        #region variablegrid
        public abstract UAReturn editDatasetVarGrid(ServerDataSource dataSource, string colName, string colProp, string newValue, List <string> colLevels); //var grid
        public abstract UAReturn addNewDataRow(string colName, string celdata, string rowdata, int rowindex, ServerDataSource dataSource);//add new data row

        public abstract UAReturn removeDatagridRow( int rowindex, ServerDataSource dataSource);//remove data row
Exemple #59
0
        public abstract UAReturn makeColumnFactor(ServerDataSource dataSource, string colName);                                                             //var grid

        public abstract UAReturn makeColumnString(ServerDataSource dataSource, string colName);                                                             //var grid