我正在本地主机上使用水晶报告,它似乎工作正常但是当我发布网站时,它不需要计算发布水晶报告文件,当我将它复制到我的项目的位置时似乎没有工作。我在google上找不到与此相关的任何内容。
这是我正在使用的代码
Function Print()
Dim rptH As ReportClass = New ReportClass
Dim dt As New DataTable
Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter
Dim cmd As SqlClient.SqlCommand
Dim conn As New SqlConnection(connectionString)
Dim sSql As String
sSql = "EXEC SP_MEDICINE_BILL 1,2014,1,104493,' ',' '"
cmd = New SqlClient.SqlCommand(sSql, conn)
da.SelectCommand = cmd
cmd.CommandTimeout = 300
da.Fill(ds, "SP_MEDICINE_BILL")
rptH.FileName = Server.MapPath("~/Reports/MedicineBillDoc.rpt")
rptH.Load()
rptH.SetDataSource(ds)
Dim stream As Stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Return File(stream, "application/pdf")
End Function