当前位置: 首页>>代码示例>>C#>>正文


C# List.ToReportSource方法代码示例

本文整理汇总了C#中iTextSharp.text.List.ToReportSource方法的典型用法代码示例。如果您正苦于以下问题:C# List.ToReportSource方法的具体用法?C# List.ToReportSource怎么用?C# List.ToReportSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.List的用法示例。


在下文中一共展示了List.ToReportSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: showLetter

        //   public ReportResult showLetter(int idx=11)
        public ActionResult showLetter(ChkBook_collectorDetail collectionForm)
        {
            int idx = collectionForm.checkbookId;
            ReportGenerator reportGen = new ReportGenerator();
            string rname = "";//userManager.getReportbyName(pgId);
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;
            // Customize the Text Fields
            ReportsMap rep = new ReportsMap();
            rep.fieldId = 1;
            rep.field1 = "";
            rep.field2 = "";
            rep.field3 = "";
            rep.field4 = "";
            rep.field5 = "";
            var reportList = new List<ReportsMap>();
            reportList.Add(rep);
            var report = new Report(reportList.ToReportSource());
            string data1 = "---", data2 = "", data3 = "", data4 = "";
            //Read File
            string fileName = fngetSystemParamter("COLLECTION LETTER TEMPLATE");
            string agent = collectionForm.FullNames;

            Document myDocument = new Document(PageSize.A4.Rotate());

            try
            {
                    string fileLocation = HttpContext.Server.MapPath(".") + @"\Letter\" + "collection.pdf";
                    if (!Directory.Exists(HttpContext.Server.MapPath(".") + @"\Letter\"))
                    {
                        Directory.CreateDirectory(HttpContext.Server.MapPath(".") + @"\Letter\");
                    }
                    if (System.IO.File.Exists(fileLocation))
                    {
                        System.IO.File.Delete(fileLocation);
                    }

                    PdfWriter.GetInstance(myDocument, new FileStream(fileLocation, FileMode.OpenOrCreate));
                myDocument.Open();

                Contacts contactObj = new Contacts();//"0100047012"

                chqBook_CheckBookFieldDec chkBkFields = db.chqBook_CheckBookFieldDecs.Single(p => p.checkbookId == idx);
                List<Contacts> contactsList = db.ContactsList.Where(p => p.Customer_No == chkBkFields.acc_no).ToList<Contacts>();
                int i = 0;
                foreach (Contacts contactmodel in contactsList)
                {
                    if (i == 0)
                    {
                        contactObj = contactmodel;
                    }
                    i++;
                }

                string[] lines = System.IO.File.ReadAllLines(fileName);
                string[] data;
                string printData = "";
                string footerText = "";
                int footerCount = 0;
                foreach (string lin in lines)
                {
                    string tempData = lin;

                    if (lin.Contains("<<date>>"))
                    {
                        tempData = DateTime.Now.ToString("MMMM") + " " + DateTime.Today.Day.ToString() + " , " + DateTime.Today.Year.ToString(); ; //lin.Replace("<<Flex_Name>>", contactObj.Customer_Name);
                    }

                    if (lin.Contains("<<Flex_Name>>"))
                    {
                        tempData = lin.Replace("<<Flex_Name>>", contactObj.Customer_Name);
                    }
                    if (lin.Contains("<<Address_Line_1>>"))
                    {
                        tempData = lin.Replace("<<Address_Line_1>>", contactObj.Address_Line1);
                    }
                    if (lin.Contains("<<Address_Line_2>>"))
                    {
                        tempData = lin.Replace("<<Address_Line_2>>", contactObj.Address_Line2);
                    }
                    if (lin.Contains("<<SERIES>>"))
                    {
                        tempData = lin.Replace("<<SERIES>>", collectionForm.Series);
                    }
                    if (tempData.Contains("<<NO_OF_BOOKS>>"))
                    {
                        tempData = tempData.Replace("<<NO_OF_BOOKS>>", collectionForm.no_of_books);
                    }

                    if (lin.Contains("<<Account_No>>"))
                    {
                        tempData = lin.Replace("<<Account_No>>", chkBkFields.acc_no);
                    }

                    if (lin.Contains("<<AGENT>>"))
                    {
                        tempData = lin.Replace("<<AGENT>>", agent);
                    }
                    if (tempData.Contains("<<ISSUED>>"))
//.........这里部分代码省略.........
开发者ID:ongeri,项目名称:citieuc,代码行数:101,代码来源:ChequeBooksController.cs


注:本文中的iTextSharp.text.List.ToReportSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。