Richard,
That was actually the advice I was hoping for.
Now, I have a question or two about this approach. Apparently, if you create
xls file by using Response.ContentType = "application.x-msexcel" the
spreadsheet fails to open, due to the presence of the datagrid object (i.e.
if the datagrid is not there it works fine). However, I could use the
datatable (datagrid source) and build html table that I can stream into
response object. The question I have is this: is it possible (if yes, how)
to accomplish this without creating the new page (which would create a clean
Response object). That is, is it possible to use the Response object of the
existing page?
I'll keep on researching this idea.
Thanks for the pointer
Milan
[quoted text, click to view] "Richard K Bethell" <softdev@spammingisevil.bad> wrote in message
news:OagX4NqsDHA.540@tk2msftngp13.phx.gbl...
> "Milan Todorovic" <milan.todorovic@ttu.edu> wrote in message
> news:Ol04CAqsDHA.3140@TK2MSFTNGP11.phx.gbl...
> > I desperately need help.
> >
> > I have an ASP.NET (in VB.NET) app that displays the data within the
> datagrid
> > object. I need to allow for exporting of that data to the Excel
> spreadsheet.
> > I have tried using Excel (referenced) object, but for some reason I
can't
> > get it to work. I get all sorts of COM errors.
> > I'm looking for the simplest solution, since I do not care about any
Excel
> > formatting or functionalities.
>
> Here's what we did. Offer a pop-up window from your page to return the
data
> as Excel. In the asp.net page for the popup, render the same datatable to
a
> datagrid, and return the page with the Response.ContentType MIME type set
to
> 'application/x-msexcel'
>
> R.
>
>