For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > June 2005 > ExportToHttpResponse









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ExportToHttpResponse
Marco Melluso

2005-06-03, 4:01 pm

I use the following code to export a report in PDF directly in the browser:

Dim rep As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rep.Load(path, OpenReportMethod.OpenReportByDefault)
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
rep.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response,
False, "")
Response.Flush()
Response.Close()

It works fine. If I want to change the export type in DOC or RTF changing
the following code:

Response.ContentType = "application/msword"
rep.ExportToHttpResponse(ExportFormatType.RichText, Response, False, "")

it doesn't work. The I.E. browser close itself.
Why?


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com