asp.net中将水晶报表直接输出提供下载。
………………………………
Case "PDF"
exp.ExportFormatType = ExportFormatType.PortableDocFormat
exp.FormatOptions = New PdfRtfWordFormatOptions()
filename = "pdf"
…………………………………
Dim req As New ExportRequestContext()
req.ExportInfo = exp
Dim st As System.IO.Stream
st = rdRpt_1.FormatEngine.ExportToStream(req)
Page.Response.ClearHeaders()
Page.Response.ClearContent()
Page.Response.ContentType = "application/x-msdownload"
Page.Response.AddHeader("Content-Disposition", "attachment;filename= " & filename)
Dim b(Convert.ToInt32(st.Length)) As Byte
st.Read(b, 0, Convert.ToInt32(st.Length))
Page.Response.BinaryWrite(b)
Page.Response.End()
st.Close()