private static void AddDetailSectionHdr(ref PdfPTable table, Font labelFont, Font normalFont)
        {
            // Detail column headers (2 lines)
            PdfReports.AddText2Table(table, "Contract", labelFont, "center");
            PdfReports.AddText2Table(table, "Contract", labelFont, "center");
            PdfReports.AddText2Table(table, "Contract", labelFont, "center");
            PdfReports.AddText2Table(table, "Landowner", labelFont, "center");
            PdfReports.AddText2Table(table, "Final ", labelFont, "center");
            PdfReports.AddText2Table(table, " ", labelFont, "center");
            PdfReports.AddText2Table(table, " ", labelFont, "center");
            PdfReports.AddText2Table(table, "Tons Per", labelFont, "center");
            PdfReports.AddText2Table(table, " ", labelFont, "center");
            PdfReports.AddText2Table(table, "Lbs. Ext.", labelFont, "center");

            PdfReports.AddText2Table(table, "Factory", labelFont, "center");
            PdfReports.AddText2Table(table, "Station", labelFont, "center");
            PdfReports.AddText2Table(table, "No", labelFont, "center");
            PdfReports.AddText2Table(table, "Name", labelFont, "center");
            PdfReports.AddText2Table(table, "Net Tons", labelFont, "center");
            PdfReports.AddText2Table(table, "Sugar %", labelFont, "center");
            PdfReports.AddText2Table(table, "Tare %", labelFont, "center");
            PdfReports.AddText2Table(table, "Acre", labelFont, "center");
            PdfReports.AddText2Table(table, "SLM %", labelFont, "center");
            PdfReports.AddText2Table(table, "Sugar/Ton", labelFont, "center");
        }
Exemple #2
0
 private static void AddPatronageRedeemDetailHeader(PdfPTable detailTable)
 {
     PdfReports.AddText2Table(detailTable, "Crop Year", _labelFont, "center");
     PdfReports.AddText2Table(detailTable, " ", _labelFont, "right");
     PdfReports.AddText2Table(detailTable, " ", _labelFont, "right");
     PdfReports.AddText2Table(detailTable, "Total Dollars", _labelFont, "right");
 }
        public static void AddTruckTotals(ref Document document, string loadCount, string dirtWeight, string netWeight, DailyGrowerTareDetailEvent pgEvent)
        {
            const string METHOD_NAME = "AddTruckTotals";

            try {
                PdfPTable table = PdfReports.CreateTable(_primaryTableLayout, 1);

                // Let the PDF Page event handler take care of adding column labels on page breaks.
                pgEvent.HeaderNameList    = _truckDetailHdrNames;
                pgEvent.HeaderTableLayout = _primaryTableLayout;

                PdfReports.AddText2Table(table, " ", _normalFont);
                PdfReports.AddText2Table(table, "Load Count:", _labelFont);
                PdfReports.AddText2Table(table, loadCount, _normalFont);
                PdfReports.AddText2Table(table, " ", _normalFont);
                PdfReports.AddText2Table(table, " ", _normalFont);
                PdfReports.AddText2Table(table, dirtWeight, _normalFont, "right");
                PdfReports.AddText2Table(table, " ", _normalFont);
                PdfReports.AddText2Table(table, netWeight, _normalFont, "right");
                PdfReports.AddText2Table(table, " ", _normalFont, _primaryTableLayout.Length);

                PdfReports.AddTableNoSplit(document, pgEvent, table);
                pgEvent.HeaderNameList    = null;
                pgEvent.HeaderTableLayout = null;
            }
            catch (Exception ex) {
                WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + "." + METHOD_NAME, ex);
                throw (wscEx);
            }
        }
        private static void AddSampleHdr(ref Document document, SqlDataReader drHdr, int cropYear, DailyGrowerTareDetailEvent pgEvent)
        {
            PdfPTable table = PdfReports.CreateTable(_primaryTableLayout, 1);

            PdfReports.AddText2Table(table, "Delivery Date", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetString(drHdr.GetOrdinal("Delivery_Date")), _normalFont);
            PdfReports.AddText2Table(table, "1st Net Lbs", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetInt32(drHdr.GetOrdinal("First_Net_Pounds")).ToString(), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, "% Sugar", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetDecimal(drHdr.GetOrdinal("Sugar_Content")).ToString("0.00"), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);

            PdfReports.AddText2Table(table, "Station No", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetInt32(drHdr.GetOrdinal("Delivery_Station_No")).ToString(), _normalFont);
            PdfReports.AddText2Table(table, "Tare Lbs", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetInt32(drHdr.GetOrdinal("Tare_Pounds")).ToString(), _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetDecimal(drHdr.GetOrdinal("Tare")).ToString("0.00"), _normalFont);
            PdfReports.AddText2Table(table, "SLM", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetDecimal(drHdr.GetOrdinal("SLM_Pct")).ToString("0.0000"), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);

            PdfReports.AddText2Table(table, "Station Name", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetString(drHdr.GetOrdinal("Delivery_Station_Name")), _normalFont);
            PdfReports.AddText2Table(table, "Final Net Lbs", _normalFont);
            PdfReports.AddText2Table(table, drHdr.GetInt32(drHdr.GetOrdinal("Final_Net_Pounds")).ToString(), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, "Lbs Extractable Sugar/Ton", _normalFont, 2);
            PdfReports.AddText2Table(table, drHdr.GetInt32(drHdr.GetOrdinal("ExSugarPerTon")).ToString(), _normalFont);
            PdfReports.AddText2Table(table, " ", _labelFont, _primaryTableLayout.Length);
            PdfReports.AddTableNoSplit(document, pgEvent, table);
        }
        //public override void OnEndPage(PdfWriter writer, Document document) {

        //    String text = "Page " + writer.PageNumber.ToString();
        //    float len = bf.GetWidthPoint(text, 8);
        //    cb.BeginText();
        //    cb.SetFontAndSize(bf, 8);
        //    cb.SetTextMatrix(280, 30);
        //    cb.ShowText(text);
        //    cb.EndText();

        //    base.OnEndPage(writer, document);

        //    //int pageN = writer.PageNumber;
        //    ////string text = "Page " + pageN + " of ";
        //    //string text = "Page " + pageN;
        //    //float len = bf.GetWidthPoint(text, 8);
        //    //cb.BeginText();
        //    //cb.SetFontAndSize(bf, 8);
        //    //cb.SetTextMatrix(300, 30);
        //    //cb.ShowText(text);
        //    //cb.EndText();
        //    //cb.AddTemplate(template, 300 + len, 30);

        //    //base.OnEndPage(writer, document);
        //}

        // Used to supply end of document values to template.
        //public override void OnCloseDocument(PdfWriter writer, Document document) {

        //    // add template text to document here.
        //    template.BeginText();
        //    template.SetFontAndSize(bf, 8);
        //    template.ShowText((writer.PageNumber - 1).ToString());
        //    template.EndText();

        //    base.OnCloseDocument(writer, document);
        //}

        public override void OnStartPage(PdfWriter writer, Document document)
        {
            if (!_isDocumentClosing)
            {
                // ===========================================================================
                // Create header column -- in this report this is the page's column object
                // ===========================================================================
                ct.SetSimpleColumn(PortraitPageSize.HdrLowerLeftX, PortraitPageSize.HdrLowerLeftY,
                                   PortraitPageSize.HdrUpperRightX, PortraitPageSize.HdrUpperRightY,
                                   PortraitPageSize.PgLeading, Element.ALIGN_CENTER);
                ct.YLine = PortraitPageSize.HdrTopYLine;

                // We need a greyed (hidden) header having Trans# in the far left corner and Contract# in the far right corner.
                PdfPTable table = PdfReports.CreateTable(_headerLayout, 0);

                // Line 1
                PdfReports.AddText2Table(table, DateTime.Now.ToShortDateString(), _subNormalFont);

                PdfReports.AddText2Table(table, "Western Sugar Cooperative\n" +
                                         "Contract/Delivery Summary\n" +
                                         "Crop Year " + _cropYear, _titleFont, "center");

                PdfReports.AddImage2Table(table, _imgLogo);

                PdfReports.AddText2Table(table, " ", _normalFont, _headerLayout.Length);
                PdfReports.AddText2Table(table, " ", _normalFont, _headerLayout.Length);
                PdfReports.AddText2Table(table, " ", _normalFont, _headerLayout.Length);

                PdfReports.AddTableNoSplit(document, this, table);
                _headerBottomYLine = ct.YLine;
            }

            base.OnStartPage(writer, document);
        }
