private void showDetail(InvoiceDataset.ClientInvoiceTableDataTable invoiceTable) { //Get worksheet Sheet1 ws = global::Argix.Finance.Globals.Sheet1; Application.ScreenUpdating = false; //Insert a row at row0 + 1 (pushes down) for every row of data int rowCount = invoiceTable.Rows.Count; Excel.Range row0 = ws.Range[ws.Cells[ROW0_DETAIL + 1, 1], ws.Cells[ROW0_DETAIL + 1, 104]].EntireRow; for (int i = 0; i < rowCount - 1; i++) { row0.Insert(Excel.XlInsertShiftDirection.xlShiftDown, false); } //Populate entire data table into a range of worksheet cells object[,] values = new object[rowCount, 104]; for (int i = 0; i < rowCount; i++) { for (int j = 0; j < 104; j++) { values[i, j] = invoiceTable[i][j + 1]; } } ws.Range[ws.Cells[ROW0_DETAIL, 1], ws.Cells[ROW0_DETAIL + rowCount - 1, 104]].Value2 = values; Application.ScreenUpdating = true; }
private void showHeader(InvoiceDataset.ClientInvoiceTableRow invoice) { //Set named range summary values Sheet1 ws = global::Argix.Finance.Globals.Sheet1; Application.ScreenUpdating = false; ws.Range[ws.Cells[1, 1], ws.Cells[1, 1]].Value2 = invoice.FileHeader; Application.ScreenUpdating = true; }