private int createInvoiceTotals(InvoiceDS.InvoiceTotalTableRow total, int row0) { //Get worksheet int _rows = 0; Invoice invoice = global::Argix.Finance.Globals.Invoice; //Header _rows += 4; Excel.Range r = invoice.get_Range(invoice.Cells[row0 + 1, 1], invoice.Cells[row0 + 1, 12]); r.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeTop].Color = Color.Black.ToArgb(); invoice.get_Range(invoice.Cells[row0 + 1, 2], invoice.Cells[row0 + 1, 12]).Value2 = new object[1, 11] { { "Invoice Total", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 1, 2], invoice.Cells[row0 + 1, 2]).Font.Bold = true; invoice.get_Range(invoice.Cells[row0 + 2, 2], invoice.Cells[row0 + 2, 12]).Value2 = new object[1, 11] { { "", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 3, 2], invoice.Cells[row0 + 3, 12]).Value2 = new object[1, 11] { { "", "", "", "Inland", "Distribution", "Total", "", "", "", "", "" } }; r = invoice.get_Range(invoice.Cells[row0 + 4, 2], invoice.Cells[row0 + 4, 12]); r.Value2 = new object[1, 11] { { "Cartons", "Weight(kg)", "Weight(lbs)", "Charges", "Charges", "Charges", "", "", "", "", "" } }; r.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeBottom].Color = Color.Black.ToArgb(); //Set named range summary values _rows += 1; object[,] totals = new object[1, 6]; totals[0, 0] = total.Cartons; totals[0, 1] = total.WeightKg; totals[0, 2] = total.Weight; totals[0, 3] = total.InlandCharges; totals[0, 4] = total.DistributionCharges; totals[0, 5] = total.TotalCharges; invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + 5, 7]).Value2 = totals; invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + 5, 2]).NumberFormat = "#,##0"; invoice.get_Range(invoice.Cells[row0 + 5, 3], invoice.Cells[row0 + 5, 3]).NumberFormat = "#,##0.00"; invoice.get_Range(invoice.Cells[row0 + 5, 4], invoice.Cells[row0 + 5, 4]).NumberFormat = "#,##0"; invoice.get_Range(invoice.Cells[row0 + 5, 5], invoice.Cells[row0 + 5, 5]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 5, 6], invoice.Cells[row0 + 5, 6]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 5, 7], invoice.Cells[row0 + 5, 7]).NumberFormat = "$#,##0.00_);($#,##0.00)"; return(_rows); }
private int createInvoiceBodyDetails(InvoiceDS ds, int row0) { //Get worksheet int _rows = 0; Invoice invoice = global::Argix.Finance.Globals.Invoice; //Column headers _rows += 6; invoice.get_Range(invoice.Cells[row0 + 1, 2], invoice.Cells[row0 + 1, 12]).Value2 = new object[1, 11] { { "", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 2, 2], invoice.Cells[row0 + 2, 12]).Value2 = new object[1, 11] { { "Distribution Charges", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 2, 2], invoice.Cells[row0 + 2, 2]).Font.Bold = true; invoice.get_Range(invoice.Cells[row0 + 3, 2], invoice.Cells[row0 + 3, 12]).Value2 = new object[1, 11] { { "", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 4, 2], invoice.Cells[row0 + 4, 12]).Value2 = new object[1, 11] { { "", "Delivery", "", "", "", "", "", "", "Fuel", "Fuel", "Total Distrib." } }; invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + 5, 12]).Value2 = new object[1, 11] { { "Zone", "Code", "Store", "Cartons", "Weight(kg)", "Weight(lbs)", "Rate", "Amount", "Surcharge %", "Surcharge", "Charges" } }; Excel.Range r = invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + 5, 12]); r.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeBottom].Color = Color.Black.ToArgb(); //Detail decimal totalDistributionCharges = 0.0M; int rows = ds.InvoiceDetailTable.Rows.Count; if (rows > 0) { _rows += rows; object[,] details = new object[rows, 11]; for (int i = 0; i < rows; i++) { details[i, 0] = ds.InvoiceDetailTable[i].Zone; details[i, 1] = ds.InvoiceDetailTable[i].DeliveryCode; details[i, 2] = ds.InvoiceDetailTable[i].Store; details[i, 3] = ds.InvoiceDetailTable[i].Cartons; details[i, 4] = ds.InvoiceDetailTable[i].WeightKg; details[i, 5] = ds.InvoiceDetailTable[i].Weight; details[i, 6] = ds.InvoiceDetailTable[i].Rate; details[i, 7] = ds.InvoiceDetailTable[i].Amount; details[i, 8] = ds.InvoiceDetailTable[i].FSCSurchargePCT / 100; details[i, 9] = ds.InvoiceDetailTable[i].FuelSurcharge; details[i, 10] = ds.InvoiceDetailTable[i].TotalDistributionCharges; totalDistributionCharges += ds.InvoiceDetailTable[i].TotalDistributionCharges; } invoice.get_Range(invoice.Cells[row0 + 6, 2], invoice.Cells[row0 + 6 + rows - 1, 12]).Value2 = details; invoice.get_Range(invoice.Cells[row0 + 6, 2], invoice.Cells[row0 + 6 + rows - 1, 2]).NumberFormat = "@"; invoice.get_Range(invoice.Cells[row0 + 6, 3], invoice.Cells[row0 + 6 + rows - 1, 3]).NumberFormat = "@"; invoice.get_Range(invoice.Cells[row0 + 6, 4], invoice.Cells[row0 + 6 + rows - 1, 4]).NumberFormat = "@"; invoice.get_Range(invoice.Cells[row0 + 6, 5], invoice.Cells[row0 + 6 + rows - 1, 5]).NumberFormat = "#0"; invoice.get_Range(invoice.Cells[row0 + 6, 6], invoice.Cells[row0 + 6 + rows - 1, 6]).NumberFormat = "#0.00"; invoice.get_Range(invoice.Cells[row0 + 6, 7], invoice.Cells[row0 + 6 + rows - 1, 7]).NumberFormat = "#,##0"; invoice.get_Range(invoice.Cells[row0 + 6, 8], invoice.Cells[row0 + 6 + rows - 1, 8]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 9], invoice.Cells[row0 + 6 + rows - 1, 9]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 10], invoice.Cells[row0 + 6 + rows - 1, 10]).NumberFormat = "#0.0000 %"; invoice.get_Range(invoice.Cells[row0 + 6, 11], invoice.Cells[row0 + 6 + rows - 1, 11]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 12], invoice.Cells[row0 + 6 + rows - 1, 12]).NumberFormat = "$#,##0.00_);($#,##0.00)"; } invoice.get_Range(invoice.Cells[row0 + 6 + rows, 2], invoice.Cells[row0 + 6 + rows, 12]).Value2 = new object[1, 11] { { "", "", "", "", "", "", "", "", "", "Total:", totalDistributionCharges } }; invoice.get_Range(invoice.Cells[row0 + 6 + rows, 11], invoice.Cells[row0 + 6 + rows, 11]).HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 6 + rows, 12], invoice.Cells[row0 + 6 + rows, 12]).NumberFormat = "$#,##0.00_);($#,##0.00)"; return(_rows); }
private int createInvoiceBodyShipments(InvoiceDS.InvoiceShipmentTableRow shipment, int row0) { //Get worksheet int _rows = 0; Invoice invoice = global::Argix.Finance.Globals.Invoice; //Column headers _rows += 5; Excel.Range r = invoice.get_Range(invoice.Cells[row0 + 1, 1], invoice.Cells[row0 + 1, 12]); r.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeTop].Color = Color.Black.ToArgb(); invoice.get_Range(invoice.Cells[row0 + 1, 2], invoice.Cells[row0 + 1, 12]).Value2 = new object[1, 11] { { "Inland Charges", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 1, 2], invoice.Cells[row0 + 1, 2]).Font.Bold = true; invoice.get_Range(invoice.Cells[row0 + 2, 2], invoice.Cells[row0 + 2, 12]).Value2 = new object[1, 11] { { "", "", "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 3, 2], invoice.Cells[row0 + 3, 12]).Value2 = new object[1, 11] { { "", "", "Trucking", "Fuel", "Devanning", "", "Airline", "", "", "", "" } }; invoice.get_Range(invoice.Cells[row0 + 4, 2], invoice.Cells[row0 + 4, 12]).Value2 = new object[1, 11] { { "", "Custom DOC", "Rate", "Surcharge", "Unite", "Insurance", "Import Fee", "House B/L", "Miscellaneous", "Total Inland", "" } }; invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + 5, 12]).Value2 = new object[1, 11] { { "Shipment#", "Charges", "Charges", "Charges", "Charges", "Charges", "Charges", "Charges", "Charges", "Charges", "" } }; r = invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + 5, 11]); r.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeBottom].Color = Color.Black.ToArgb(); //Set named range summary values _rows += 1; object[,] _shipment = new object[1, 10]; _shipment[0, 0] = shipment.ShipmentNumber; _shipment[0, 1] = shipment.CustomDocCharges; _shipment[0, 2] = shipment.TruckingRatesCharges; _shipment[0, 3] = shipment.FSCCharges; _shipment[0, 4] = shipment.DevanningUniteChargtes; _shipment[0, 5] = shipment.InsuranceCharges; _shipment[0, 6] = shipment.AirLineImportFeeCharges; _shipment[0, 7] = shipment.HouseBLCharges; _shipment[0, 8] = shipment.MiscellaneousCharges; _shipment[0, 9] = shipment.TotalInlandCharges; invoice.get_Range(invoice.Cells[row0 + 6, 2], invoice.Cells[row0 + 6, 11]).Value2 = _shipment; invoice.get_Range(invoice.Cells[row0 + 6, 2], invoice.Cells[row0 + 6, 2]).NumberFormat = "@"; invoice.get_Range(invoice.Cells[row0 + 6, 3], invoice.Cells[row0 + 6, 3]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 4], invoice.Cells[row0 + 6, 4]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 5], invoice.Cells[row0 + 6, 5]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 6], invoice.Cells[row0 + 6, 6]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 7], invoice.Cells[row0 + 6, 7]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 8], invoice.Cells[row0 + 6, 8]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 9], invoice.Cells[row0 + 6, 9]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 10], invoice.Cells[row0 + 6, 10]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 6, 11], invoice.Cells[row0 + 6, 11]).NumberFormat = "$#,##0.00_);($#,##0.00)"; return(_rows); }
private int showHeader(InvoiceDS.InvoiceShipmentTableRow shipment) { //Get worksheet Invoice invoice = global::Argix.Finance.Globals.Invoice; float w = (float)(5 * invoice.StandardWidth), h = (float)invoice.StandardHeight; invoice.Shapes.AddLine(0, h / 2, 16 * w, h / 2); invoice.get_Range(invoice.Cells[2, 1], invoice.Cells[2, 11]).Value2 = new object[1, 11] { { shipment.RemitToName.Trim(), "", "", shipment.RemitToAddressLine1.Trim() + " " + shipment.RemitToAddressLine2.Trim() + " " + shipment.RemitToCity.Trim() + ", " + shipment.RemitToState + " " + shipment.RemitToZip + "-" + shipment.RemitToZip4, "", "", "", "", "", shipment.Telephone, "" } }; invoice.get_Range(invoice.Cells[2, 10], invoice.Cells[2, 11]).Merge(null); invoice.get_Range(invoice.Cells[2, 10], invoice.Cells[2, 10]).NumberFormat = "(###)_ ###-####"; invoice.Shapes.AddLine(0, 5 * h / 2, 16 * w, 5 * h / 2); invoice.get_Range(invoice.Cells[4, 1], invoice.Cells[4, 11]).Value2 = new object[1, 11] { { "", "", "", "", "", "---- INVOICE ----", "", "", "", "Invoice#: ", shipment.InvoiceNumber } }; invoice.get_Range(invoice.Cells[4, 10], invoice.Cells[4, 10]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[4, 11], invoice.Cells[4, 11]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[5, 1], invoice.Cells[5, 11]).Value2 = new object[1, 11] { { shipment.ClientNumber + " " + shipment.ClientDivision + " - ", shipment.BillToName.Trim(), "", "", "", "", "", "", "", "", "" } }; invoice.get_Range(invoice.Cells[5, 1], invoice.Cells[5, 1]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[5, 10], invoice.Cells[5, 10]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[5, 11], invoice.Cells[5, 11]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[6, 1], invoice.Cells[6, 11]).Value2 = new object[1, 11] { { "", shipment.BillToAddressline1.Trim(), "", "", "", "", "", "", "", "Invoice Date: ", shipment.InvoiceDate.ToString("MM/dd/yyyy") } }; invoice.get_Range(invoice.Cells[6, 10], invoice.Cells[6, 10]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[6, 11], invoice.Cells[6, 11]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[7, 1], invoice.Cells[7, 11]).Value2 = new object[1, 11] { { "", shipment.BillToAddressline2.Trim(), "", "", "", "", "", "", "", "Release Date: ", shipment.ReleaseDate.ToString("MM/dd/yyyy") } }; invoice.get_Range(invoice.Cells[7, 10], invoice.Cells[7, 10]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[7, 11], invoice.Cells[7, 11]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[8, 1], invoice.Cells[8, 11]).Value2 = new object[1, 11] { { "", shipment.BillToCity.Trim() + ", " + shipment.BillToState + " " + shipment.BillToZip + "-" + shipment.BillToZIP4, "", "", "", "", "", "", "", "", "" } }; return(8); }
private int showTotals(InvoiceDS.InvoiceShipmentTableDataTable shipments, int row0) { //Get worksheet int _rows = 0; Invoice invoice = global::Argix.Finance.Globals.Invoice; float w = (float)(5 * invoice.StandardWidth), h = (float)invoice.StandardHeight; //Header _rows += 1; invoice.Shapes.AddLine(0, (row0 + 0.5f) * h, 16 * w, (row0 + 0.5f) * h); //Totals _rows += 1; object[,] totals = new object[1, 16]; int qty = 0, weight = 0; decimal fs = 0.0M, dt = 0.0M; for (int i = 0; i < shipments.Rows.Count; i++) { qty += shipments[i].CtnQty; weight += shipments[i].Weight; fs += shipments[i].FuelSurcharge; dt += shipments[i].DeliveryTotal; } totals[0, 0] = "TOTAL " + shipments.Rows.Count.ToString() + " DELIVERIES"; totals[0, 1] = totals[0, 2] = totals[0, 3] = ""; totals[0, 4] = qty; totals[0, 5] = totals[0, 6] = totals[0, 7] = ""; totals[0, 8] = weight; totals[0, 9] = totals[0, 10] = totals[0, 11] = totals[0, 12] = totals[0, 13] = ""; totals[0, 14] = fs; totals[0, 15] = dt; invoice.get_Range(invoice.Cells[row0 + _rows, 1], invoice.Cells[row0 + _rows, 16]).Value2 = totals; invoice.get_Range(invoice.Cells[row0 + 2, 5], invoice.Cells[row0 + _rows, 5]).NumberFormat = "#,###_);(#,###)"; invoice.get_Range(invoice.Cells[row0 + 2, 5], invoice.Cells[row0 + _rows, 5]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 2, 9], invoice.Cells[row0 + _rows, 9]).NumberFormat = "#,##0_);(#,##0)"; invoice.get_Range(invoice.Cells[row0 + 2, 9], invoice.Cells[row0 + _rows, 9]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 2, 15], invoice.Cells[row0 + _rows, 15]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 2, 15], invoice.Cells[row0 + _rows, 15]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 2, 16], invoice.Cells[row0 + _rows, 16]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 2, 16], invoice.Cells[row0 + _rows, 16]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; //Footer _rows += 1; invoice.get_Range(invoice.Cells[row0 + _rows, 1], invoice.Cells[row0 + _rows, 16]).Value2 = new object[1, 16] { { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" } }; _rows += 1; invoice.get_Range(invoice.Cells[row0 + _rows, 1], invoice.Cells[row0 + _rows, 16]).Value2 = new object[1, 16] { { "PLEASE REFERENCE INVOICE# " + shipments[0].InvoiceNumber + " WHEN REMITTING PAYMENT I.C.C. REGULATIONS REQUIRE THAT THIS BILL BE PAID WITHIN 7 DAYS", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" } }; _rows += 1; invoice.get_Range(invoice.Cells[row0 + _rows, 1], invoice.Cells[row0 + _rows, 16]).Value2 = new object[1, 16] { { "", "", "A SERVICE CHARGE OF 1.5% PER MONTH IS ADDED TO ALL PAST DUE INVOICES", "", "", "", "", "", "", "", "", "", "", "", "", "" } }; _rows += 1; invoice.get_Range(invoice.Cells[row0 + _rows, 1], invoice.Cells[row0 + _rows, 16]).Value2 = new object[1, 16] { { "", "", "REMIT TO: " + shipments[0].RemitToName.Trim() + " " + shipments[0].RemitToAddressLine1.Trim() + " " + shipments[0].RemitToAddressLine2.Trim() + " " + shipments[0].RemitToCity.Trim() + ", " + shipments[0].RemitToState + " " + shipments[0].RemitToZip + "-" + shipments[0].RemitToZip4, "", "", "", "", "", "", "", "", "", "", "", "", "" } }; return(_rows); }
private int showShipments(InvoiceDS.InvoiceShipmentTableDataTable shipments, int row0) { //Get worksheet int _rows = 0; Invoice invoice = global::Argix.Finance.Globals.Invoice; float w = (float)(5 * invoice.StandardWidth), h = (float)invoice.StandardHeight; //Header _rows += 4; invoice.Shapes.AddLine(0, (row0 + 0.5f) * h, 16 * w, (row0 + 0.5f) * h); invoice.get_Range(invoice.Cells[row0 + 2, 1], invoice.Cells[row0 + 2, 16]).Value2 = new object[1, 16] { { "", "", "", "Location", "Ctn", "Ctn", "Plt", "Plt", "", "Rated", "Weight", "Sur", "Consolid", "Fuel", "Fuel", "Delivery" } }; invoice.get_Range(invoice.Cells[row0 + 3, 1], invoice.Cells[row0 + 3, 16]).Value2 = new object[1, 16] { { "Store Name", "State", "Zip", "Code", "Qty", "Rate", "Qty", "Rate", "Weight", "Weight", "Rate", "Charge", "Charge", "Rate", "Surcharge", "Total" } }; invoice.Shapes.AddLine(0, (row0 + 3 + 0.5f) * h, 16 * w, (row0 + 3 + 0.5f) * h); //Set named range summary values for (int i = 0; i < shipments.Rows.Count; i++) { _rows += 1; object[,] _shipment = new object[1, 16]; _shipment[0, 0] = shipments[i].StoreName.Trim(); _shipment[0, 1] = shipments[i].StoreState; _shipment[0, 2] = shipments[i].StoreZip; _shipment[0, 3] = shipments[i].LocationCode; _shipment[0, 4] = shipments[i].CtnQty; _shipment[0, 5] = shipments[i].CartonRate; _shipment[0, 6] = shipments[i].PltQty; _shipment[0, 7] = shipments[i].PalletRate; _shipment[0, 8] = shipments[i].Weight; _shipment[0, 9] = shipments[i].RatedWeight; _shipment[0, 10] = shipments[i].WeightRate; _shipment[0, 11] = shipments[i].Surcharge; _shipment[0, 12] = shipments[i].ConsolidationCharge; _shipment[0, 13] = shipments[i].FuelRate; _shipment[0, 14] = shipments[i].FuelSurcharge; _shipment[0, 15] = shipments[i].DeliveryTotal; invoice.get_Range(invoice.Cells[row0 + _rows, 1], invoice.Cells[row0 + _rows, 16]).Value2 = _shipment; } #region Cell Formats invoice.get_Range(invoice.Cells[row0 + 5, 1], invoice.Cells[row0 + _rows, 1]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[row0 + 5, 2], invoice.Cells[row0 + _rows, 2]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[row0 + 5, 3], invoice.Cells[row0 + _rows, 3]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[row0 + 5, 4], invoice.Cells[row0 + _rows, 4]).HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft; invoice.get_Range(invoice.Cells[row0 + 5, 5], invoice.Cells[row0 + _rows, 5]).NumberFormat = "#,###_);(#,###)"; invoice.get_Range(invoice.Cells[row0 + 5, 5], invoice.Cells[row0 + _rows, 5]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 6], invoice.Cells[row0 + _rows, 6]).NumberFormat = "#,###.##_);(#,###.##);_(* _)"; invoice.get_Range(invoice.Cells[row0 + 5, 6], invoice.Cells[row0 + _rows, 6]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 7], invoice.Cells[row0 + _rows, 7]).NumberFormat = "#,###_);(#,###)"; invoice.get_Range(invoice.Cells[row0 + 5, 7], invoice.Cells[row0 + _rows, 7]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 8], invoice.Cells[row0 + _rows, 8]).NumberFormat = "#,###.##_);(#,###.##);_(* _)"; invoice.get_Range(invoice.Cells[row0 + 5, 8], invoice.Cells[row0 + _rows, 8]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 9], invoice.Cells[row0 + _rows, 9]).NumberFormat = "#,##0_);(#,##0)"; invoice.get_Range(invoice.Cells[row0 + 5, 9], invoice.Cells[row0 + _rows, 9]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 10], invoice.Cells[row0 + _rows, 10]).NumberFormat = "#,##0_);(#,##0)"; invoice.get_Range(invoice.Cells[row0 + 5, 10], invoice.Cells[row0 + _rows, 10]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 11], invoice.Cells[row0 + _rows, 11]).NumberFormat = "#,##0.00_);(#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 5, 11], invoice.Cells[row0 + _rows, 11]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 12], invoice.Cells[row0 + _rows, 12]).NumberFormat = "$#,##0.00_);($#,##0.00);_(* _)"; invoice.get_Range(invoice.Cells[row0 + 5, 12], invoice.Cells[row0 + _rows, 12]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 13], invoice.Cells[row0 + _rows, 13]).NumberFormat = "$#,##0.00_);($#,##0.00);_(* _)"; invoice.get_Range(invoice.Cells[row0 + 5, 13], invoice.Cells[row0 + _rows, 13]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 14], invoice.Cells[row0 + _rows, 14]).NumberFormat = "#,##0.0000_);(#,##0.0000)"; invoice.get_Range(invoice.Cells[row0 + 5, 14], invoice.Cells[row0 + _rows, 14]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 15], invoice.Cells[row0 + _rows, 15]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 5, 15], invoice.Cells[row0 + _rows, 15]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; invoice.get_Range(invoice.Cells[row0 + 5, 16], invoice.Cells[row0 + _rows, 16]).NumberFormat = "$#,##0.00_);($#,##0.00)"; invoice.get_Range(invoice.Cells[row0 + 5, 16], invoice.Cells[row0 + _rows, 16]).HorizontalAlignment = Excel.XlHAlign.xlHAlignRight; #endregion return(_rows); }