Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting crystal report to excel format

Status
Not open for further replies.

mubaig75

Programmer
Sep 16, 2004
11
CA
Hi everybody,

I have an ASP.NET website where clients can view their monthly billings by selecting different options. One of the option is the way they want to see the report i.e. whether they want to see it in PDF or EXCEL etc etc..... What I am trying to acheive is depending on their choice of format, I want to send the stream of that particulae selected format to the browser. I have tried couple od solutions but I couldn't able to get them to work. Following is one of them.

Following should work but I m getting the following error: "Thread was being aborted."

-------------------------------------------------------------------------------------------------------------

Private Sub xlsExport()

Dim oStream As New System.IO.MemoryStream()

oStream = myReport.ExportToStream(ExportFormatType.PortableDocFormat)

Response.Clear()

Response.Buffer() = True

Response.ContentType = "application/pdf"

Try

Response.BinaryWrite(oStream.ToArray()) <--------------------- error occured after this

Response.End()

Catch err As Exception

Response.Write("< BR >")

Response.Write(err.Message.ToString)

End Try

End Sub

-------------------------------------------------------------------------

Any help or sugestion will be highly appreciated.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top