Exemple #6
0
        private static void AddSampleHdr(ref Document document, ListGrowerTareItem hdrItem, int cropYear, DailyGrowerTareDetailEvent pgEvent)
        {
            PdfPTable table = PdfReports.CreateTable(_primaryTableLayout, 1);

            PdfReports.AddText2Table(table, "Delivery Date", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Delivery_Date, _normalFont);
            PdfReports.AddText2Table(table, "1st Net Lbs", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.First_Net_Pounds.ToString(), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, "% Sugar", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Sugar_Content.ToString("0.00"), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);

            PdfReports.AddText2Table(table, "Station No", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Delivery_Station_No, _normalFont);
            PdfReports.AddText2Table(table, "Tare Lbs", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Tare_Pounds.ToString(), _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Tare.ToString("0.00"), _normalFont);
            PdfReports.AddText2Table(table, "SLM", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.SLM_Pct.ToString("0.0000"), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);

            PdfReports.AddText2Table(table, "Station Name", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Delivery_Station_Name, _normalFont);
            PdfReports.AddText2Table(table, "Final Net Lbs", _normalFont);
            PdfReports.AddText2Table(table, hdrItem.Final_Net_Pounds.ToString(), _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, "Lbs Extractable Sugar/Ton", _normalFont, 2);
            PdfReports.AddText2Table(table, hdrItem.ExSugarPerTon.ToString(), _normalFont);
            PdfReports.AddText2Table(table, " ", _labelFont, _primaryTableLayout.Length);
            PdfReports.AddTableNoSplit(document, pgEvent, table);
        }
        private static void AddDetailTable(PdfPTable detailTable, List <ListDirectDeliveryStatementItem> stateList, int index,
                                           decimal subTotalFirstNetTons, decimal subTotalNinetySixPct, decimal subTotalPayAmt)
        {
            const string METHOD_NAME = "AddDetailTable";

            int    maxIndex = stateList.Count;
            string payee    = stateList[index].Payee;

            try {
                // Create the Header
                PdfReports.AddText2Table(detailTable, "Cont", _labelFont, "center");
                PdfReports.AddText2Table(detailTable, "SHID", _labelFont, "center");
                //PdfReports.AddText2Table(detailTable, "Payee", _labelFont, "center");

                PdfReports.AddText2Table(detailTable, "Pay Amt", _labelFont, "center");
                PdfReports.AddText2Table(detailTable, "1st Net Tons", _labelFont, "center");
                PdfReports.AddText2Table(detailTable, "D Station", _labelFont, "center");

                PdfReports.AddText2Table(detailTable, "C Station", _labelFont, "center");
                PdfReports.AddText2Table(detailTable, "96%", _labelFont, "center");
                PdfReports.AddText2Table(detailTable, "Rate", _labelFont, "center");

                // Add the Details
                while (index < maxIndex && stateList[index].Payee == payee)
                {
                    ListDirectDeliveryStatementItem state = stateList[index];

                    PdfReports.AddText2Table(detailTable, state.ContractNumber, _normalFont, "center");
                    PdfReports.AddText2Table(detailTable, state.Shid, _normalFont, "center");
                    //PdfReports.AddText2Table(detailTable, state.Payee, _normalFont, "left");

                    PdfReports.AddText2Table(detailTable, Math.Round(state.PaymentAmount, 2).ToString("0.00"), _normalFont, "right");
                    PdfReports.AddText2Table(detailTable, state.FirstNetTons.ToString("0.0000"), _normalFont, "right");
                    PdfReports.AddText2Table(detailTable, state.DeliveryStationName, _normalFont, "center");

                    PdfReports.AddText2Table(detailTable, state.ContractStationName, _normalFont, "center");
                    PdfReports.AddText2Table(detailTable, state.NinetySixPct.ToString("0.0000"), _normalFont, "right");
                    PdfReports.AddText2Table(detailTable, state.RatePerTon.ToString("0.0000"), _normalFont, "right");

                    index += 1;
                }

                // Add Sub Totals
                PdfReports.AddText2Table(detailTable, " ", _normalFont, "center");
                //PdfReports.AddText2Table(detailTable, " ", _normalFont, "center");
                PdfReports.AddText2Table(detailTable, "Total", _labelFont, "center");

                PdfReports.AddText2Table(detailTable, Math.Round(subTotalPayAmt, 2).ToString("0.00"), _labelFont, "right");
                PdfReports.AddText2Table(detailTable, subTotalFirstNetTons.ToString("0.0000"), _labelFont, "right");
                PdfReports.AddText2Table(detailTable, " ", _normalFont, "center");

                PdfReports.AddText2Table(detailTable, " ", _normalFont, "center");
                PdfReports.AddText2Table(detailTable, subTotalNinetySixPct.ToString("0.0000"), _labelFont, "right");
                PdfReports.AddText2Table(detailTable, " ", _normalFont, "right");
            }
            catch (Exception ex) {
                WSCIEMP.Common.CException wex = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
        private static void AddFooter(ref PdfWriter writer, ref Document document, Font normalFont, string rptFooter, PaymentSummaryEvent pgEvent)
        {
            float[]   footerLayout = new float[] { 540 };
            PdfPTable table        = PdfReports.CreateTable(footerLayout, 1);

            PdfReports.AddText2Table(table, rptFooter, normalFont, "center");
            PdfReports.AddTableNoSplit(document, pgEvent, table);
        }
        public void BuildContractDumpHeader(Document document, float[] layout)
        {
            PdfPTable table = PdfReports.CreateTable(layout, 0);

            //--------------------------------
            // HEADER
            //--------------------------------
            Color borderColor   = Color.BLACK;  //new Color(255, 0, 0);
            float borderWidth   = 1.0F;
            int   borderTypeAll = Rectangle.TOP_BORDER | Rectangle.RIGHT_BORDER | Rectangle.BOTTOM_BORDER | Rectangle.LEFT_BORDER;
            float fPadding      = 2;

            iTextSharp.text.pdf.PdfPCell cell = PdfReports.AddText2Cell("Cnt #", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                                                        fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Station", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Field Desc.", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Landowner", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Final Net Tons", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Tons / Acre", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Sugar %", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Tare %", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("SLM %", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Lbs Ext. Sugar / Ton", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell("Plant Pop", _labelFont, PdfPCell.ALIGN_CENTER, PdfPCell.ALIGN_BOTTOM,
                                           fPadding, borderWidth, borderTypeAll, borderColor);
            table.AddCell(cell);

            PdfReports.AddTableNoSplit(document, this, table);
        }
Exemple #10
0
        private void ShowPayeeInformation(PdfPTable table, int contractNumber, int cropYear, bool splitRetain, bool splitChemical)
        {
            const string METHOD_NAME = "rptContractPayeeSummary.ShowPayeeInformation";

            try {
                Paragraph p = new Paragraph("", _normalFont);

                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
                    using (SqlDataReader dr = WSCPayment.RptContractPayeeSummary2(conn, contractNumber, cropYear)) {
                        while (dr.Read())
                        {
                            if (dr.GetInt16(dr.GetOrdinal("PayeeNumber")) == 1)
                            {
                                Phrase phrase = new Phrase("1st Payee: ", _labelFont);
                                p.Add(phrase);
                                phrase = new Phrase(dr.GetString(dr.GetOrdinal("PayeeName")) + "\n", _normalFont);
                                p.Add(phrase);
                                phrase = new Phrase(dr.GetFloat(dr.GetOrdinal("SplitPercent")).ToString("##.0000") + "%" + "\n", _normalFont);
                                p.Add(phrase);
                                phrase = new Phrase("Mailed To: ", _labelFont);
                                p.Add(phrase);
                                phrase = new Phrase(dr.GetString(dr.GetOrdinal("AddressNumber")) + "  " + dr.GetString(dr.GetOrdinal("BusinessName")), _normalFont);
                                p.Add(phrase);

                                phrase = new Phrase("     Split Retains: ", _labelFont);
                                p.Add(phrase);
                                phrase = new Phrase((splitRetain ? "Y" : "N"), _normalFont);
                                p.Add(phrase);

                                phrase = new Phrase("     Split Chemicals: ", _labelFont);
                                p.Add(phrase);
                                phrase = new Phrase((splitChemical ? "Y" : "N") + "\n", _normalFont);
                                p.Add(phrase);
                            }
                            else
                            {
                                Phrase phrase = new Phrase("2nd Payee: ", _labelFont);
                                p.Add(phrase);
                                phrase = new Phrase(dr.GetString(dr.GetOrdinal("PayeeName")) + "\n", _normalFont);
                                p.Add(phrase);
                                phrase = new Phrase(dr.GetFloat(dr.GetOrdinal("SplitPercent")).ToString("##.0000") + "%" + "\n", _normalFont);
                                p.Add(phrase);
                                phrase = new Phrase("Mailed To: ", _labelFont);
                                p.Add(phrase);
                                phrase = new Phrase(dr.GetString(dr.GetOrdinal("AddressNumber")) + "  " + dr.GetString(dr.GetOrdinal("BusinessName")) + "\n", _normalFont);
                                p.Add(phrase);
                            }
                        }

                        PdfReports.AddText2Table(table, p, _primaryTableLayout.Length);
                    }
                }
            }
            catch (Exception ex) {
                WSCIEMP.Common.CException wscex = new WSCIEMP.Common.CException(METHOD_NAME, ex);
                throw (wscex);
            }
        }
Exemple #11
0
 private void AddPatronStockTransferHeader(ref PdfPTable table)
 {
     PdfReports.AddText2Table(table, "Transferred", _labelFont, "center");
     PdfReports.AddText2Table(table, " ", _labelFont, "center", _patronStockLayout.Length - 1);
     PdfReports.AddText2Table(table, " ", _normalFont);
     PdfReports.AddText2Table(table, "Shares", _labelFont, "center");
     PdfReports.AddText2Table(table, "Date", _labelFont, "center");
     PdfReports.AddText2Table(table, " ", _normalFont, 3);
 }
Exemple #12
0
        private void AddPatronStockHeader(ref PdfPTable table)
        {
            table = PdfReports.CreateTable(_patronStockLayout, 0);

            iTextSharp.text.pdf.PdfPCell cell =
                PdfReports.AddText2Cell("Patron Preferred Stock", _labelFont, "left", _patronStockLayout.Length);
            cell.BackgroundColor = Color.LIGHT_GRAY;
            table.AddCell(cell);
        }
 public JsonResult SignConsignmentContract(long id, string sellerSignature)
 {
     try
     {
         Consignment         consignment         = InvoiceRepository.GetConsignment(id);
         ConsignmentContract consignmentContract = InvoiceRepository.GetConsignmentContract(id);
         if (consignment == null || consignmentContract == null || consignmentContract.StatusID != (int)Consts.ConsignmentContractStatus.Unsigned || consignment.User_ID != AppHelper.CurrentUser.ID)
         {
             throw new Exception("Error occurred during the process of signing the document. Please reload page and try again");
         }
         if (string.IsNullOrWhiteSpace(sellerSignature))
         {
             throw new Exception("Draw signature as first.");
         }
         Specialist specialist = InvoiceRepository.GetSpecialist(consignment.Specialist_ID.GetValueOrDefault(-1));
         if (specialist == null)
         {
             throw new Exception("Error occurred during the process of signing the document. Please contact us.");
         }
         string   lelandsSignaturePath = AppHelper.SignatureImagesOnDisk(string.Format("userSignature{0}.png", specialist.User_ID));
         FileInfo fileInfo             = new FileInfo(lelandsSignaturePath);
         if (!fileInfo.Exists)
         {
             throw new Exception("Error occurred during the process of signing the document. Please contact us.");
         }
         SignatureToImage signature           = new SignatureToImage();
         Bitmap           signatureImage      = signature.SigJsonToImage(sellerSignature);
         string           sellerSignaturePath = AppHelper.ConsignmentContractOnDisk(consignment.ID, consignmentContract.FileName.ToLower().Replace(".pdf", ".png"));
         fileInfo = new FileInfo(sellerSignaturePath);
         if (fileInfo.Exists)
         {
             fileInfo.Delete();
         }
         signatureImage.Save(sellerSignaturePath);
         Address lelandsAddress = new Address
         {
             FirstName = "Lelands.com",
             LastName  = Consts.SiteEmail,
             Address_1 = Consts.CompanyAddress,
             City      = Consts.CompanyCity,
             State     = Consts.CompanyState,
             Zip       = Consts.CompanyZip,
             HomePhone = Consts.CompanyPhone,
             WorkPhone = Consts.CompanyFax
         };
         User    consignor        = UserRepository.GetUser(consignment.User_ID, true);
         Address consignorAddress = Address.GetAddress(UserRepository.GetAddressCard(consignor.Billing_AddressCard_ID.GetValueOrDefault(0), true));
         PdfReports.ConsignmentContract(AppHelper.ConsignmentContractOnDisk(consignment.ID, consignmentContract.FileName), AppHelper.PublicImagesOnDisk("logo.png"), string.Empty, Consts.CompanyTitleName, string.Empty, lelandsAddress, lelandsSignaturePath, consignorAddress, consignor.Email, sellerSignaturePath, DateTime.Now, InvoiceRepository.GetConsignmentDetailsByConsignmentID(id), consignmentContract.ContractText);
         consignmentContract.StatusID = (int)Consts.ConsignmentContractStatus.Signed;
         InvoiceRepository.UpdateConsignmentContract(consignmentContract);
     }
     catch (Exception exc)
     {
         return(JSON(new { success = false, exc.Message }));
     }
     return(JSON(new { success = true }));
 }
        public static void AddTruckDetail(ref Document document, SqlDataReader drTrucks, DailyGrowerTareDetailEvent pgEvent)
        {
            const string METHOD_NAME = "AddTruckDetail";
            string       yardCard    = null;

            try {
                pgEvent.HeaderNameList = _truckDetailHdrNames;
                //PdfPTable table = PdfReports.CreateTable(_primaryTableLayout, 1);

                int iYardCard     = drTrucks.GetOrdinal("Yard_Card_Sequence_Number");
                int iDeliveryDate = drTrucks.GetOrdinal("Delivery_Date");
                int iTruckNumber  = drTrucks.GetOrdinal("Truck_Number");
                int iWeightIn     = drTrucks.GetOrdinal("Weight_In");
                int iWeightOut    = drTrucks.GetOrdinal("Weight_Out");
                int iDirtWt       = drTrucks.GetOrdinal("Dirt_Weight");
                int iDirtTaken    = drTrucks.GetOrdinal("Dirt_Taken");
                int iNetWt        = drTrucks.GetOrdinal("Net_Weight");

                while (drTrucks.Read())
                {
                    PdfPTable table = PdfReports.CreateTable(_primaryTableLayout, 1);

                    // On first pass, add the header labels here.
                    if (yardCard == null)
                    {
                        PdfReports.FillHeaderLabels(ref table, _truckDetailHdrNames, _labelFont);
                    }
                    else
                    {
                        // Now let the PDF Page event handler take care of adding column labels on page breaks.
                        pgEvent.HeaderTableLayout = _primaryTableLayout;
                    }

                    yardCard = drTrucks.GetString(iYardCard);
                    PdfReports.AddText2Table(table, yardCard, _normalFont, "center");
                    PdfReports.AddText2Table(table, drTrucks.GetString(iDeliveryDate), _normalFont, "center");
                    PdfReports.AddText2Table(table, drTrucks.GetString(iTruckNumber), _normalFont, "center");
                    PdfReports.AddText2Table(table, drTrucks.GetInt32(iWeightIn).ToString("#,##0"), _normalFont, "right");
                    PdfReports.AddText2Table(table, drTrucks.GetInt32(iWeightOut).ToString("#,##0"), _normalFont, "right");
                    PdfReports.AddText2Table(table, drTrucks.GetInt32(iDirtWt).ToString("#,##0"), _normalFont, "right");
                    PdfReports.AddText2Table(table, drTrucks.GetString(iDirtTaken), _normalFont, "center");
                    PdfReports.AddText2Table(table, drTrucks.GetInt32(iNetWt).ToString("#,##0"), _normalFont, "right");

                    PdfReports.AddTableNoSplit(document, pgEvent, table);
                }

                //PdfReports.AddTableNoSplit(document, pgEvent, table);

                pgEvent.HeaderNameList    = null;
                pgEvent.HeaderTableLayout = null;
            }
            catch (Exception ex) {
                WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + "." + METHOD_NAME, ex);
                throw (wscEx);
            }
        }
Exemple #15
0
 private void AddPatronStockPurchaseHeader(ref PdfPTable table)
 {
     PdfReports.AddText2Table(table, "Purchased", _labelFont, "center");
     PdfReports.AddText2Table(table, " ", _labelFont, "center", _patronStockLayout.Length - 1);
     PdfReports.AddText2Table(table, " ", _normalFont);
     PdfReports.AddText2Table(table, "Shares", _labelFont, "center");
     PdfReports.AddText2Table(table, "Date", _labelFont, "center");
     PdfReports.AddText2Table(table, "Price", _labelFont, "center");
     PdfReports.AddText2Table(table, "Value", _labelFont, "center");
     PdfReports.AddText2Table(table, " ", _normalFont);
 }
        public static void AddSampleDetail(ref Document document, SqlDataReader drSamples, DailyGrowerTareDetailEvent pgEvent)
        {
            const string METHOD_NAME = "AddSampleDetail";
            string       yardCard    = null;
            PdfPTable    table       = null;

            try {
                pgEvent.HeaderNameList = _sampleDetailHdrNames;

                while (drSamples.Read())
                {
                    table = PdfReports.CreateTable(_tareTableLayout, 1);

                    // On first pass, add the header labels here.
                    if (yardCard == null)
                    {
                        PdfReports.FillHeaderLabels(ref table, _sampleDetailHdrNames, _labelFont);
                    }
                    else
                    {
                        // Now let the PDF Page event handler take care of adding column labels on page breaks.
                        pgEvent.HeaderTableLayout = _tareTableLayout;
                    }

                    yardCard = drSamples.GetString(drSamples.GetOrdinal("Yard_Card_No"));
                    PdfReports.AddText2Table(table, yardCard, _normalFont, "center");
                    PdfReports.AddText2Table(table, drSamples.GetInt32(drSamples.GetOrdinal("SampleNo")).ToString("#"), _normalFont, "center");
                    PdfReports.AddText2Table(table, drSamples.GetDecimal(drSamples.GetOrdinal("Sugar_Content")).ToString("0.00"), _normalFont, "center");
                    PdfReports.AddText2Table(table, drSamples.GetDecimal(drSamples.GetOrdinal("Gross_Weight")).ToString("#,##0.0"), _normalFont, "right");
                    PdfReports.AddText2Table(table, drSamples.GetDecimal(drSamples.GetOrdinal("Clean_Weight")).ToString("#,##0.0"), _normalFont, "right");
                    PdfReports.AddText2Table(table, drSamples.GetDecimal(drSamples.GetOrdinal("Tare")).ToString("0.00"), _normalFont, "center");
                    PdfReports.AddText2Table(table, drSamples.GetString(drSamples.GetOrdinal("High_Tare")), _normalFont, "center");
                    PdfReports.AddText2Table(table, drSamples.GetInt32(drSamples.GetOrdinal("Sample_Quality")).ToString(), _normalFont, "center");
                    PdfReports.AddText2Table(table, drSamples.GetDecimal(drSamples.GetOrdinal("SLM_Pct")).ToString("0.0000"), _normalFont, "center");

                    PdfReports.AddTableNoSplit(document, pgEvent, table);
                }

                pgEvent.HeaderNameList    = null;
                pgEvent.HeaderTableLayout = null;

                // Follow the table with a blank line
                table = PdfReports.CreateTable(_tareTableLayout, 1);
                PdfReports.AddText2Table(table, " ", _normalFont, _tareTableLayout.Length);

                PdfReports.AddTableNoSplit(document, pgEvent, table);
            }
            catch (Exception ex) {
                WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(MOD_NAME + "." + METHOD_NAME, ex);
                throw (wscEx);
            }
        }
Exemple #17
0
        /// <summary>
        /// This is simple application that will generate output file "PdfReportsTest.pdf" in app\bin\debug folder
        /// from template file "PdfReportsTest.prtp" located in project folder.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.Write("\nStarting generator...");
            PdfReports Reporter = new PdfReports(false);

            Console.Write("\nAdding template file: PdfReportsTest.prtp");
            Reporter.TemplateFileName = "PdfReportsTest.prtp";
            Console.Write("\nAdding data...");
            Reporter.DataSources.Add(GeneratePersons());
            Console.Write("\nGenerating pdf file: PdfReportsTest.pdf");
            Reporter.GeneratePdf("PdfReportsTest.pdf");
            Console.Write("\nFinished!\n");
        }
