非常感谢您的帮助。
我是新来这个网站的。
我需要创建一个程序来导出.rpt到pdf。我使用.rpt中的参数,因为我使用sql存储过程来创建报告。
我是用vb在asp.net 2008中开发的。
致以问候。
发布于 2016-06-25 06:09:33
我解决了我的问题。
这是代码,因为如果你需要它。
致以问候。
Dim PathFile As String = "c:\Documents" & "\Reporte.pdf"
formatType = ExportFormatType.PortableDocFormat
Dim oConexInfo As New CrystalDecisions.Shared.TableLogOnInfo
oConexInfo.ConnectionInfo.ServerName = "SERVER"
oConexInfo.ConnectionInfo.DatabaseName = "DBNAME"
oConexInfo.ConnectionInfo.UserID = "USERID"
oConexInfo.ConnectionInfo.Password = "PASSWORD"
rpt.Load(Server.MapPath("~/Imprime.rpt"))
rpt.SetParameterValue(0, Val(txt_No_Quotation.Text)) ' I send a parameter value
rpt.Database.Tables(0).ApplyLogOnInfo(oConexInfo) ' Here I send the credentials for conection to SQL Server with crystal reports
CrystalReportViewer1.ReportSource = rpt
ConfigureCRTSTALREPORT()
rpt.ExportToDisk(formatType, PathFile) ' Here I export the pdf to disk (in server side)https://stackoverflow.com/questions/37998736
复制相似问题