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


C# Table.addCell方法代码示例

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


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

示例1: btnProfitReport_Click


//.........这里部分代码省略.........
            string filePath = Server.MapPath("../../Config/");

            string[] fileArray = Directory.GetFiles(filePath, "*.pdf");
            foreach (string file in fileArray)
            {
                File.Delete(file);
            }
            Document document = new Document(PageSize.A4, 15, 15, 10, 10);

            try
            {
                PdfWriter.getInstance(document, new FileStream(filePath + fileName + ".pdf", FileMode.Create));

                document.Header = PdfHelper.GetHeardFooter("亿度物流", SettingOperation.LoadSetting().Phone);

                document.Open();

                Paragraph phTitle = new Paragraph(new Chunk("利润分析表", PdfHelper.fontTitle));
                phTitle.Alignment = Element.ALIGN_CENTER;

                Paragraph phTitle2 = new Paragraph(new Chunk(titleContent, PdfHelper.fontHeader));
                phTitle2.Alignment = Element.ALIGN_LEFT;

                document.Add(phTitle);
                document.Add(phTitle2);

                iTextSharp.text.Table tblContent = new iTextSharp.text.Table(12);
                tblContent.setWidths(new int[] { 15, 10, 8, 8, 8 , 8, 9, 7, 7, 7, 7, 11 });
                tblContent.WidthPercentage = 99;
                tblContent.Border = 0;
                tblContent.Cellpadding = 1;
                tblContent.Cellspacing = 1;

                tblContent.addCell(PdfHelper.GetTitleCellLeft("收件单号"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("收件日期"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("客户姓名"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("业务员"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("承运商"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("单号"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("国家"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("重量"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("数量"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("收入"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("成本"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("利润金额"));

                int totalCount = 0;
                decimal totalIncome = 0;
                decimal totalCost = 0;
                decimal totalProfit = 0;

                foreach (SearchOrderDetail sod in result)
                {
                    tblContent.addCell(PdfHelper.GetCellLeft(sod.OrderEncode));
                    tblContent.addCell(PdfHelper.GetCellLeft(OrderOperation.GetOrderByEncode(sod.OrderEncode).ReceiveDate.ToShortDateString()));
                    tblContent.addCell(PdfHelper.GetCellLeft(sod.Client.RealName));
                    tblContent.addCell(PdfHelper.GetCellLeft(UserOperation.GetUserById(OrderOperation.GetOrderByEncode(sod.OrderEncode).UserId).RealName));
                    tblContent.addCell(PdfHelper.GetCellLeft(sod.CarrierEncode));
                    tblContent.addCell(PdfHelper.GetCellLeft(sod.BarCode));
                    tblContent.addCell(PdfHelper.GetCellLeft(sod.ToCountry));
                    tblContent.addCell(PdfHelper.GetCellRight(sod.Weight.ToString()));
                    tblContent.addCell(PdfHelper.GetCellRight(sod.Count.ToString()));
                    tblContent.addCell(PdfHelper.GetCellRight(sod.TotalCosts.ToString()));
                    tblContent.addCell(PdfHelper.GetCellRight(sod.SelfTotalCosts.ToString()));
                    tblContent.addCell(PdfHelper.GetCellRight((sod.TotalCosts - sod.SelfTotalCosts).ToString()));
开发者ID:sd1362168638,项目名称:XSEMS,代码行数:66,代码来源:AssessReport.aspx.cs

示例2: btnUserReport_Click


//.........这里部分代码省略.........
            string filePath = Server.MapPath("../../Config/");

            string[] fileArray = Directory.GetFiles(filePath, "*.pdf");
            foreach (string file in fileArray)
            {
                File.Delete(file);
            }
            Document document = new Document(PageSize.A4, 15, 15, 10, 10);

            try
            {
                PdfWriter.getInstance(document, new FileStream(filePath + fileName + ".pdf", FileMode.Create));

                document.Header = PdfHelper.GetHeardFooter("亿度物流", SettingOperation.LoadSetting().Phone);

                document.Open();

                Paragraph phTitle = new Paragraph(new Chunk("业务员考核表", PdfHelper.fontTitle));
                phTitle.Alignment = Element.ALIGN_CENTER;

                Paragraph phTitle2 = new Paragraph(new Chunk(titleContent, PdfHelper.fontHeader));
                phTitle2.Alignment = Element.ALIGN_LEFT;

                document.Add(phTitle);
                document.Add(phTitle2);

                iTextSharp.text.Table tblContent = new iTextSharp.text.Table(4);
                tblContent.setWidths(new int[] { 30, 30, 20, 20 });
                tblContent.WidthPercentage = 99;
                tblContent.Border = 0;
                tblContent.Cellpadding = 1;
                tblContent.Cellspacing = 1;

                tblContent.addCell(PdfHelper.GetTitleCellLeft("所属公司"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("所属部门"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("业务员"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("金额"));

                decimal totalMoney = 0;
                foreach (UserSales us in result)
                {
                    tblContent.addCell(PdfHelper.GetCellLeft(CompanyOperation.GetCompanyById(us.User.CompanyId).Name));
                    tblContent.addCell(PdfHelper.GetCellLeft(DepartmentOperation.GetDepartmentById(us.User.DepartmentId).Name));
                    tblContent.addCell(PdfHelper.GetCellLeft(us.User.RealName));
                    tblContent.addCell(PdfHelper.GetCellRight(us.Money.ToString()));

                    totalMoney += us.Money;
                }

                tblContent.addCell(PdfHelper.GetCellLeft(""));
                tblContent.addCell(PdfHelper.GetCellLeft(""));
                tblContent.addCell(PdfHelper.GetCellLeft(""));
                tblContent.addCell(PdfHelper.GetCellLeft(""));

                tblContent.addCell(PdfHelper.GetFooterCellLeft("合计:"));
                tblContent.addCell(PdfHelper.GetFooterCellRight(""));
                tblContent.addCell(PdfHelper.GetFooterCellRight(""));
                tblContent.addCell(PdfHelper.GetFooterCellRight(totalMoney.ToString()));

                document.Add(tblContent);

                document.resetHeader();
            }
            catch (Exception ex)
            {
                lblMsg.Text = "生成PDF文件出错," + ex.ToString();
开发者ID:sd1362168638,项目名称:XSEMS,代码行数:67,代码来源:AssessReport.aspx.cs

示例3: btnArDetailStatistic_Click


//.........这里部分代码省略.........
            string filePath = Server.MapPath("../../Config/");

            string[] fileArray = Directory.GetFiles(filePath, "*.pdf");
            foreach (string file in fileArray)
            {
                File.Delete(file);
            }
            Document document = new Document(PageSize.A4, 15, 15, 10, 10);

            try
            {
                PdfWriter.getInstance(document, new FileStream(filePath + fileName + ".pdf", FileMode.Create));

                document.Header = PdfHelper.GetHeardFooter("亿度物流", SettingOperation.LoadSetting().Phone);

                document.Open();

                Paragraph phTitle = new Paragraph(new Chunk("已收款明细", PdfHelper.fontTitle));
                phTitle.Alignment = Element.ALIGN_CENTER;

                Paragraph phTitle2 = new Paragraph(new Chunk(titleContent, PdfHelper.fontHeader));
                phTitle2.Alignment = Element.ALIGN_LEFT;

                document.Add(phTitle);
                document.Add(phTitle2);

                iTextSharp.text.Table tblContent = new iTextSharp.text.Table(7);
                tblContent.setWidths(new int[] { 18, 15, 10, 15, 14, 14, 14 });
                tblContent.WidthPercentage = 99;
                tblContent.Border = 0;
                tblContent.Cellpadding = 1;
                tblContent.Cellspacing = 1;

                tblContent.addCell(PdfHelper.GetTitleCellLeft("所属公司"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("收款单号"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("收款日期"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("发票号码"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("付款方式"));
                tblContent.addCell(PdfHelper.GetTitleCellLeft("经手人"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("收款金额"));
                foreach (ClientRecharge cr in result)
                {
                    Cell cellClientName = new Cell(new Paragraph("客户姓名: " + cr.Client.RealName, PdfHelper.fontContent));
                    cellClientName.Colspan = 7;
                    cellClientName.HorizontalAlignment = Element.ALIGN_LEFT;
                    cellClientName.VerticalAlignment = Element.ALIGN_MIDDLE;
                    tblContent.addCell(cellClientName);

                    decimal totalMoney = 0;
                    foreach (Recharge recharge in cr.RechargeList)
                    {
                        tblContent.addCell(PdfHelper.GetCellLeft(CompanyOperation.GetCompanyById(recharge.CompanyId).Name));
                        tblContent.addCell(PdfHelper.GetCellLeft(recharge.Encode));
                        tblContent.addCell(PdfHelper.GetCellLeft(recharge.ReceiveTime.ToShortDateString()));
                        tblContent.addCell(PdfHelper.GetCellLeft(recharge.Invoice));
                        tblContent.addCell(PdfHelper.GetCellLeft(recharge.PaymentMethodName));
                        tblContent.addCell(PdfHelper.GetCellLeft(recharge.UserName));
                        tblContent.addCell(PdfHelper.GetCellRight(recharge.Money.ToString()));

                        totalMoney += recharge.Money;
                    }

                    tblContent.addCell(PdfHelper.GetFooterCellLeft("合计:"));
                    tblContent.addCell(PdfHelper.GetFooterCellRight(""));
                    tblContent.addCell(PdfHelper.GetFooterCellRight(""));
                    tblContent.addCell(PdfHelper.GetFooterCellRight(""));
开发者ID:sd1362168638,项目名称:XSEMS,代码行数:67,代码来源:AlreadyReceivedReport.aspx.cs

示例4: btnClientStatistic_Click


//.........这里部分代码省略.........
            string filePath = Server.MapPath("../../Config/");

            string[] fileArray = Directory.GetFiles(filePath, "*.pdf");
            foreach (string file in fileArray)
            {
                File.Delete(file);
            }
            Document document = new Document(PageSize.A4, 15, 15, 10, 10);

            try
            {
                PdfWriter.getInstance(document, new FileStream(filePath + fileName + ".pdf", FileMode.Create));

                document.Header = PdfHelper.GetHeardFooter("亿度物流", SettingOperation.LoadSetting().Phone);

                document.Open();

                Paragraph phTitle = new Paragraph(new Chunk("客户统计表", PdfHelper.fontTitle));
                phTitle.Alignment = Element.ALIGN_CENTER;

                Paragraph phTitle2 = new Paragraph(new Chunk(titleContent, PdfHelper.fontHeader));
                phTitle2.Alignment = Element.ALIGN_LEFT;

                document.Add(phTitle);
                document.Add(phTitle2);

                iTextSharp.text.Table tblContent = new iTextSharp.text.Table(8);
                tblContent.setWidths(new int[] { 13, 8, 13, 15, 15, 16, 10, 10 });
                tblContent.WidthPercentage = 99;
                tblContent.Border = 0;
                tblContent.Cellpadding = 1;
                tblContent.Cellspacing = 1;

                tblContent.addCell(PdfHelper.GetTitleCellLeft("客户姓名"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("编号"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("用户名"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("地区"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("手机"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("邮箱"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("余额"));
                tblContent.addCell(PdfHelper.GetTitleCellRight("信用额度"));

                foreach (Client client in result)
                {
                    tblContent.addCell(PdfHelper.GetCellLeft(client.RealName));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Id.ToString()));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Username));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Province + " " + client.City));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Mobile));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Email));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Balance.ToString()));
                    tblContent.addCell(PdfHelper.GetCellRight(client.Credit.ToString()));
                }

                document.Add(tblContent);

                document.resetHeader();
            }
            catch (Exception ex)
            {
                lblMsg.Text = "生成PDF文件出错," + ex.ToString();
            }
            finally
            {
                document.Close();
            }
开发者ID:sd1362168638,项目名称:XSEMS,代码行数:67,代码来源:ClientStatistics.aspx.cs

示例5: btnPrintPost_Click

    protected void btnPrintPost_Click(object sender, EventArgs e)
    {
        DateTime receiveDate = new DateTime(1999, 1, 1);
        if (string.IsNullOrEmpty(Request.Form[txtReceivedDate.ID].Trim()) || !DateTime.TryParse(Request.Form[txtReceivedDate.ID].Trim(), out receiveDate))
        {
            lblMsg.Text = "如果货物已经收到请先填写收件日期!";
            return;
        }
        if (order.CreateUser == null)
        {
            order.ReceiveDate = receiveDate;
            order.UserId = user.Id;
            order.CreateUser = user;
            OrderOperation.UpdateOrder(order);
        }

        string fileName = StringHelper.GetEncodeNumber("HYD");
        string filePath = Server.MapPath("../../Config/");

        string[] fileArray = Directory.GetFiles(filePath, "*.pdf");
        foreach (string file in fileArray)
        {
            File.Delete(file);
        }
        Document document = new Document(PageSize.A4, 15, 15, 10, 10);

        try
        {
            Company company = CompanyOperation.GetCompanyById(user.CompanyId);

            PdfWriter.getInstance(document, new FileStream(filePath + fileName + ".pdf", FileMode.Create));

            document.Header = PdfHelper.GetHeardFooter("亿度物流", company.Phone);

            document.Open();

            Paragraph phTitle = new Paragraph(new Chunk("货运单", PdfHelper.fontTitle));
            phTitle.Alignment = Element.ALIGN_CENTER;

            document.Add(phTitle);

            iTextSharp.text.Table tblTitle = new iTextSharp.text.Table(4);
            tblTitle.setWidths(new int[] { 15, 35, 15, 35 });
            tblTitle.WidthPercentage = 99;
            tblTitle.Border = 0;
            tblTitle.Cellpadding = 1;
            tblTitle.Cellspacing = 1;

            tblTitle.addCell(PdfHelper.GetCellRight("收件单号:"));
            tblTitle.addCell(PdfHelper.GetCellLeft(" " + order.Encode));
            tblTitle.addCell(PdfHelper.GetCellRight("收件日期:"));
            tblTitle.addCell(PdfHelper.GetCellLeft(" " + order.ReceiveDate.ToShortDateString()));
            tblTitle.addCell(PdfHelper.GetCellRight("收件方式:"));
            tblTitle.addCell(PdfHelper.GetCellLeft(" " + order.ReceiveType));
            tblTitle.addCell(PdfHelper.GetCellRight("收件网点:"));
            tblTitle.addCell(PdfHelper.GetCellLeft(" " + order.CompanyName));
            tblTitle.addCell(PdfHelper.GetCellRight("客户姓名:"));
            tblTitle.addCell(PdfHelper.GetCellLeft(" " + order.Client.RealName));
            tblTitle.addCell(PdfHelper.GetCellRight("业 务 员:"));
            tblTitle.addCell(PdfHelper.GetCellLeft(" " + UserOperation.GetUserById(order.UserId).RealName));
            tblTitle.addCell(PdfHelper.GetCellRight("备    注:"));

            Cell bzCellValue = new Cell(new Paragraph(" " + order.Remark, PdfHelper.fontContent));
            bzCellValue.Colspan = 3;
            bzCellValue.HorizontalAlignment = Element.ALIGN_LEFT;
            bzCellValue.VerticalAlignment = Element.ALIGN_MIDDLE;
            tblTitle.addCell(bzCellValue);

            document.Add(tblTitle);

            iTextSharp.text.Table tblDetail = new iTextSharp.text.Table(10);
            tblDetail.setWidths(new int[] { 9, 8, 11, 9, 9, 9, 9, 9, 15, 12 });
            tblDetail.WidthPercentage = 99;
            tblDetail.Border = 0;
            tblDetail.Cellpadding = 1;
            tblDetail.Cellspacing = 1;
            tblDetail.addCell(PdfHelper.GetCellLeft("承运商"));
            tblDetail.addCell(PdfHelper.GetCellLeft("数量"));
            tblDetail.addCell(PdfHelper.GetCellLeft("包裹重量"));
            tblDetail.addCell(PdfHelper.GetCellLeft("挂号费"));
            tblDetail.addCell(PdfHelper.GetCellLeft("取件费"));
            tblDetail.addCell(PdfHelper.GetCellLeft("材料费"));
            tblDetail.addCell(PdfHelper.GetCellLeft("保价费"));
            tblDetail.addCell(PdfHelper.GetCellLeft("其它费"));
            tblDetail.addCell(PdfHelper.GetCellLeft("条形码"));
            tblDetail.addCell(PdfHelper.GetCellRight("应收合计"));

            foreach (OrderDetail od in result)
            {
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + od.CarrierEncode));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + od.Count.ToString()));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + StringHelper.CurtNumber(od.Weight.ToString())));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + StringHelper.CurtNumber(od.RegisterCosts.ToString())));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + StringHelper.CurtNumber(od.FetchCosts.ToString())));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + StringHelper.CurtNumber(od.MaterialCosts.ToString())));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + StringHelper.CurtNumber(od.InsureCosts.ToString())));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + StringHelper.CurtNumber(od.OtherCosts.ToString())));
                tblDetail.addCell(PdfHelper.GetCellLeft(" " + od.BarCode));
                tblDetail.addCell(PdfHelper.GetCellRight(" " + StringHelper.CurtNumber(od.TotalCosts.ToString())));
            }
//.........这里部分代码省略.........
开发者ID:sd1362168638,项目名称:XSEMS,代码行数:101,代码来源:ReceiveOrder.aspx.cs


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