Exemple #18
0
 private void AddCommonData(SqlDataReader dr, PdfPTable table)
 {
     PdfReports.AddText2Table(table, " ", _normalFont);
     PdfReports.AddText2Table(table, dr.GetDecimal(dr.GetOrdinal("XActQuantity")).ToString("N0"),
                              _normalFont, "center");
     PdfReports.AddText2Table(table, dr.GetString(dr.GetOrdinal("XActDate")),
                              _normalFont, "center");
     PdfReports.AddText2Table(table, "$" + dr.GetDecimal(dr.GetOrdinal("XActPrice")).ToString("#,##0.00"),
                              _normalFont, "center");
     PdfReports.AddText2Table(table, "$" + dr.GetDecimal(dr.GetOrdinal("XActAmount")).ToString("#,##0.00"),
                              _normalFont, "right");
     PdfReports.AddText2Table(table, " ", _normalFont);
 }
Exemple #19
0
        private void AddPatronStockTransferData(SqlDataReader dr, PdfPTable table)
        {
            decimal shares = dr.GetDecimal(dr.GetOrdinal("XActQuantity"));

            _patronStockShares += shares;

            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, shares.ToString("N0"),
                                     _normalFont, "center");
            PdfReports.AddText2Table(table, dr.GetString(dr.GetOrdinal("XActDate")),
                                     _normalFont, "center");
            PdfReports.AddText2Table(table, " ", _normalFont, 3);
        }
