Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading Database Information to the DeskTop

Status
Not open for further replies.

Cranger

Programmer
Apr 4, 2001
54
US
I am not sure if this is the right forum, but I am trying to allow a user on our Intranet Site to download data in a predetermined format onto an Excel Spreadsheet on there desktop. Can this be down throught ASP, or is there some COmponent that I can buy to accomplish this.?

Another option, I could always set up an Excel sheet to access the database and write some VBA code to populate the sheet, but I want to see if I can give the user a download option first. Any IDEAS???
 
You just want the user to download the spreadsheet? Use the hyperlink tags to point at the file:

<A HREF=&quot;C:\spreadsheets\file1.xls&quot;>Excel SpreadSheet</A>

With ASP you would make the file path and title dynamic:

<A HREF=&quot;<%=filepath%>&quot;><%=filetitle%></A>

Does this help? -Chris Didion
Matrix Automation, MCP
 
Well, Kind of.

I have data on a SQL Server Database. A group of users need this data in excel. I want to give them a download option from an ASP page. When they hit download, somehow, someway, the data from our server should populate and EXCEL spreadsheet. I am not sure when/how to create the spreadsheet and populate it with the data.
 
I have a side-project where I'm doing this same thing over the internet. The user selects a part number and date range and an excel file is created with the information. My solution is to create a dll that accepts the part number and date range, connects to the database, retrieves the info, then builds the excel document. The asp page will instantiate the dll, provide it the information, and build the tag you see above.

If you're on an intranet, maybe you could connect to the database directly from the client machines in excel. You could write an add-in that would hit the database and fill the spreadsheet right from within excel...

Hope this helps. -Chris Didion
Matrix Automation, MCP
 
another way to this is to create a file on your server that has all the data that you want in a spreadsheet. i imagine you can use SQL Server to write the file, you can do it in Oracle for sure. The data must be tab delimited and you must save the file with a .xls extension.

then, when the file is opened, excel will automatically populate the fields based on the tabs. so if you had

test(tab)row(tab)1
test(tab)row(tab)2
test(tab)row(tab)3
test(tab)row(tab)4

where the (tabs) where actual tabs, and you opened the file in excel you would have 4 rows of 3 columns populated appropriatly. then just give a link to the file as suggested by cdidion

we have this coded on an e-commerce site and it works quite nicely.
 
Thanks for all your input.
This was very very Helpful!
 
You could create an Excel document with VBA macros in that have public methods you pass data to, these methods could then format the excel spreadsheet save it onto the server in a location of your choice. You can then link <a href> to that document from the ASP page or automatically load it when the spreadsheet has saved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top