Creating an MDB/XLS file

A

A.M

Hi,

Using ASP.NET/VB.NET and SQL Server backend,
I need to return calculation results to user as an Access MDB file or Excel
XLS sheet.
What would be the best way to create a MDB or XLS file inside a .NET
program?

Thanks,
Ali
 
J

Jacob Yang [MSFT]

Hi Ali,

Firstly I want to thank Dino for his great help in this issue. Please check
his response carefully.

In addition, the following article is what Dino has mentioned in his post.

INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/default.aspx?scid=kb;en-us;257757
"...
Microsoft does not currently recommend, and does not support, Automation of
Microsoft Office applications from any unattended, non-interactive client
application or component (including ASP, DCOM, and NT Services), because
Office may exhibit unstable behavior and/or deadlock when run in this
environment.
..."

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Chris Becker

I'd drop the idea of creating an MDB.

But on the excel side, you don't have to using office automation to "create"
an excel spreadsheet. Excel know how to parse HTML tables, so you can
create a spreadsheet that way.

Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-Disposition", "filename=" + "calculations.xls")
Response.write("<table><tr><th>Data</th><td>2</td></tr></table>")
Response.End

If you are using VS.NET make sure to remove everything from the .aspx file
except for the <% @Page ...%> directive.

Don't change the name of the page from .aspx! That is handled by the
Content-Disposition header

If you provide a link to this page, the user will be prompted to download
the .xls file or open it in Excel.

If you need actual formulas and stuff in the spreadsheet, you'll have to do
some experimenting. Don't know if that can be done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top