如何使用Itextsharp将表放置在所需位置 [英] How to place table in Desired position using Itextsharp
本文介绍了如何使用Itextsharp将表放置在所需位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将Itextsharp表放置在固定位置&只需要垂直网格线.
你能帮我怎么做吗?
谢谢.
Hi,
I need to place Itextsharp table in fixed position & need only vertical gridlines.
could u please help how do i do this?
Thanks.
int columnCount = PrintGv.Columns.Count;
int rowCount = PrintGv.Rows.Count;
int tableRows = rowCount + 3;
iTextSharp.text.Table grdTable = new iTextSharp.text.Table(columnCount, tableRows);
grdTable.BorderWidth = 1;
grdTable.BorderColor = new Color(0, 0, 255);
grdTable.Cellpadding = 1;
grdTable.Cellspacing = 1;
grdTable.AddCell("ItemNo");
grdTable.AddCell("Qty");
grdTable.AddCell("Description");
for (int rowCounter = 0; rowCounter < rowCount; rowCounter++)
{
for (int columnCounter = 0; columnCounter < columnCount; columnCounter++)
{
string strValue = PrintGv.Rows[rowCounter].Cells[columnCounter].Text;
grdTable.AddCell(strValue);
}
}
Doc.Add(grdTable);
推荐答案
玛丽,
http://blog.rubypdf.com/itextsharp/tutorial01/ [
Hi Mary,
http://blog.rubypdf.com/itextsharp/tutorial01/[^]
here some c# code is the for all your needs using itextSharp.
Any help reply to me.
这篇关于如何使用Itextsharp将表放置在所需位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文