views:

31

answers:

1

Hi all,

I have a bit of code that I've used many times to export an HTML table into an Excel file, and it works fine. But now I have a new report that I need to be able to export that works fine when viewed as an HTML page, but viewed in Excel the entire spreadsheet is blank - no grid, no data, nothing.

<%Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment; filename=Inquiry-Test.xls"%>

The above is the code I'm using, and there are no logic errors on the page that prevents it from being shown. Has anyone else had this issue, or knows how to solve it?

And before someone asks, yes. I've tried using CSS to show black text and borders, with no luck.

Thanks.

+1  A: 

It could be that you are including HTML or BODY tags. Make sure you are only using TABLE, TR and TD tags, as I have had problems with using HTML and BODY tags in the past.

RedFilter
Holy crap, that did it. I've NEVER had this problem before, and I always included the HTML and BODY tags, for good style. Thanks.
tjsimmons
@RedFilter Aye, I had to wait for the timer to countdown, which happened while I was on lunch. Thanks again.
tjsimmons