【发布时间】:2015-07-24 20:21:40
【问题描述】:
我有下面的代码 它的功能是使用 CrystalReports 从屏幕上的报表中加载数据。
Dim strExportFile As String
strExportFile = "ReportReajustesAplicados.pdf"
Dim s As System.IO.MemoryStream = relat.ExportToStream(ExportFormatType.PortableDocFormat)
With HttpContext.Current.Response
.ClearContent()
.ClearHeaders()
.ContentType = "application/pdf"
.AddHeader("Content-Disposition", "inline; filename=" & strExportFile)
.BinaryWrite(s.ToArray)
.End()
End With
当我提取数据时。
我有以下错误
无法将“FileStreamDeleteOnClose”类型的对象转换为“System.IO.MemoryStream”类型。
我尝试使用 System.IO.Stream,提取成功但没有在屏幕上显示数据,因为“.BinaryWrite (s.ToArray)”不接受 ToArray 方法。
注意:当我放
#if DEBUG Then
CrystalReportViewer1.ReportSource = relat
CrystalReportViewer1.DataBind ()
Exit Sub
If #End
作品
我需要它来工作,但在发布模式下。
帮帮我
【问题讨论】:
标签: vb.net visual-studio-2010 crystal-reports