两个不同的表并行在asp.net web中的itext sharp [英] Two different table in parallel in itext sharp in asp.net web

查看:74
本文介绍了两个不同的表并行在asp.net web中的itext sharp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts



我使用iText sharp生成pdf文件。我有两个表现在我想要两个不同的表并行显示。怎么样 ?。 PLZ帮助。



提前致谢









我已经关注http://www.mikesdotnetting.com/Article/89/iTextSharp-Page-Layout-with-Columns [^]此链接...但未找到解决方案.Becouse在这个链接段落在page1的末尾,然后column2开始,但在我的条件下,我想要从1页到页数平行的两个表.............谢谢

解决方案

我找到解决方案..

 PdfWriter writer = PdfWriter.GetInstance(doc, new  FileStream(path +   / TablesSideBySide.pdf,FileMode 。创建)); 
doc.Open();

PdfPTable table = new PdfPTable( 3 );
table.TotalWidth = 144f;
table.LockedWidth = true ;
PdfPCell cell = new PdfPCell( new 短语( 这是表1));
cell.Colspan = 3 ;
cell.Horizo​​ntalAlignment = 1 ;
table.AddCell(cell);
table.AddCell( Col 1 Row 1);
table.AddCell( Col 2 Row 1);
table.AddCell( Col 3 Row 1);
table.AddCell( Col 1 Row 2);
table.AddCell( Col 2 Row 2);
table.AddCell( Col 3 Row 2);
table.WriteSelectedRows( 0 , - 1,doc.Left,doc.Top,writer.DirectContent);


table = new PdfPTable( 3 );
table.TotalWidth = 144f;
table.LockedWidth = true ;
cell = new PdfPCell( new 短语( 这是表2));
cell.Colspan = 3 ;
cell.Horizo​​ntalAlignment = 1 ;
table.AddCell(cell);
table.AddCell( Col 1 Row 1);
table.AddCell( Col 2 Row 1);
table.AddCell( Col 3 Row 1);
table.AddCell( Col 1 Row 2);
table.AddCell( Col 2 Row 2);
table.AddCell( Col 3 Row 2);
table.WriteSelectedRows( 0 , - 1,doc.Left + 200 ,doc.Top ,writer.DirectContent);


http://www.mikesdotnetting.com/Article/89/iTextSharp-Page-Layout-with-Columns [ ^ ]



使用带有C#中页脚的ItextSharp生成PDF [ ^ ]

Hello Experts

I generate a pdf file using iText sharp. I have Two tables now i want two different tables which is displayed in parallel. how ?. plz help.

Thanks in advance




I already Follow http://www.mikesdotnetting.com/Article/89/iTextSharp-Page-Layout-with-Columns[^] this link ...But not found solutions.Becouse in this link paragraphs devided in the end of page1 and then column2 start , but in my condition i want two tables parallely from 1 page to number of pages .............thanks

解决方案

I have find Solution..

PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(path + "/TablesSideBySide.pdf", FileMode.Create));
			doc.Open();

			PdfPTable table = new PdfPTable(3);
			table.TotalWidth = 144f;
			table.LockedWidth = true;
			PdfPCell cell = new PdfPCell(new Phrase("This is table 1"));
			cell.Colspan = 3;
			cell.HorizontalAlignment = 1;
			table.AddCell(cell);
			table.AddCell("Col 1 Row 1");
			table.AddCell("Col 2 Row 1");
			table.AddCell("Col 3 Row 1");
			table.AddCell("Col 1 Row 2");
			table.AddCell("Col 2 Row 2");
			table.AddCell("Col 3 Row 2");
			table.WriteSelectedRows(0, -1, doc.Left, doc.Top, writer.DirectContent);


			table = new PdfPTable(3);
			table.TotalWidth = 144f;
			table.LockedWidth = true;
			cell = new PdfPCell(new Phrase("This is table 2"));
			cell.Colspan = 3;
			cell.HorizontalAlignment = 1;
			table.AddCell(cell);
			table.AddCell("Col 1 Row 1");
			table.AddCell("Col 2 Row 1");
			table.AddCell("Col 3 Row 1");
			table.AddCell("Col 1 Row 2");
			table.AddCell("Col 2 Row 2");
			table.AddCell("Col 3 Row 2");
			table.WriteSelectedRows(0, -1, doc.Left + 200, doc.Top, writer.DirectContent);


http://www.mikesdotnetting.com/Article/89/iTextSharp-Page-Layout-with-Columns[^]

Generating PDF using ItextSharp with Footer in C#[^]


这篇关于两个不同的表并行在asp.net web中的itext sharp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