예제 #1
0
        public PdfPTable ExportToPDF(DataSet dataset, string FilePath, string District, string ReportType = "")
        {
            PdfPTable Table = null;

            Table = new PdfPTable(4);
            Table = TS.SetSize(Table);
            int Center  = PdfPCell.ALIGN_CENTER;
            int VCenter = PdfPCell.ALIGN_MIDDLE;
            int Left    = PdfPCell.ALIGN_LEFT;

            PdfPCell EmptyCell = new PdfPCell();

            EmptyCell = PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter);

            //Todo
            //pdfDoc.Add(PrintPageHeading(phrase, "Self Employment Loan"));
            PdfPCell cellWithRowspan = new PdfPCell(LOGO.ImageCell("~/Image/KACDC_PDF.png", 30f, PdfPCell.ALIGN_CENTER, BaseColor.BLACK));

            //System.Drawing.Image imageBIt = ConvertTextToImage("ಈ ಮೇಲ್ಕಂಡ ಮಾಹಿತಿಗಳು ನನಗೆ ತಿಳಿದ<br />ABCjhk", "Arial", 10, Color.Yellow, Color.Black);
            //iTextSharp.text.Image pdfImage = iTextSharp.text.Image.GetInstance(imageBIt, System.Drawing.Imaging.ImageFormat.Jpeg);
            //pdfImage.ScaleToFit( 0.3f, 0.4f, 0.3f, 0.4f );

            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);

            //Row 2
            Table.AddCell(EmptyCell);
            PdfPCell cell = new PdfPCell(HCell.PrintHeaderCell("Applicant Details".ToUpper(), "sans-serif", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, 20f, Center, VCenter));

            Table.AddCell(PCell.PrintCell("fxghfg\ndfgddfgdfgsfgsdf", "sans-serif", 10, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("fxghfg", "sans-serif", 10, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("fxghfg", "sans-serif", 10, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("fxghfg", "sans-serif", 10, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("fxghfg\n\n\n", "sans-serif", 10, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, 20f, Left, VCenter));

            cell.Colspan = 2;
            Table.AddCell(cell);
            Table.AddCell(EmptyCell);



            return(Table);
        }
예제 #2
0
        public PdfPTable ApplicantMainTable(PdfPTable Table, string ApplicationNumber = "", string ApplicantName = "", string FatherName = "", string Gender = "", string Widowed     = "", string Divorced        = "", string PhysicallyChallenged = "", string AnualIncome = "", string RDNumber     = "", string EmailID  = "", string MobileNumber = "", string AlternateNumber = "", string DoB             = "", string LoanPurpose = "", string AadharNum = "", string Occupation = "",
                                            string ContactAddress = "", string ContDistrict = "", string ContPincode = "", string ParmanentAddress           = "", string ParDistrict = "", string ParConstituency = "", string ParPincode           = "", string AppliedDate = "", string ModifiedDate = "", string ParTaluk = "", string ContTaluk    = "", string LoanDescription = "", string ApplicantNameNC = "", string Language    = "99")
        {
            Table = TS.SetSize(Table);
            int Center  = PdfPCell.ALIGN_CENTER;
            int VCenter = PdfPCell.ALIGN_MIDDLE;
            int Left    = PdfPCell.ALIGN_LEFT;



            PdfPCell EmptyCell = new PdfPCell();

            EmptyCell = PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter);

            //Todo
            //pdfDoc.Add(PrintPageHeading(phrase, "Self Employment Loan"));
            PdfPCell cellWithRowspan = new PdfPCell(LOGO.ImageCell("~/Image/KACDC_PDF.png", 30f, PdfPCell.ALIGN_CENTER, BaseColor.BLACK));

            //System.Drawing.Image imageBIt = ConvertTextToImage("ಈ ಮೇಲ್ಕಂಡ ಮಾಹಿತಿಗಳು ನನಗೆ ತಿಳಿದ<br />ABCjhk", "Arial", 10, Color.Yellow, Color.Black);
            //iTextSharp.text.Image pdfImage = iTextSharp.text.Image.GetInstance(imageBIt, System.Drawing.Imaging.ImageFormat.Jpeg);
            //pdfImage.ScaleToFit( 0.3f, 0.4f, 0.3f, 0.4f );

            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);

            //Row 2
            Table.AddCell(EmptyCell);
            PdfPCell cell = new PdfPCell(HCell.PrintHeaderCell("Applicant Details".ToUpper(), "sans-serif", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Center, VCenter));

            cell.Colspan = 2;
            Table.AddCell(cell);
            Table.AddCell(EmptyCell);


            //Row 2
            Table.AddCell(LAN.GenerateCell("Application Number", 12, "ಅರ್ಜಿ ಸಂಖ್ಯೆ", 20f));
            Table.AddCell(PCell.PrintCell(ApplicationNumber, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 3
            Table.AddCell(LAN.GenerateCell("NAME", 12, "ಹೆಸರು", 20f));
            Table.AddCell(PCell.PrintCell(ApplicantName, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            // Applicant Photo
            cellWithRowspan.Rowspan     = 5;
            cellWithRowspan.BorderColor = BaseColor.WHITE;
            Table.AddCell(cellWithRowspan);

            //Row 4
            Table.AddCell(LAN.GenerateCell("Father / Guardian Name", 12, "ತಂದೆ / ರಕ್ಷಕರ ಹೆಸರು", 20f));
            Table.AddCell(PCell.PrintCell(FatherName, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 5
            Table.AddCell(LAN.GenerateCell("Gender", 12, "ಲಿಂಗ", 20f));
            Table.AddCell(PCell.PrintCell(Gender, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 6
            Table.AddCell(LAN.GenerateCell("DOB", 12, "ಜನ್ಮ ದಿನಾಂಕ", 20f));
            Table.AddCell(PCell.PrintCell(DoB, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 7
            Table.AddCell(LAN.GenerateCell("Emai ID", 12, "ಇ-ಮೇಲ್ ಐಡಿ", 20f));
            Table.AddCell(PCell.PrintCell(EmailID, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 8

            Table.AddCell(LAN.GenerateCell("Person With Disablities", 12, "ತಂದೆ / ರಕ್ಷಕರ ಹೆಸರು", 20f));
            Table.AddCell(PCell.PrintCell(PhysicallyChallenged, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(LAN.GenerateCell("Anual Income", 12, "ವಾರ್ಷಿಕ ಆದಾಯ", 20f));
            Table.AddCell(PCell.PrintCell(AnualIncome, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 8.1(Optional)
            if (Gender.ToUpper() == "FEMALE")
            {
                Table.AddCell(LAN.GenerateCell("Widowed", 12, "ವಿಧವೆಯೇ", 20f));
                Table.AddCell(PCell.PrintCell(Widowed, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
                Table.AddCell(LAN.GenerateCell("Divorced", 12, "ವಿಚ್ಚೇದಿತರೆ", 20f));
                Table.AddCell(PCell.PrintCell(Divorced, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            }
            //Row 9

            Table.AddCell(LAN.GenerateCell("Purpose of Loan", 12, "ಸಾಲದ ಉದ್ದೇಶ", 20f));
            Table.AddCell(PCell.PrintCell(LoanPurpose, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(LAN.GenerateCell("Description of Loan", 12, "ಸಾಲದ ವಿವರಣೆ", 20f));
            Table.AddCell(PCell.PrintCell(LoanDescription, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 10
            Table.AddCell(LAN.GenerateCell("Mobile Number", 12, "ಮೊಬೈಲ್ ಸಂಖ್ಯೆ", 20f));
            Table.AddCell(PCell.PrintCell(MobileNumber, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(LAN.GenerateCell("Alternate Mobile Number", 12, "ಪರ್ಯಾಯ ಮೊಬೈಲ್ ಸಂಖ್ಯೆ", 20f));
            Table.AddCell(PCell.PrintCell(AlternateNumber, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));


            //Row
            Table.AddCell(LAN.GenerateCell("RD Number", 12, "R D ಸಂಖ್ಯೆ", 20f));
            Table.AddCell(PCell.PrintCell("VERIFIED", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(LAN.GenerateCell("Aadhar", 12, "ಆಧಾರ್", 20f));
            Table.AddCell(PCell.PrintCell("VERIFIED", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            if (Language == "1")
            {
                //Row 10
                Table.AddCell(LAN.GenerateCell("Parmanent Address", 12, "ಶಾಶ್ವತ ವಿಳಾಸ", 20f));
                PdfPCell FullAddresscell;

                iTextSharp.text.Image FullAddressImage = TTI.ConvertTextToImage(MLT.GenerateMultiLineText(TextArea1, ParmanentAddress, 18), "sans-serif", 10, Color.White, Color.Black);
                FullAddressImage.ScalePercent(20f);

                FullAddresscell = new PdfPCell(FullAddressImage);
                FullAddresscell.VerticalAlignment   = VCenter;
                FullAddresscell.HorizontalAlignment = Left;
                FullAddresscell.BorderColor         = BaseColor.WHITE;

                Table.AddCell(FullAddresscell);

                Table.AddCell(LAN.GenerateCell("Contact Address", 12, "ಸಂಪರ್ಕ ವಿಳಾಸ", 20f));
                PdfPCell ContactAddresscell;

                //string Caddress = MLT.GenerateMultiLineText("ಮದು ಬಸವರಾಜ ಬಿಜಾಪುರ", 18);
                iTextSharp.text.Image ContactFullAddressImage = TTI.ConvertTextToImage((MLT.GenerateMultiLineText(TextArea2, ContactAddress, 18)), "sans-serif", 10, Color.White, Color.Black);
                ContactFullAddressImage.ScalePercent(20f);

                ContactAddresscell = new PdfPCell(ContactFullAddressImage);
                ContactAddresscell.VerticalAlignment   = VCenter;
                ContactAddresscell.HorizontalAlignment = Left;
                ContactAddresscell.BorderColor         = BaseColor.WHITE;

                Table.AddCell(ContactAddresscell);
            }
            else
            {
                Table.AddCell(LAN.GenerateCell("Parmanent Address", 12, "ಶಾಶ್ವತ ವಿಳಾಸ", 20f));
                Table.AddCell(PCell.PrintCell(ParmanentAddress, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
                Table.AddCell(LAN.GenerateCell("Contact Address", 12, "ಸಂಪರ್ಕ ವಿಳಾಸ", 20f));
                Table.AddCell(PCell.PrintCell(ContactAddress, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            }
            //Row 11
            Table.AddCell(LAN.GenerateCell("District", 12, "ಜಿಲ್ಲೆ", 20f));
            Table.AddCell(PCell.PrintCell(ParDistrict, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(LAN.GenerateCell("District", 12, "ಜಿಲ್ಲೆ", 20f));
            Table.AddCell(PCell.PrintCell(ContDistrict, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));


            //Row 12
            if (Language == "1")
            {
                Table.AddCell(LAN.GenerateCell("Taluk", 12, "ತಾಲ್ಲೂಕು", 20f));
                PdfPCell FullAddresscell;
                iTextSharp.text.Image FullAddressImage = TTI.ConvertTextToImage(MLT.GenerateMultiLineText(TextArea3, ParTaluk, 18), "sans-serif", 10, Color.White, Color.Black);
                FullAddressImage.ScalePercent(20f);
                FullAddresscell = new PdfPCell(FullAddressImage);
                FullAddresscell.VerticalAlignment   = VCenter;
                FullAddresscell.HorizontalAlignment = Left;
                FullAddresscell.BorderColor         = BaseColor.WHITE;
                Table.AddCell(FullAddresscell);


                Table.AddCell(LAN.GenerateCell("Taluk", 12, "ತಾಲ್ಲೂಕು", 20f));
                PdfPCell ContactAddresscell;
                iTextSharp.text.Image ContactFullAddressImage = TTI.ConvertTextToImage((MLT.GenerateMultiLineText(TextArea4, ContTaluk, 18)), "sans-serif", 10, Color.White, Color.Black);
                ContactFullAddressImage.ScalePercent(20f);
                ContactAddresscell = new PdfPCell(ContactFullAddressImage);
                ContactAddresscell.VerticalAlignment   = VCenter;
                ContactAddresscell.HorizontalAlignment = Left;
                ContactAddresscell.BorderColor         = BaseColor.WHITE;
                Table.AddCell(ContactAddresscell);
            }
            else
            {
                Table.AddCell(LAN.GenerateCell("Taluk", 12, "ತಾಲ್ಲೂಕು", 20f));
                Table.AddCell(PCell.PrintCell(ParTaluk, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
                Table.AddCell(LAN.GenerateCell("Taluk", 12, "ತಾಲ್ಲೂಕು", 20f));
                Table.AddCell(PCell.PrintCell(ContTaluk, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            }
            //Row 13
            Table.AddCell(LAN.GenerateCell("Pin code", 12, "ಪಿನ್ ಕೋಡ್", 20f));
            Table.AddCell(PCell.PrintCell(ContPincode, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(LAN.GenerateCell("Pin code", 12, "ಪಿನ್ ಕೋಡ್", 20f));
            Table.AddCell(PCell.PrintCell(ParPincode, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //Row 13
            Table.AddCell(LAN.GenerateCell("Constituency", 12, "ಕ್ಷೇತ್ರ", 20f));
            Table.AddCell(PCell.PrintCell(ParConstituency, "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            Table.AddCell(EmptyCell);
            Table.AddCell(EmptyCell);


            ////BankTable.AddCell(LAN.GenerateCell("Account Holder Name", 12, "ಖಾತೆದಾರರ ಹೆಸರು", 20f));
            ////BankTable.AddCell(PCell.PrintCell("XXXXXXXXXXXXXXXXX", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));
            ////BankTable.AddCell(LAN.GenerateCell("A/C Number", 12, "ಖಾತೆ ಸಂಖ್ಯೆ", 20f));
            ////BankTable.AddCell(PCell.PrintCell("XXXXXXXXXXXXXXXXX", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter));

            //string abc = @"I hereby provide my consent to Karnataka Arya Vysya Community Development Corporation, (Government of Karnataka Undertaking), to use my Aadhaar number for performing all such validations which may be, required to verify the correctness of the data either provided by me or associated with me under schemes with whom I am enrolled for. I understand that the use of my Aadhaar number will be restricted to the extent required for efficient delivery of benefits to me by the State Government.";
            //PdfPCell BankDetailsHeade = new PdfPCell(PCell.PrintCell(abc, "Times New Roman", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, PdfPCell.ALIGN_JUSTIFIED, PdfPCell.ALIGN_JUSTIFIED));
            //BankDetailsHeade.Colspan = 4;
            ////BankTable.AddCell(BankDetailsHeade);



            //string SelfEnglish = "I hereby certify that the above furnished information is true to my knowledge. I shall abide by the terms and conditions of the sanction of the Arivu Education Loan. If any discrepancies are found later, I agree to take legal action against me.";
            //string SelfKannada = "\n ಈ ಮೇಲ್ಕಂಡ ಮಾಹಿತಿಗಳು  ನನಗೆ ತಿಳಿದ ಮಟ್ಟಿಗೆ ಸತ್ಯ ಮತ್ತು  ಸರಿಯಾಗಿವೆಯೆಂದು ಪ್ರಮಾಣೀಕರಿಸುತ್ತೇನೆ.  ಒಂದು ವೇಳೆ ಮೇಲ್ಕಂಡ  ಮಾಹಿತಿಗಳು ಸುಳ್ಳು ಎಂದು \n ಕಂಡುಬಂದಲ್ಲಿ ನನ್ನ ವಿರುದ್ಧ ಕಾನೂನು ರೀತಿಯ ಕ್ರಮ ಜರುಗಿಸಲು ಒಪ್ಪಿರುತ್ತೇನೆ.";
            //string AadhaarEnglish = "I hereby provide my consent to Karnataka Arya Vysya Community Development Corporation (Government of Karnataka Undertaking) to use my Aadhaar Number for performing all such validations, which may be required to verify the correctness of the data either provided by me or associated with me under schemes with whom I am enrolled for. I understand that the use of my Aadhaar Number will be restricted to the extent required for efficient delivery of benefits to me by the State Government.";
            //string AadhaarKannada = "\n ಕರ್ನಾಟಕ ಆರ್ಯ ವೈಶ್ಯ ಸಮುದಾಯ ಅಭಿವೃದ್ಧಿ ನಿಗಮ(ಕರ್ನಾಟಕ ಸರ್ಕಾರದ ಉದ್ಯಮ) ಕ್ಕೆ ನನ್ನ  ಆಧಾರ್ ಸಂಖ್ಯೆಯನ್ನು ಬಳಸಲು  ಈ ಮೂಲಕ ನಾನು ಒಪ್ಪಿಗೆಯನ್ನು\n ನೀಡುತ್ತಿದ್ದೇನೆ. ನನ್ನಿಂದ ಒದಗಿಸಲಾದ ಅಥವಾ ನನ್ನೊಂದಿಗೆ ಸಂಯೋಜಿತವಾಗಿರುವ ಮಾಹಿತಿ ನಿಖರತೆಯನ್ನು ಪರಿಶೀಲಿಸಲು ಅಗತ್ಯವಿರುವ ಎಲ್ಲಾ ಮೌಲ್ಯಮಾಪನಗಳನ್ನು \n ನಿರ್ವಹಿಸಲು ಅಗತ್ಯವಾಗಿರುವುದರಿಂದ ನನ್ನ ಆಧಾರ್ ಸಂಖ್ಯೆಯ ಬಳಕೆಯನ್ನು ರಾಜ್ಯ ಸರ್ಕಾರವು ನನಗೆ ಸವಲತ್ತುಗಳನ್ನು ಸಮರ್ಪಕವಾಗಿ ತಲುಪಿಸಲು ಮಿತಗೊಂಡಿರುತ್ತದೆ \n ಎಂದು ನಾನು ಅರ್ಥಮಾಡಿಕೊಂಡಿರುತ್ತೇನೆ.";


            //PdfPCell SelfDeclaration = new PdfPCell(LAN.GenerateCell(SelfEnglish, 8, SelfKannada, 15f, BaseFont.COURIER));
            //SelfDeclaration.Colspan = 4;
            //BankTable.AddCell(SelfDeclaration);

            //PdfPCell AadhaarDeclaration = new PdfPCell(LAN.GenerateCell(AadhaarEnglish, 8, AadhaarKannada, 15f, BaseFont.COURIER));
            //AadhaarDeclaration.Colspan = 4;
            //BankTable.AddCell(AadhaarDeclaration);

            //PdfPCell EmptyHeader = new PdfPCell(PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Center, VCenter));
            //EmptyHeader.Colspan = 4;
            //BankTable.AddCell(EmptyHeader);

            //PdfPCell SignatureCell = new PdfPCell(LAN.GenerateCell("Signature", 15, "    ಸಹಿ", 25f));
            //BankTable.AddCell(EmptyCell);
            //BankTable.AddCell(EmptyCell);
            //BankTable.AddCell(EmptyCell);
            //BankTable.AddCell(SignatureCell);

            return(Table);
        }
예제 #3
0
        private void ExportToPDF(DataSet ds)
        {
            BankTable        BT    = new BankTable();
            PDFFileOperation PDFop = new PDFFileOperation();
            GetDataToProcess GDTP  = new GetDataToProcess();

            //PdfPTable Table = null;
            //Table = new PdfPTable(4);
            Document pdfDoc = new Document(PageSize.A4, 0, 0, 35, 0);

            using (MemoryStream memoryStream = new MemoryStream())
            {
                PdfWriter writer = PdfWriter.GetInstance(pdfDoc, memoryStream);
                pdfDoc.Open();
                //pdfDoc.Add(Table);
                //PdfPTable BankTable = null;
                //BankTable = new PdfPTable(4);

                string FinancialYear = "2020";
                string District      = "Bangalore";
                string Zone          = "BLR";

                string FilePath = Server.MapPath("~/ApplicationProcessFiles/" + FinancialYear + "/ZM/") + "SE" + Zone + District + "_" + FinancialYear + DateTime.Now + ".pdf";
                //BankTable = PDFop.ExportToPDF( ds,  FilePath,  District);
                //pdfDoc.Add(BankTable);



                int          Center    = PdfPCell.ALIGN_CENTER;
                int          VCenter   = PdfPCell.ALIGN_MIDDLE;
                int          Left      = PdfPCell.ALIGN_LEFT;
                PDFCellPrint PCell     = new PDFCellPrint();
                PdfPCell     EmptyCell = new PdfPCell();
                EmptyCell = PCell.PrintCell("", "sans-serif", 10, iTextSharp.text.Font.BOLD, BaseColor.BLACK, 20f, Left, VCenter);
                PDFParagraph PDFP = new PDFParagraph();

                string BankName      = "SBI";
                string BankBranch    = "SBI branch";
                string city          = "Bangalore";
                string AccountNumber = "1111111";
                pdfDoc.Add(PDFP.SingleLineParagraph("\n\n\n\n\n\n\n", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("Date: " + DateTime.Now.ToString("dd MMMM yyyy"), "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_RIGHT, VCenter));
                pdfDoc.Add(PDFP.ToAddressBlock(BankName, BankBranch, city, "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("\n", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("Sir/Madam,", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("\n", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("Sub :- Transfer of amount to the beneficiaries", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_CENTER, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph(" SB Accounts through RTGF/NEFT-reg", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_CENTER, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("***************", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_CENTER, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("\n", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.MainBlock(BankName, BankBranch, "1", AccountNumber, "Arial", 16, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, Left, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("     Thank You,", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_LEFT, VCenter));
                pdfDoc.Add(PDFP.SingleLineParagraph("Your Faithfully     ", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_RIGHT, VCenter));



                pdfDoc.SetPageSize(new Rectangle(1100f, 850f));
                pdfDoc.SetMargins(0, 0, 10, 0);
                pdfDoc.NewPage();

                ReportTableHeading HT           = new ReportTableHeading();
                PdfPTable          HeadingTable = null;
                HeadingTable = new PdfPTable(4);
                //pdfDoc.Add(PDFP.SingleLineParagraph("***************", "Arial", 14, iTextSharp.text.Font.NORMAL, BaseColor.BLACK, PdfPCell.ALIGN_CENTER, VCenter));
                HeadingTable = HT.GenerateHeading(HeadingTable, "Self Employment Loan", FinancialYear, District, Zone);
                pdfDoc.Add(HeadingTable);
                pdfDoc.Add(PDFop.ZMBankTable(GDTP.GetData("spPrintExcel", "SEZMAPPROVEDPRINT", "Bengaluru Dakshina", "Approved List"), "3523"));//print


                pdfDoc.Close();
                byte[] bytes = memoryStream.ToArray();
                memoryStream.Close();
                Response.Clear();

                SaveFile SV = new SaveFile();
                //Arivu_Kalaburgi_Bidar_2020-21_30-03-2021
                SV.SavingFileOnServer(Server.MapPath("~/ApplicationProcessFiles/" + FinancialYear + "/ZM/"), "SE" + Zone + District + "_" + FinancialYear + string.Format("{0:dd-MM-yyyy}", DateTime.Now) + ".pdf", bytes);
                if (File.Exists(FilePath))
                {
                    //SendSMSEmail();
                }
                Response.ContentEncoding = System.Text.Encoding.UTF8;
                Response.AddHeader("Content-Disposition", "attachment; filename=" + "ZM" + "_" + "ZM" + ".pdf");
                Response.ContentType = "application/pdf";
                Response.Buffer      = true;
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.BinaryWrite(bytes);
                Response.End();
                Response.Close();
            }
        }