On Wed, Apr 8, 2009 at 3:19 PM, Allan <[email protected]> wrote:
>
> I'm currently writing a service which sends users an email when
> reports they have scheduled are ready to be viewed.  When the user
> clicks the link in the email, it opens up a page which grabs the guid
> from their link and pulls their report based on that.  The site then
> spits out the report as an Excel file.  This seems to work perfectly
> fine and isn't an issue, Excel opens fine and the reports looks ok,
> but the browser in the background they opened displays Action
> Cancelled.
> I'm setting the content type and content-disposition in the aspx file
> and that seems ok.  Is there anything I can do to avoid displaying
> this Action Cancelled message or even close the browser in the
> background?  (Unsure if this can be done since it's the one opening
> Excel.)  Any help would be greatly appreciated.

Hmm.  When I send an Excel file I set these:

Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=Export.xls");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Charset = "";
Response.Write(exportToExcel(ds).ToString());
Response.End(); //!!

Are you ending your response in your code after you send your data?

Jim

Reply via email to