将 asp.net、C# GridView 输出为 PDF 的好方法是什么 [英] What is a good way to output an asp.net, C# GridView into a PDF

查看:22
本文介绍了将 asp.net、C# GridView 输出为 PDF 的好方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 Microsoft ReportingControls,但发现它们过于繁琐,文档太少.我想要一个简单的控件,可以将 GridView 控件转换为 PDF 文档.我已经开始研究 PDFSHArp 并且遇到了文档的死胡同.与 iTextSharp 相同.如果他们过去曾为其他人工作过,我愿意进一步深入研究.

I tried using the Microsoft ReportingControls but found them overly cumbersome, with too little documentation. I'd like a simple control that would convert a GridView control into a PDF document. I've started looking into PDFSHarp and am running into dead ends with documentation. Same thing with iTextSharp. I'm willing to dig into them further if they have worked for others in the past.

推荐答案

您可以遍历 gridview 中的数据并使用 iTextSharp 将其写入 PDF 表格.看看这里:http://www.codeproject.com/KB/cs/iTextSharpPdfTables.aspx

You could iterate over the data in your gridview and write it to a PDF table using iTextSharp. Have a look here: http://www.codeproject.com/KB/cs/iTextSharpPdfTables.aspx

我还建议您阅读iText In Action这本书.

I also recommend getting the book iText In Action.

这篇关于将 asp.net、C# GridView 输出为 PDF 的好方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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