解決用Aspose.Words,在word文檔中創(chuàng)建表格的實(shí)現(xiàn)方法
更新時(shí)間:2013年05月20日 09:38:57 作者:
本篇文章是對(duì)利用Aspose.Words,在word文檔中創(chuàng)建表格的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
代碼如下所示:
//Open document and create Documentbuilder
Aspose.Words.Document doc = new Aspose.Words.Document("demo.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//Set table formating
//Set borders
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Red;
//Set left indent
builder.RowFormat.LeftIndent = 100;
// etc...
//Move documentBuilder cursor to the bookmark
builder.MoveToBookmark("myBookmark");
//Insert some table
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
builder.InsertCell();
builder.Write("this is cell");
}
builder.EndRow();
}
builder.EndTable();
//Save output document
doc.Save("demo2.doc");
復(fù)制代碼 代碼如下:
//Open document and create Documentbuilder
Aspose.Words.Document doc = new Aspose.Words.Document("demo.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
//Set table formating
//Set borders
builder.CellFormat.Borders.LineStyle = LineStyle.Single;
builder.CellFormat.Borders.Color = Color.Red;
//Set left indent
builder.RowFormat.LeftIndent = 100;
// etc...
//Move documentBuilder cursor to the bookmark
builder.MoveToBookmark("myBookmark");
//Insert some table
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
builder.InsertCell();
builder.Write("this is cell");
}
builder.EndRow();
}
builder.EndTable();
//Save output document
doc.Save("demo2.doc");
您可能感興趣的文章:
- asp.net下用Aspose.Words for .NET動(dòng)態(tài)生成word文檔中的數(shù)據(jù)表格的方法
- asp.net下用Aspose.Words for .NET動(dòng)態(tài)生成word文檔中的圖片或水印的方法
- .net使用Aspose.Words進(jìn)行Word替換操作的實(shí)現(xiàn)代碼
- 利用Aspose.Word控件實(shí)現(xiàn)Word文檔的操作
- C# 利用Aspose.Words.dll將 Word 轉(zhuǎn)成PDF
- 使用Aspose.Cells組件生成Excel文件實(shí)例
- 使用aspose.word 第三方的插件實(shí)現(xiàn)導(dǎo)出word
- C#使用Aspose.Cells控件讀取Excel
相關(guān)文章
Unity ScrollView實(shí)現(xiàn)自動(dòng)吸附效果
這篇文章主要為大家詳細(xì)介紹了Unity ScrollView實(shí)現(xiàn)自動(dòng)吸附效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-07-07C#面向?qū)ο缶幊讨幸蕾嚪崔D(zhuǎn)原則的示例詳解
在面向?qū)ο缶幊讨?,SOLID?是五個(gè)設(shè)計(jì)原則的首字母縮寫,旨在使軟件設(shè)計(jì)更易于理解、靈活和可維護(hù)。本文將通過實(shí)例詳細(xì)講講C#面向?qū)ο缶幊讨幸蕾嚪崔D(zhuǎn)原則,需要的可以參考一下2022-07-07C#實(shí)現(xiàn)PDF簽名時(shí)添加時(shí)間戳的2種方法(附VB.NET代碼)
在PDF添加簽名時(shí),支持添加可信時(shí)間戳來保證文檔的法律效應(yīng)。本文,將通過C#程序代碼介紹如何添加可信時(shí)間戳,可通過2種方法來實(shí)現(xiàn)。感興趣的可以了解一下2021-05-05c#之圓形無標(biāo)題欄橢圓窗體的實(shí)現(xiàn)詳解
本篇文章是對(duì)c#中圓形無標(biāo)題欄橢圓窗體的實(shí)現(xiàn)方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06