Exemple #20
0
        private void FinishFinancingData(PdfWriter writer, Document document, ref PdfPTable table, EQStmtEvent pgEvent)
        {
            PdfReports.AddText2Table(table, " ", _normalFont, _equityFinancingLayout.Length);

            iTextSharp.text.pdf.PdfPCell cell = PdfReports.AddText2Cell("Total", _labelFont, "center");
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell(" ", _labelFont, "center");
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            if (_financingPaid < 0)
            {
                cell = PdfReports.AddText2Cell("($" + Math.Abs(_financingPaid).ToString("#,##0.00") + ")", _labelFont, "right");
            }
            else
            {
                cell = PdfReports.AddText2Cell("$" + _financingPaid.ToString("#,##0.00"), _labelFont, "right");
            }
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            if (_financingInterest < 0)
            {
                cell = PdfReports.AddText2Cell("($" + Math.Abs(_financingInterest).ToString("#,##0.00") + ")", _labelFont, "right");
            }
            else
            {
                cell = PdfReports.AddText2Cell("$" + _financingInterest.ToString("#,##0.00"), _labelFont, "right");
            }
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            if (_financingBalance < 0)
            {
                cell = PdfReports.AddText2Cell("($" + Math.Abs(_financingBalance).ToString("#,##0.00") + ")", _labelFont, "right");
            }
            else
            {
                cell = PdfReports.AddText2Cell("$" + _financingBalance.ToString("#,##0.00"), _labelFont, "right");
            }
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            PdfReports.AddText2Table(table, " ", _normalFont, 2);

            PdfReports.AddText2Table(table, " ", _normalFont, _equityFinancingLayout.Length);
            PdfReports.AddTableNoSplit(document, pgEvent, table);
            table = null;
        }
        private static void AddTotals(ref PdfWriter writer, ref Document document,
                                      ref PdfPTable table, Font labelFont, Font normalFont,
                                      decimal totalTons, decimal totalEHPrem, decimal totalGross, decimal totalDeductions,
                                      decimal totalNet, decimal checkAmount, int payeeNumber,
                                      decimal totalGrowerNet, decimal totalLandownerNet, PaymentSummaryEvent pgEvent)
        {
            decimal growerAmt    = 0;
            decimal landownerAmt = 0;

            growerAmt    = totalGrowerNet;
            landownerAmt = totalLandownerNet;

            // ===============================================================================
            // Total Line: totalTons, totalEHPrem, totalGross, totalDeductions, totalNet
            // ===============================================================================
            PdfReports.AddText2Table(table, " ", normalFont, 13);
            PdfReports.AddText2Table(table, " ", normalFont, 5);
            PdfReports.AddText2Table(table, "Tons", labelFont, "center", 2);
            PdfReports.AddText2Table(table, "EH", labelFont, "right", 2);
            PdfReports.AddText2Table(table, "Gross", labelFont, "center");
            PdfReports.AddText2Table(table, "Deductions", labelFont, "center");
            PdfReports.AddText2Table(table, "Net", labelFont, "center");
            PdfReports.AddText2Table(table, " ", normalFont);

            PdfReports.AddText2Table(table, " ", normalFont, 5);
            PdfReports.AddText2Table(table, totalTons.ToString("N4"), normalFont, "right", 2);
            PdfReports.AddText2Table(table, totalEHPrem.ToString("N2"), normalFont, "right", 2);
            PdfReports.AddText2Table(table, totalGross.ToString("N2"), normalFont, "right");
            PdfReports.AddText2Table(table, totalDeductions.ToString("N2"), normalFont, "right");
            PdfReports.AddText2Table(table, totalNet.ToString("N2"), normalFont, "right");
            PdfReports.AddText2Table(table, " ", normalFont);

            PdfReports.AddText2Table(table, " ", normalFont, 13);

            PdfReports.AddText2Table(table, " ", normalFont, 9);
            PdfReports.AddText2Table(table, "Grower Net", labelFont, 2);
            PdfReports.AddText2Table(table, growerAmt.ToString("N2"), normalFont, "right");
            PdfReports.AddText2Table(table, " ", normalFont);

            PdfReports.AddText2Table(table, " ", normalFont, 9);
            PdfReports.AddText2Table(table, "Landowner Net", labelFont, 2);
            PdfReports.AddText2Table(table, landownerAmt.ToString("N2"), normalFont, "right");
            PdfReports.AddText2Table(table, " ", normalFont);

            PdfReports.AddText2Table(table, " ", normalFont, 13);
            PdfReports.AddText2Table(table, " ", normalFont, 13);

            PdfReports.AddTableNoSplit(document, pgEvent, table);
        }
Exemple #22
0
        private void AddCommonHeader(ref PdfPTable table)
        {
            table = PdfReports.CreateTable(_commonStockLayout, 0);
            iTextSharp.text.pdf.PdfPCell cell =
                PdfReports.AddText2Cell("Common Stock Purchase", _labelFont, "left", _commonStockLayout.Length);
            cell.BackgroundColor = Color.LIGHT_GRAY;
            table.AddCell(cell);

            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, "Shares", _labelFont, "center");
            PdfReports.AddText2Table(table, "Date", _labelFont, "center");
            PdfReports.AddText2Table(table, "Price", _labelFont, "center");
            PdfReports.AddText2Table(table, "Value", _labelFont, "center");
            PdfReports.AddText2Table(table, " ", _normalFont);
        }
Exemple #23
0
        private void AddPatronStockPurchaseData(SqlDataReader dr, PdfPTable table)
        {
            decimal shares = dr.GetDecimal(dr.GetOrdinal("XActQuantity"));

            _patronStockShares += shares;

            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, shares.ToString("N0"),
                                     _normalFont, "center");
            PdfReports.AddText2Table(table, dr.GetString(dr.GetOrdinal("XActDate")),
                                     _normalFont, "center");
            PdfReports.AddText2Table(table, "$" + dr.GetDecimal(dr.GetOrdinal("XActPrice")).ToString("#,##0.00"),
                                     _normalFont, "center");
            PdfReports.AddText2Table(table, "$" + dr.GetDecimal(dr.GetOrdinal("XActAmount")).ToString("#,##0.00"),
                                     _normalFont, "right");
            PdfReports.AddText2Table(table, " ", _normalFont);
        }
