Beispiel #1
0
        private void set_to_excell(string[,] a, int rowC)
        {
            ExcelImpExp.ExportToExcel exp = new ExcelImpExp.ExportToExcel();
            var table = new System.Data.DataTable();


            table = exp.get_dataGridColumnNames(grdBaseInfo);

            for (int i = 0; i <= rowC - 1; i++)
            {
                var row = table.NewRow();
                for (int j = 0; j <= 0; j++)
                {
                    row[this.grdBaseInfo.Columns[j].Header.ToString()] = a[i, j].ToString();
                }

                table.Rows.Add(row);
            }


            DataSet ds = new DataSet("New_DataSet");

            ds.Locale = System.Threading.Thread.CurrentThread.CurrentCulture;
            ds.Tables.Add(table);
            exp.showStuff(ds);
        }
Beispiel #2
0
        private void set_to_excell(string[,] a, int rowC)
        {
            ExcelImpExp.ExportToExcel exp = new ExcelImpExp.ExportToExcel();
            var table = new System.Data.DataTable();


            table = exp.get_dataGridColumnNames(DataGrid);

            for (int i = 0; i <= rowC - 1; i++)
            {
                var row = table.NewRow();

                /*
                 * row[this.grid_asnad.Columns[i + 1].Header.ToString()] = int.Parse(a[i, 0].ToString());
                 * row[this.grid_asnad.Columns[i + 1].Header.ToString()] = a[i, 1];
                 * row[this.grid_asnad.Columns[i + 1].Header.ToString()] = a[i, 2];
                 * row[this.grid_asnad.Columns[i + 1].Header.ToString()] = a[i, 3];
                 */

                for (int j = 0; j <= 2; j++)
                {
                    row[this.DataGrid.Columns[j + 1].Header.ToString()] = a[i, j];
                }

                table.Rows.Add(row);
            }


            DataSet ds = new DataSet("New_DataSet");

            ds.Locale = System.Threading.Thread.CurrentThread.CurrentCulture;
            ds.Tables.Add(table);
            exp.showStuff(ds);
        }