Yes, the last thing I do is a Reponse.Write(</table>) followed by Response.End()
My code is almost exactly as you have above, except I'm not setting NoCache. I'll try that first thing on Monday. On Apr 10, 6:52 pm, AstroDrabb <[email protected]> wrote: > 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 displaysAction > > Cancelled. > > I'm setting the content type and content-disposition in the aspx file > > and that seems ok. Is there anything Icando to avoid displaying > > thisActionCancelled message or even close the browser in the > > background? (Unsure if thiscanbe 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