Exemple #24
0
        private void AddFinancingHeader(ref PdfPTable table)
        {
            table = PdfReports.CreateTable(_equityFinancingLayout, 0);

            iTextSharp.text.pdf.PdfPCell cell =
                PdfReports.AddText2Cell("Equity Financing", _labelFont, "left", _equityFinancingLayout.Length);
            cell.BackgroundColor = Color.LIGHT_GRAY;
            table.AddCell(cell);

            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, "Date", _labelFont, "center");
            PdfReports.AddText2Table(table, "Principal Paid", _labelFont, "center");
            PdfReports.AddText2Table(table, "Interest", _labelFont, "center");
            PdfReports.AddText2Table(table, "Balance", _labelFont, "center");
            PdfReports.AddText2Table(table, " ", _normalFont);
            PdfReports.AddText2Table(table, " ", _normalFont);
        }
Exemple #25
0
        private void FinishPatronStockData(PdfWriter writer, Document document, ref PdfPTable table, EQStmtEvent pgEvent)
        {
            PdfReports.AddText2Table(table, " ", _normalFont, _patronStockLayout.Length);

            iTextSharp.text.pdf.PdfPCell cell = PdfReports.AddText2Cell("Total Shares Owned", _labelFont, "center");
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            cell = PdfReports.AddText2Cell(_patronStockShares.ToString("#,##0"), _labelFont, "center");
            cell.BackgroundColor = cell.BackgroundColor = Color_Highlight;
            table.AddCell(cell);

            PdfReports.AddText2Table(table, " ", _normalFont, _patronStockLayout.Length - 2);
            PdfReports.AddText2Table(table, " ", _normalFont, _patronStockLayout.Length);
            PdfReports.AddTableNoSplit(document, pgEvent, table);
            table = null;
        }
