为什么不打开pdf中的gridview数据. [英] Why not opening gridview data in pdf.

查看:79
本文介绍了为什么不打开pdf中的gridview数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

未打开pdf中的网格视图数据.错误出现在htmlparser.Parse(sr)
行的sr

Not opening grid view data in pdf. The error is giving in sr in the line htmlparser.Parse(sr)

Public Sub GridtoPDF()
Response.ContentType = "application/pdf"
       Response.AddHeader("content-disposition", "attachment;filename=Export.pdf")
       Response.Cache.SetCacheability(HttpCacheability.NoCache)
       Dim sw As New StringWriter()
       Dim hw As New HtmlTextWriter(sw)
       Dim frm As New HtmlForm()
       dgv1.Parent.Controls.Add(frm)
       frm.Attributes("runat") = "server"
       frm.Controls.Add(dgv1)
       frm.RenderControl(hw)
       Dim sr As New StringReader(sw.ToString())
       Dim pdfDoc As New Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F)
       Dim htmlparser As New HTMLWorker(pdfDoc)
       PdfWriter.GetInstance(pdfDoc, Response.OutputStream)
       pdfDoc.Open()
       htmlparser.Parse(sr) ' Error line
       pdfDoc.Close()
       Response.Write(pdfDoc)
       Response.End()
End Sub

推荐答案

我们不知道什么是PdfWRiter或htmlparser.它们不是.NET框架的一部分.我们不知道错误是什么,您没有告诉我们.我们无法读懂思想或做魔术.您需要告诉我们更多信息,或者与您使用的控件的提供者进行交谈.
We don''t know what PdfWRiter or htmlparser are. They are not part of the .NET framework. We don''t know what the error is, you did not tell us. We cannot read minds or do magic. You need to tell us more, or perhaps talk to the provider of the controls you''re using.


这篇关于为什么不打开pdf中的gridview数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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