views:

1066

answers:

2

Hi all

We have a legacy ASP page that writes content to an excel file by generating client-side VB script based on data from the database. It uses set app = CreateObject("Excel.Application") to initialize Excel.

The problem is that this is an "unsigned activex control", and some clients are now saying they wont change their IE settings to make it work.

Apart from re-writing the page in ASP.NET using Aspose.Cells (which would take a long time for this page), I was wondering if anyone knows any other options that could help?

Thanks!

A: 

Although this thread refers to ASP.Net, a lot of it may be of interest to you:

http://stackoverflow.com/questions/148945/send-query-results-to-excel-from-asp-net-website

It mentions creating HTML output and modifying the headers to output to Excel. This may also be of interest http://support.microsoft.com/kb/199841

Here is a very simple example.

<%
Response.ContentType = "application/vnd.ms-excel"
%>
<TABLE>
<TR><TD>
<!-- Cell : A1 -->
2
</TD></TR>
<TR><TD>
<!-- Cell : A2 -->
3
</TD></TR>
<TR><TD>
<!-- Cell : A3 -->
=SUM(A1:A2)
</TD></TR>
</TABLE>
Remou
A: 

Thanks for the response. The problem is that the our spreadsheet generated has lots of additional functionality, e.g. setting up some "validation" for certain columns - the HTML solution would not be able to do this I think.

However - your answer forced me to take another look at the code, and it turns out simpler than I thought to do this using an "Excel Writer" like Aspose.Cells :)

Matt Roberts