Exemple #26
0
        private void AddUnitRetainHeader(ref PdfPTable table)
        {
            table = PdfReports.CreateTable(_unitRetainsLayout, 0);

            iTextSharp.text.pdf.PdfPCell cell =
                PdfReports.AddText2Cell("Unit Retains", _labelFont, "left", _unitRetainsLayout.Length);
            cell.BackgroundColor = Color.LIGHT_GRAY;
            table.AddCell(cell);

            PdfReports.AddText2Table(table, "Crop Year", _labelFont, "center");
            PdfReports.AddText2Table(table, "Date", _labelFont, "center");
            PdfReports.AddText2Table(table, "Tons Delivered", _labelFont, "center");
            PdfReports.AddText2Table(table, "$/Ton", _labelFont, "center");
            PdfReports.AddText2Table(table, "Amount", _labelFont, "center");
            PdfReports.AddText2Table(table, "$ Paid", _labelFont, "center");
            PdfReports.AddText2Table(table, "Balance", _labelFont, "center");
            PdfReports.AddText2Table(table, " ", _normalFont);
        }
Exemple #27
0
        public override void OnStartPage(PdfWriter writer, Document document)
        {
            if (!_isDocumentClosing)
            {
                // ===========================================================================
                // Create header column -- in this report this is the page's column object
                // ===========================================================================
                _ct.SetSimpleColumn(PortraitPageSize.HdrLowerLeftX, PortraitPageSize.HdrLowerLeftY,
                                    PortraitPageSize.HdrUpperRightX, PortraitPageSize.HdrUpperRightY,
                                    PortraitPageSize.PgLeading, Element.ALIGN_TOP);
                _ct.YLine = PortraitPageSize.HdrTopYLine;

                // =======================================================
                // Add Header
                // =======================================================
                float[]   layout = new float[] { 413F, 127F };
                PdfPTable table  = PdfReports.CreateTable(layout, 0);
                PdfReports.AddText2Table(table, _title + "\n", titleFont, "center");
                PdfReports.AddImage2Table(table, _imgLogo);
                PdfReports.AddText2Table(table, " ", normalFont, table.NumberOfColumns);
                PdfReports.AddText2Table(table, " ", normalFont, table.NumberOfColumns);

                PdfReports.AddText2Table(table, "SHID: " + _shid, labelFont, "left", 2);
                PdfReports.AddText2Table(table, _payeeName, labelFont, "left", 2);
                PdfReports.AddText2Table(table, " ", normalFont, table.NumberOfColumns);

                PdfReports.AddTableNoSplit(document, this, table);

                PdfPTable hdrTab = PdfReports.CreateTable(_hdrTableLayout, 0);
                PdfReports.AddText2Table(hdrTab, _hdrNameList[0], labelFont, "center");
                PdfReports.AddText2Table(hdrTab, _hdrNameList[1], labelFont, "center");
                PdfReports.AddText2Table(hdrTab, _hdrNameList[2], labelFont, "center");
                PdfReports.AddText2Table(hdrTab, _hdrNameList[3], labelFont, "center");
                PdfReports.AddText2Table(hdrTab, _hdrNameList[4], labelFont, "center");
                PdfReports.AddText2Table(hdrTab, _hdrNameList[5], labelFont, "center");
                PdfReports.AddText2Table(hdrTab, _hdrNameList[6], labelFont, "center");

                PdfReports.AddTableNoSplit(document, this, hdrTab);

                _headerBottomYLine = _ct.YLine;
            }

            base.OnStartPage(writer, document);
        }
