Example of exporting a crystal report in ASP.NET

xiaoxiao2021-03-06  65

ASP.NET provides downloads directly from the crystal report.

..................................

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 (St.Toint32) AS BYTE St.Read (b, 0, convert.toint32 (st.ens)) Page.Response.binaryWrite (b) Page.Response.end () st.close ( )

转载请注明原文地址:https://www.9cbs.com/read-120134.html

New Post(0)