转换为Word/Excel和Pdf [英] Convert to Word/Excel and Pdf
问题描述
尊敬的先生/女士
我在将Gridview转换为Word/Excel时遇到问题.
I have problem in converting Gridview to Word/Excel.
我有一个GridView
I have a GridView
< asp:GridView ID ="GridView1" runat ="server" OnRowDataBound ="GridView1_RowDataBound" EnableViewState ="false"></asp:GridView>
<asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" EnableViewState = "false"></asp:GridView>
问题在于,当我运行了无需EnableViewState ="false"的代码即可转换为word/Excel时,我的代码可以正常运行,但是使用此属性不会产生结果
Problem is that when i have run the code for converting into word/Excel without EnableViewState ="false" my code run properly but using this property no result comes
还有任何无需使用第三方dll或任何免费dll的pdf转换解决方案.
also any solution for pdf convertion without using 3rd party dll or using any free dll.
Plz帮助
推荐答案
您应该将数据源导出到word/excel文件.可以使用互操作来完成.
You should be exporting your datasource to the word/excel file. That can be done using interop.
对于PDF生成,iTextSharp是一个很好的库.但是,由于您不需要第三方组件,因此请查看PDF Metamorphosis.我猜那是完全用.Net编写的.这将使您对如何创建PDF有所了解.
For PDF generation, iTextSharp is a good library. But since you are not looking for a third party component, look into PDF Metamorphosis. I guess that is written completely in .Net. That will give you some idea on how to create PDF.
这篇关于转换为Word/Excel和Pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!