Exemplo n.º 1
0
        public bool ToCSV(int tableIndex, string xLSFileName)
        {
            bool rtn = false;

            DataSetToExcel dte = new DataSetToExcel();
            dte.DataSet = this;
            dte.Excelpath = xLSFileName;
            if (tableIndex >= 0 && tableIndex < this.RealDataSet.Tables.Count)
            {
                rtn = dte.ExportCSV(tableIndex);
            }
            else
            {
                rtn = false;
            }

            return rtn;
        }
Exemplo n.º 2
0
        public bool ToCSV(string tableName, string xLSFileName)
        {
            bool rtn = false;

            DataSetToExcel dte = new DataSetToExcel();
            dte.DataSet = this;
            dte.Excelpath = xLSFileName;
            if (this.RealDataSet.Tables.Contains(tableName))
            {
                rtn = dte.ExportCSV(tableName);
            }
            else
            {
                rtn = false;
            }

            return rtn;
        }
Exemplo n.º 3
0
        public void ToCSV(int TableIndex)
        {
            string path = this.Page.MapPath(this.Page.Request.Path);
            path = path.Substring(0, path.LastIndexOf('.') + 1);
            path = path + "xls";
            InfoDataSet ids = new InfoDataSet();
            if (this.InnerDataSet != null)
            {
                ids.RealDataSet = this.InnerDataSet;
            }
            else
            {
                DataTable tb = this.CommandTable.Clone();
                tb.TableName = "CommandTable";
                tb.Merge(this.CommandTable);
                ids.RealDataSet.Tables.Add(tb);
            }
            ids.RemoteName = this.RemoteName;//DD Use
            DataSetToExcel dste = new DataSetToExcel();
            dste.Excelpath = path;
            dste.DataSet = ids;
            dste.ExportCSV(TableIndex);

            this.Export(CliUtils.ReplaceFileName(this.Page.AppRelativeVirtualPath, ".aspx", ".xls"));
        }