private void ToExcel() { int columnCount = m_dataGridMarks.ColumnCount; using (ExcelWorker excel = new ExcelWorker()) { excel.SetText(1, columnCount, GetExcelText()); excel.WrapText(1, 1, m_dataGridMarks.RowCount, columnCount, true); excel.SetColumnWidth(1, 1, 20); excel.WriteDataGrid(m_dataGridMarks); excel.Orientation90(2, 2, 1, columnCount - 1); excel.SkipRow(); excel.SetText(columnCount - 2, 1, "Всего"); excel.SetText(columnCount - 1, 1, GetSumSkips().ToString()); excel.SetText(columnCount, 1, GetSumDisrespectSkips().ToString()); excel.WriteDataGrid(GetMarksCountDataDrid()); excel.Visible = true; } }
private void ToExcelAward() { using (ExcelWorker excel = new ExcelWorker()) { excel.SetText(1, 13, GetExcelTextAward()); excel.WrapText(1, 1, m_dataSet.Students.Count + 1, 13, true); excel.SetColumnWidth(2, 13, 15); excel.SetColumnWidth(1, 1, 4); excel.WriteDataGrid(GetAwardDataGrid()); excel.Visible = true; } }
private void ToExcel() { ExcelWorker exc = new ExcelWorker(); exc.SetText(1, 4, string.Format("Вычет часов за {0} семестр группы {1}.", m_comboBoxSemesters.SelectedItem, m_groupInfo.group_name)); var dataGridForExcel = GetDataGridForExcel(); exc.WriteDataGrid(dataGridForExcel); exc.SetColumnWidth(1, 1, 40); exc.WrapText(1, 1, dataGridForExcel.RowCount, 1, true); exc.Visible = true; exc.Dispose(); }