Exemple #28
0
        private void AddPatronageRefundHeader(ref PdfPTable table)
        {
            table = PdfReports.CreateTable(_patronageRefundLayout, 0);

            iTextSharp.text.pdf.PdfPCell cell =
                PdfReports.AddText2Cell("Patronage Refunds", _labelFont, "left", _patronageRefundLayout.Length);
            cell.BackgroundColor = Color.LIGHT_GRAY;
            table.AddCell(cell);

            PdfReports.AddText2Table(table, "Crop Year", _labelFont, "center");
            PdfReports.AddText2Table(table, "Date", _labelFont, "center");
            PdfReports.AddText2Table(table, "Tons Delivered", _labelFont, "center");
            PdfReports.AddText2Table(table, "$/Ton", _labelFont, "center");
            PdfReports.AddText2Table(table, "Amount", _labelFont, "center");
            PdfReports.AddText2Table(table, "Initial Pay", _labelFont, "center");
            PdfReports.AddText2Table(table, "Crop Loss Allocation/Pmt", _labelFont, "center");
            PdfReports.AddText2Table(table, "Certificate Paid", _labelFont, "center");
            PdfReports.AddText2Table(table, "Balance", _labelFont, "center");
        }
        private static void AddBodyText(PdfPTable bodyTable, int cropYear, string fromDate, string toDate, string payeeName)
        {
            const string METHOD_NAME = "AddBodyText";

            try {
                Paragraph p = new Paragraph("", _normalFont);

                // TEXT
                p.Add(new Phrase(16F, "Below is a summary for the direct deliveries ", _normalFont));
                p.Add(new Phrase(16F, payeeName, _labelFont));
                p.Add(new Phrase(16F, " delivered for the " + cropYear.ToString() + " Crop from " + fromDate + " through " + toDate + ".\n\n", _normalFont));

                PdfReports.AddText2Table(bodyTable, p);
            }
            catch (Exception ex) {
                WSCIEMP.Common.CException wex = new WSCIEMP.Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Exemple #30
0
        private void AddUnitRetainData(SqlDataReader dr, PdfPTable table)
        {
            decimal amt  = dr.GetDecimal(dr.GetOrdinal("XActAmount"));
            decimal paid = dr.GetDecimal(dr.GetOrdinal("FinPayPrincipal"));
            decimal tons = dr.GetDecimal(dr.GetOrdinal("XActQuantity"));

            _unitRetainAmount  += amt;
            _unitRetainPaid    += paid;
            _unitRetainBalance += (amt - paid);
            _unitRetainTons    += tons;

            PdfReports.AddText2Table(table, dr.GetInt32(dr.GetOrdinal("XActCropYear")).ToString(), _normalFont, "center");
            PdfReports.AddText2Table(table, dr.GetString(dr.GetOrdinal("XActDate")), _normalFont, "center");
            PdfReports.AddText2Table(table, tons.ToString("#,##0.0000"), _normalFont, "right");
            PdfReports.AddText2Table(table, "$" + dr.GetDecimal(dr.GetOrdinal("XActPrice")).ToString("#,##0.00"), _normalFont, "center");
            PdfReports.AddText2Table(table, "$" + amt.ToString("#,##0.00"), _normalFont, "right");
            PdfReports.AddText2Table(table, "$" + paid.ToString("#,##0.00"), _normalFont, "right");
            PdfReports.AddText2Table(table, "$" + (amt - paid).ToString("#,##0.00"), _normalFont, "right");
            PdfReports.AddText2Table(table, " ", _normalFont);
        }