For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Crystal Reports > May 2005 > Exporting Crystal Report to Excel









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 Exporting Crystal Report to Excel
Mustufa Baig

2005-05-14, 7:14 pm

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.


Sponsored Links







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

Copyright 2008 codecomments.com