private void showSummary(InvoiceDS ds) { //Set named range summary values Detail detail = global::Argix.Finance.Globals.Detail; InvoiceDS.ClientInvoiceWithStoreBLNumbersTableRow invoice = ds.ClientInvoiceWithStoreBLNumbersTable[0]; //Bill To detail.BillToName.Value = invoice.BillToName.Trim(); detail.BillToAddressLine1.Value = invoice.BillToAddressline1.Trim(); detail.BillToAddressLine2.Value = invoice.BillToAddressline2.Trim(); detail.BillToCityStateZip.Value = invoice.BillToCity.Trim() + ", " + invoice.BillToState.Trim() + " " + invoice.BillToZip.Trim() + "-" + invoice.BillToZIP4.Trim(); //Account detail.InvoiceNumber.Value = invoice.InvoiceNumber.Trim(); detail.InvoiceDate.Value = invoice.InvoiceDate; //summary.Terms1.Value = invoice.Terms; //Remit To detail.RemitToName.Value = invoice.RemitToName.Trim(); detail.RemitToAddressLine1.Value = invoice.RemitToAddressLine1.Trim(); // detail.RemitToAddressLine2.Value = invoice.RemitToAddressLine2.Trim(); detail.RemitToCityStateZip.Value = invoice.RemitToCity.Trim() + ", " + invoice.RemitToState.Trim() + " " + invoice.RemitToZip.Trim(); detail.Telephone.Value = invoice.Telephone.Trim(); detail.ClientNumberDiv.Value = invoice.ClientNumber.Trim() + ' ' + invoice.ClientDivision.Trim(); }
//Interface private void ThisWorkbook_Startup(object sender, System.EventArgs e) { //Event handler for workbook startup event try { System.IntPtr p = GetCommandLine(); string cmd = System.Runtime.InteropServices.Marshal.PtrToStringAuto(p); string clid = "", invoice = ""; //L15427 if (cmd != null) { string query = cmd.Substring(cmd.IndexOf('?') + 1); string[] args = query.Split('&'); if (args.Length > 0) { clid = args[0].Substring(args[0].IndexOf("=") + 1).Trim(); } if (args.Length > 1) { invoice = args[1].Substring(args[1].IndexOf("=") + 1).Trim(); } } DialogResult result = DialogResult.OK; if (invoice.Length == 0) { dlgInvoice dlg = new dlgInvoice(); result = dlg.ShowDialog(); invoice = dlg.InvoiceNumber; } if (result == DialogResult.OK) { //Get shipments and shipment details SqlDataAdapter adapter = new SqlDataAdapter(USP_SHIPMENT, global::Argix.Finance.Settings.Default.SQLConnection); adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddRange(new SqlParameter[] { new SqlParameter("@InvoiceNumber", invoice) }); InvoiceDS ds = new InvoiceDS(); adapter.Fill(ds, TBL_SHIPMENT); adapter.SelectCommand.CommandText = USP_DETAIL; adapter.Fill(ds, TBL_DETAIL); adapter.SelectCommand.CommandText = USP_TOTALS; adapter.Fill(ds, TBL_TOTALS); int rows = ROW0_DETAIL; createInvoiceHeader(invoice, ds.InvoiceTotalTable[0]); for (int i = 0; i < ds.InvoiceShipmentTable.Rows.Count; i++) { //Show each shipment rows = rows + createInvoiceBodyShipments(ds.InvoiceShipmentTable[i], rows); //Show details for each shipment InvoiceDS _ds = new InvoiceDS(); _ds.Merge(ds.InvoiceDetailTable.Select("ShipmentNumber='" + ds.InvoiceShipmentTable[i].ShipmentNumber + "'")); rows = rows + createInvoiceBodyDetails(_ds, rows); rows++; //Add break } createInvoiceTotals(ds.InvoiceTotalTable[0], rows); } } catch (Exception ex) { reportError(ex); } }
private void showSummary(InvoiceDS ds) { //Set named range summary values Summary summary = global::Argix.Finance.Globals.Summary; InvoiceDS.InvoiceSummaryTableRow invoice = ds.InvoiceSummaryTable[0]; //Bill To summary.BillToName.Value = invoice.BillToName.Trim(); summary.BillToAddressLine1.Value = invoice.BillToAddressline1.Trim(); if (!invoice.IsBillToAddressline2Null()) { summary.BillToAddressLine2.Value = invoice.BillToAddressline2.Trim(); } summary.BillToCityStateZip.Value = invoice.BillToCity.Trim() + ", " + invoice.BillToState.Trim() + " " + invoice.BillToZip.Trim() + "-" + invoice.BillToZIP4.Trim(); //Account summary.Account.Value = invoice._Account_.Trim(); summary.InvoiceNumber.Value = invoice.InvoiceNumber.Trim(); summary.InvoiceDate.Value = invoice.InvoiceDate; summary.Terms1.Value = invoice.Terms; //Remit To summary.RemitToName.Value = invoice.RemitToName.Trim(); summary.RemitToAddressLine1.Value = invoice.RemitToAddressLine1.Trim(); if (!invoice.IsRemitToAddressLine2Null()) { summary.RemitToAddressLine2.Value = invoice.RemitToAddressLine2.Trim(); } summary.RemitToCityStateZip.Value = invoice.RemitToCity.Trim() + ", " + invoice.RemitToState.Trim() + " " + invoice.RemitToZip.Trim() + "-" + invoice.RemitToZip4.Trim(); //Shipment if (!invoice.IsShipmentDayNull()) { summary.ShipmentDay.Value = invoice.ShipmentDay; } if (!invoice.IsPiecesNull()) { summary.Pieces.Value = invoice.Pieces; } if (!invoice.IsWeightNull()) { summary.Weight.Value = invoice.Weight; } if (!invoice.IsDeliveryChargesNull()) { summary.DeliveryCharges.Value = invoice.DeliveryCharges; } if (!invoice.IsLinehaulChargesNull()) { summary.LineHaulCharges.Value = invoice.LinehaulCharges; } }
//Interface private void ThisWorkbook_Startup(object sender, System.EventArgs e) { //Event handler for workbook startup event try { System.IntPtr p = GetCommandLine(); string cmd = System.Runtime.InteropServices.Marshal.PtrToStringAuto(p); string clid = "", invoice = ""; //320914600 if (cmd != null) { string query = cmd.Substring(cmd.IndexOf('?') + 1); string[] args = query.Split('&'); if (args.Length > 0) { clid = args[0].Substring(args[0].IndexOf("=") + 1).Trim(); } if (args.Length > 1) { invoice = args[1].Substring(args[1].IndexOf("=") + 1).Trim(); } } if (invoice.Length > 0) { //Create detail worksheet try { SqlDataAdapter adapter = new SqlDataAdapter(USP_DETAIL, global::Argix.Finance.Settings.Default.SQLConnection); adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddRange(new SqlParameter[] { new SqlParameter("@InvoiceNumber", invoice) }); adapter.TableMappings.Add("Table", TBL_DETAIL); InvoiceDS ds = new InvoiceDS(); adapter.Fill(ds, TBL_DETAIL); if (ds.Tables[TBL_DETAIL].Rows.Count > 0) { createDetailHeader(ds.ClientInvoiceTable[0]); createDetailBody(ds.ClientInvoiceTable); } else { MessageBox.Show("No data found for invoice #" + invoice + "."); } } catch (Exception ex) { reportError(ex); } } else { MessageBox.Show("Invoice unspecified."); } } catch (Exception ex) { reportError(ex); } }
//Interface private void ThisWorkbook_Startup(object sender, System.EventArgs e) { //Event handler for workbook startup event try { System.IntPtr p = GetCommandLine(); string cmd = System.Runtime.InteropServices.Marshal.PtrToStringAuto(p); string clid = "", invoice = ""; if (cmd != null) { string query = cmd.Substring(cmd.IndexOf('?') + 1); string[] args = query.Split('&'); if (args.Length > 0) { clid = args[0].Substring(args[0].IndexOf("=") + 1).Trim(); } if (args.Length > 1) { invoice = args[1].Substring(args[1].IndexOf("=") + 1).Trim(); } } DialogResult result = DialogResult.OK; if (invoice.Length == 0) { dlgInvoice dlg = new dlgInvoice(); result = dlg.ShowDialog(); invoice = dlg.InvoiceNumber; } if (result == DialogResult.OK) { //Display summary and detail data try { SqlDataAdapter adapter = new SqlDataAdapter(USP_DETAIL, global::Argix.Finance.Settings.Default.SQLConnection); adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddRange(new SqlParameter[] { new SqlParameter("@InvoiceNumber", invoice) }); adapter.TableMappings.Add("Table", TBL_DETAIL); InvoiceDS detailDS = new InvoiceDS(); adapter.Fill(detailDS, TBL_DETAIL); showSummary(detailDS); showDetail(detailDS.ClientInvoiceWithStoreBLNumbersTable); } catch (Exception ex) { reportError(ex); } } } catch (Exception ex) { reportError(ex); } }
public Invoices GetClientInvoices(string clientNumber, string clientDivision, string startDate) { //Get a list of clients invoices filtered for a specific division Invoices invoices = null; try { invoices = new Invoices(); DataSet ds = fillDataset(USP_INVOICES, TBL_INVOICES, new object[] { clientNumber, clientDivision, startDate }); if (ds.Tables[TBL_INVOICES].Rows.Count > 0) { InvoiceDS __invoices = new InvoiceDS(); __invoices.Merge(ds); string filter = getInvoiceFilter(clientNumber); InvoiceDS _invoices = new InvoiceDS(); _invoices.Merge(__invoices.ClientInvoiceTable.Select(filter, "InvoiceNumber ASC")); System.Xml.XmlNode node = InvoicingConfig.Document.DocumentElement.SelectSingleNode("//client[@number='" + clientNumber + "']"); if (node != null) { System.Xml.XmlNode inv = node.SelectSingleNode("invoices"); if (inv != null) { for (int i = 0; i < _invoices.ClientInvoiceTable.Rows.Count; i++) { string invoiceType = _invoices.ClientInvoiceTable[i].InvoiceTypeCode.Trim(); if (inv.Attributes[invoiceType] != null) { _invoices.ClientInvoiceTable[i].InvoiceTypeTarget = inv.Attributes[invoiceType].Value; } Invoice invoice = new Invoice(_invoices.ClientInvoiceTable[i]); invoices.Add(invoice); } } } } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating client invoice list.", ex); } return(invoices); }
//Interface private void ThisWorkbook_Startup(object sender, System.EventArgs e) { //Event handler for workbook startup event try { System.IntPtr p = GetCommandLine(); string cmd = System.Runtime.InteropServices.Marshal.PtrToStringAuto(p); string clid = "", invoice = ""; if (cmd != null) { string query = cmd.Substring(cmd.IndexOf('?') + 1); string[] args = query.Split('&'); if (args.Length > 0) { clid = args[0].Substring(args[0].IndexOf("=") + 1).Trim(); } if (args.Length > 1) { invoice = args[1].Substring(args[1].IndexOf("=") + 1).Trim(); } } if (invoice.Length > 0) { //Display shipment data SqlDataAdapter adapter = new SqlDataAdapter(USP_SHIPMENT, global::Argix.Finance.Settings.Default.TSortR); adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.SelectCommand.Parameters.AddRange(new SqlParameter[] { new SqlParameter("@InvoiceNumber", invoice) }); adapter.TableMappings.Add("Table", TBL_SHIPMENT); InvoiceDS shipmentDS = new InvoiceDS(); adapter.Fill(shipmentDS, TBL_SHIPMENT); int rows = 0; rows = rows + showHeader(shipmentDS.InvoiceShipmentTable[0]); rows = rows + showShipments(shipmentDS.InvoiceShipmentTable, rows); showTotals(shipmentDS.InvoiceShipmentTable, rows); } else { MessageBox.Show("Invoice unspecified."); } } catch (Exception ex) { reportError(ex); } }
private void OnFormLoad(object sender, EventArgs e) { //Event handler for form load event this.Cursor = Cursors.WaitCursor; try { //Get client list SqlDataAdapter adapter = new SqlDataAdapter(USP_CLIENT, global::Argix.Finance.Settings.Default.SQLConnection); adapter.SelectCommand.CommandType = CommandType.StoredProcedure; adapter.TableMappings.Add("Table", TBL_CLIENT); DataSet _ds = new DataSet(); adapter.Fill(_ds, TBL_CLIENT); InvoiceDS ds = new InvoiceDS(); string clientID = global::Argix.Finance.Settings.Default.ClientID; if (clientID.Length > 0) { ds.Merge(_ds.Tables[TBL_CLIENT].Select("DivisionNumber = '01' AND (" + clientID + ")")); } else { ds.Merge(_ds); } this.mInvoiceDS.Merge(ds); if (this.cboClient.Items.Count > 0) { if (clientID.Length > 0) { this.cboClient.SelectedValue = clientID; } else { this.cboClient.SelectedIndex = 0; } } OnClientSelected(null, EventArgs.Empty); this.cboClient.Enabled = this.cboClient.Items.Count > 0; } catch (Exception ex) { reportError(ex); } finally { setUserServices(); this.Cursor = Cursors.Default; } }
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 void showTLDetail(InvoiceDS ds) { //Get worksheet TLDetail detail = global::Argix.Finance.Globals.TLDetail; //Header int rows = ds.InvoiceTLDetailTable.Rows.Count; if (rows == 0) { return; } detail.PerGallonTL.Value = ds.InvoiceTLDetailTable[0].PerGallon; //Detail object[,] trip = new object[rows, 1]; object[,] departdate = new object[rows, 1]; object[,] unloaddate = new object[rows, 1]; object[,] trailer = new object[rows, 1]; object[,] miles = new object[rows, 1]; object[,] ratepermile = new object[rows, 1]; object[,] fscpermile = new object[rows, 1]; object[,] totalmiles = new object[rows, 1]; object[,] trailerchg = new object[rows, 1]; object[,] totalweight = new object[rows, 1]; object[,] costperlb = new object[rows, 1]; object[,] bol = new object[rows, 1]; for (int i = 0; i < rows; i++) { trip[i, 0] = ds.InvoiceTLDetailTable[i].Trip; if (!ds.InvoiceTLDetailTable[i].IsDepartureDateNull()) { departdate[i, 0] = ds.InvoiceTLDetailTable[i].DepartureDate; } if (!ds.InvoiceTLDetailTable[i].IsUnloadDateNull()) { unloaddate[i, 0] = ds.InvoiceTLDetailTable[i].UnloadDate; } if (!ds.InvoiceTLDetailTable[i].IsTrailerNumberNull()) { trailer[i, 0] = ds.InvoiceTLDetailTable[i].TrailerNumber.Trim(); } if (!ds.InvoiceTLDetailTable[i].IsMilesNull()) { miles[i, 0] = ds.InvoiceTLDetailTable[i].Miles; } if (!ds.InvoiceTLDetailTable[i].IsRatePerMileNull()) { ratepermile[i, 0] = ds.InvoiceTLDetailTable[i].RatePerMile; } if (!ds.InvoiceTLDetailTable[i].IsFCSPerMileNull()) { fscpermile[i, 0] = ds.InvoiceTLDetailTable[i].FCSPerMile; } if (!ds.InvoiceTLDetailTable[i].IsTotalPerMileNull()) { totalmiles[i, 0] = ds.InvoiceTLDetailTable[i].TotalPerMile; } if (!ds.InvoiceTLDetailTable[i].IsTrailerChargeNull()) { trailerchg[i, 0] = ds.InvoiceTLDetailTable[i].TrailerCharge; } if (!ds.InvoiceTLDetailTable[i].IsTotalWeightNull()) { totalweight[i, 0] = ds.InvoiceTLDetailTable[i].TotalWeight; } if (!ds.InvoiceTLDetailTable[i].IsCostPerPoundNull()) { costperlb[i, 0] = ds.InvoiceTLDetailTable[i].CostPerPound; } if (!ds.InvoiceTLDetailTable[i].IsBLNumberNull()) { bol[i, 0] = ds.InvoiceTLDetailTable[i].BLNumber; } } detail.get_Range(detail.Cells[4, 1], detail.Cells[3 + rows, 1]).Value2 = trip; detail.get_Range(detail.Cells[4, 2], detail.Cells[3 + rows, 2]).Value2 = departdate; detail.get_Range(detail.Cells[4, 3], detail.Cells[3 + rows, 3]).Value2 = unloaddate; detail.get_Range(detail.Cells[4, 4], detail.Cells[3 + rows, 4]).Value2 = trailer; detail.get_Range(detail.Cells[4, 5], detail.Cells[3 + rows, 5]).Value2 = miles; detail.get_Range(detail.Cells[4, 6], detail.Cells[3 + rows, 6]).Value2 = ratepermile; detail.get_Range(detail.Cells[4, 7], detail.Cells[3 + rows, 7]).Value2 = fscpermile; detail.get_Range(detail.Cells[4, 8], detail.Cells[3 + rows, 8]).Value2 = totalmiles; detail.get_Range(detail.Cells[4, 9], detail.Cells[3 + rows, 9]).Value2 = trailerchg; detail.get_Range(detail.Cells[4, 11], detail.Cells[3 + rows, 11]).Value2 = totalweight; detail.get_Range(detail.Cells[4, 12], detail.Cells[3 + rows, 12]).Value2 = costperlb; detail.get_Range(detail.Cells[4, 13], detail.Cells[3 + rows, 13]).Value2 = bol; }
private void showDetail(InvoiceDS ds) { //Get worksheet Detail detail = global::Argix.Finance.Globals.Detail; //Header int rows = ds.InvoiceDetailTable.Rows.Count; if (rows == 0) { return; } detail.Manifests.Value = ds.InvoiceDetailTable[0].ManifestNumbers; detail.PerGallon.Value = ds.InvoiceDetailTable[0].PerGallon; detail.FSC.Value = ds.InvoiceDetailTable[0].FSCPercentage / 100; //Detail object[,] destZip = new object[rows, 1]; object[,] store = new object[rows, 1]; object[,] city = new object[rows, 1]; object[,] state = new object[rows, 1]; object[,] pieces = new object[rows, 1]; object[,] weight = new object[rows, 1]; object[,] delivrate = new object[rows, 1]; object[,] delivchgs = new object[rows, 1]; object[,] fuelsurchg = new object[rows, 1]; object[,] totaldelivchgs = new object[rows, 1]; object[,] lhalloc = new object[rows, 1]; object[,] totalchgs = new object[rows, 1]; for (int i = 0; i < rows; i++) { if (!ds.InvoiceDetailTable[i].IsDestinationZipNull()) { destZip[i, 0] = ds.InvoiceDetailTable[i].DestinationZip; } if (!ds.InvoiceDetailTable[i].IsStoreNumberNull()) { store[i, 0] = ds.InvoiceDetailTable[i].StoreNumber; } if (!ds.InvoiceDetailTable[i].IsStoreCityNull()) { city[i, 0] = ds.InvoiceDetailTable[i].StoreCity; } if (!ds.InvoiceDetailTable[i].IsDestinationStateNull()) { state[i, 0] = ds.InvoiceDetailTable[i].DestinationState; } if (!ds.InvoiceDetailTable[i].IsTotalPiecesNull()) { pieces[i, 0] = ds.InvoiceDetailTable[i].TotalPieces; } if (!ds.InvoiceDetailTable[i].IsTotalWeightNull()) { weight[i, 0] = ds.InvoiceDetailTable[i].TotalWeight; } if (!ds.InvoiceDetailTable[i].IsDeliveryRateNull()) { delivrate[i, 0] = ds.InvoiceDetailTable[i].DeliveryRate; } if (!ds.InvoiceDetailTable[i].IsDeliveryChargesNull()) { delivchgs[i, 0] = ds.InvoiceDetailTable[i].DeliveryCharges; } if (!ds.InvoiceDetailTable[i].IsFuelSurchargeNull()) { fuelsurchg[i, 0] = ds.InvoiceDetailTable[i].FuelSurcharge; } if (!ds.InvoiceDetailTable[i].IsTotalDeliveryChargesNull()) { totaldelivchgs[i, 0] = ds.InvoiceDetailTable[i].TotalDeliveryCharges; } if (!ds.InvoiceDetailTable[i].IsLHAllocationNull()) { lhalloc[i, 0] = ds.InvoiceDetailTable[i].LHAllocation; } if (!ds.InvoiceDetailTable[i].IsTotalChargesNull()) { totalchgs[i, 0] = ds.InvoiceDetailTable[i].TotalCharges; } } detail.get_Range(detail.Cells[4, 1], detail.Cells[3 + rows, 1]).Value2 = destZip; detail.get_Range(detail.Cells[4, 2], detail.Cells[3 + rows, 2]).Value2 = store; detail.get_Range(detail.Cells[4, 3], detail.Cells[3 + rows, 3]).Value2 = city; detail.get_Range(detail.Cells[4, 4], detail.Cells[3 + rows, 4]).Value2 = state; detail.get_Range(detail.Cells[4, 5], detail.Cells[3 + rows, 5]).Value2 = pieces; detail.get_Range(detail.Cells[4, 6], detail.Cells[3 + rows, 6]).Value2 = weight; detail.get_Range(detail.Cells[4, 7], detail.Cells[3 + rows, 7]).Value2 = delivrate; detail.get_Range(detail.Cells[4, 8], detail.Cells[3 + rows, 8]).Value2 = delivchgs; detail.get_Range(detail.Cells[4, 9], detail.Cells[3 + rows, 9]).Value2 = fuelsurchg; detail.get_Range(detail.Cells[4, 10], detail.Cells[3 + rows, 10]).Value2 = totaldelivchgs; detail.get_Range(detail.Cells[4, 11], detail.Cells[3 + rows, 11]).Value2 = lhalloc; detail.get_Range(detail.Cells[4, 12], detail.Cells[3 + rows, 12]).Value2 = totalchgs; }