473,396 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Creating an MDB/XLS file

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
Nov 17 '05 #1
3 1835
Excel has an OLEDB provider.
It's pretty easy to extract data from SQL to Excel.

http://www.winisp.net/cheeso/srcview...ractToExcel.cs
You should not try to use Office automation from a server app.
There's a KB article that describes why.

-Dino

--
Dino Chiesa
Microsoft Developer Division
d i n o c h @ o n l i n e . m i c r o s o f t . c o m
"A.M" <IH*******@sapm123.com> wrote in message
news:Oj*************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #2
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...b;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.

Nov 17 '05 #3
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.


"A.M" <IH*******@sapm123.com> wrote in message
news:Oj*************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeremy Langworthy | last post by:
Hi I am trying to create a MS Excel format CSV but I can't figure out how to get the line feed/carriage return/new record working properly. I am nding each line/record with these characters:...
1
by: Inpreet | last post by:
Hello I am using: ************************************************************************* header("Content-Type:application/force-download",false); header("Content-Disposition: attachment;...
1
by: dave | last post by:
I first started using HCW.exe to compile .rtf filew created with MS Word a couple of weeks ago. I used the file | new menu then selected New project in the dialog box and everything worked as...
1
by: C-man | last post by:
Basically I have this little program that will look through directories and rename any file it finds. The renaming that takes place is like removing of dashes or Caps the first letter from each...
2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
1
by: MT | last post by:
We have a .NET dll that we are deploying to our customers using a deployment project in VS .NET 2003. There is a lot of information about creating publisher policies on the web, but we have not...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.