2016-06-23 4 views
0

ありがとうございました。.rptのパラメータを含むasp.netの.rptにpdfをエクスポートする

このサイトでは新着です。

.rptからpdfにエクスポートする手順を作成する必要があります。 SQLのストアドプロシージャを使用してレポートを作成しているため、.rptでパラメータを使用しています。

私はasp.net 2008 vbで開発しています。

よろしくお願いいたします。

答えて

0

私は私の質問を解決しました。

必要に応じて、これがコードです。

よろしくお願いいたします。

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) 
関連する問題