返回首页

Public Sub ExportGridToExcel(ByRef grdGridView As GridView, ByVal fileName As String)

Response.Clear()

Response.AddHeader("content-disposition", String.Format("attachment;filename={0}.xls", fileName))

Response.Charset = ""

Response.ContentType = "application/vnd.xls"

Dim strWr As New StringWriter()

Dim HtmlWr As New HtmlTextWriter(strWr)

grdGridView.RenderControl(HtmlWr)

Response.Write(strWr.ToString)

Response.End()

End Sub
请告诉我怎样才能在PDF格式转换| irfanansari:S.Sls76 | |海,这里是一个例子来创建一个PDF文件使用在vb.net
暗淡文档作为新的文件(iTextSharp.text.PageSize.LETTER,10,10,42 itextsharp.dll 35)
暗淡作家PdfWriter = PdfWriter.GetInstance(DOC,新的FILESTREAM("F:\临时\ sample.pdf",FileMode.Create))
doc.Open()


点心段("这是我的第一款")作为新的第
作为新的词语("这是我的第一句话")
作为新块的点心chunk_(DIM pharse"这是我第一次块")

doc.Add"(段)
(doc.Add pharse)
doc.Add(chunk_)

doc.Close"():S.Sls76 |下载的DLL iTextSharp从http://www.codeproject.com/KB/cs/iTextSharpPdfTables/iTextSharpPdfTables.zip

,然后连接您的应用程序资源

回答

评论会员:S 时间:2