| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 583 人关注过本帖
标题:C# 生成 PDF 表格
取消只看楼主 加入收藏
lzrcoming
Rank: 2
等 级:论坛游民
帖 子:33
专家分:12
注 册:2014-4-21
结帖率:28.57%
收藏
已结贴  问题点数:8 回复次数:1 
C# 生成 PDF 表格
PdfPTable table = new PdfPTable(10);
                table.WidthPercentage = 323 / 5.23f;
               // table.SetWidths(new int[] { 2, 1, 1 });


                PdfPCell cell;
                cell=new PdfPCell(new Phrase("Cell with colspan 1"));
                cell.Colspan = 10;
                table.addCell(cell);

                cell = new PdfPCell(new Phrase("Cell with rowspan 2"));
              //  Rectangle rect = new Rectangle(523, 770);
               // table.SetWidthPercentage(new float[] { 144, 72, 72 }, rect);
               // cell.Rowspan = 2;  为什么cell.Colspan可以用,而这句不能用,这样画出来的表格都是一样大的,我想在一行表格中,前面是一行,后面分成两行

                table.addCell(cell);
                table.addCell("row 1; cell 1");
                table.addCell("row 1; cell 2");
                table.addCell("row 1; cell 3");
                table.addCell("row 1; cell 4");
                table.addCell("row 1; cell 5");
                table.addCell("row 1; cell 6");
                table.addCell("row 1; cell 7");
                table.addCell("row 1; cell 8");
                table.addCell("row 1; cell 9");
               
      

                cell = new PdfPCell(new Phrase("Cell with rowspan 3"));
                table.addCell(cell);
                table.addCell("row 1; cell 1");
                table.addCell("row 1; cell 2");
                table.addCell("row 1; cell 3");
                table.addCell("row 1; cell 4");
                table.addCell("row 1; cell 5");
                table.addCell("row 1; cell 6");
                table.addCell("row 1; cell 7");
                table.addCell("row 1; cell 8");
                table.addCell("row 1; cell 9");
代码.rar (1.65 KB)


[ 本帖最后由 lzrcoming 于 2014-8-19 10:43 编辑 ]
2014-08-19 10:41
lzrcoming
Rank: 2
等 级:论坛游民
帖 子:33
专家分:12
注 册:2014-4-21
收藏
得分:0 
有所有代码,有帮忙的朋友可以说下,我把所有代码都附上
2014-08-19 10:42
快速回复:C# 生成 PDF 表格
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012902 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved