User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 26 Jul 2005, 14:57   #1
Dante Hicks
Clerk
 
Join Date: Jun 2001
Posts: 13,940
Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Exporting to Excel

Can anyone think of an elegeant / "nice" way of doing the following...

I have various data about properties in various SQL databases, some of which people want to produce some simple reports on (e.g. show me all properties on so and so street). This side of things isn't a problem, using a web (asp) interface + some simple ODBC stuff I can get nice looking HTML tables listing all sorts of data, presented in a way which highlights certain things (e.g. I can list every property and then highlight each one in red which has asbestos in it by simply doing an if....asbestos_flag = true then...css class='red' type thing).

However, quite a lot of users want to export this information to Excel (to remodify, print, merge with other spreadsheets and so on). Right now all I can offer them is a simple "Export to CSV" which they can then open in Excel and play with as they like - however this obviously loses all formatting. Is there any easyway I can create "rich" Excel files (e.g. with Bolded columns, some rows in red and so on) on the fly using ASP or some sort of allied technology?
Dante Hicks is offline   Reply With Quote
Unread 26 Jul 2005, 15:00   #2
Heartless
CRASHING BEATS 'N FANTASY
 
Heartless's Avatar
 
Join Date: Mar 2001
Location: Cold Country.
Posts: 1,912
Heartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like him
Re: Exporting to Excel

You might want to take a look at the Excel DOM. It is a monster, yes, but since you are using ASP it is to access anyways.
Not sure if it requires MS Office to be installed, though ... coding ASP was a long time ago.
__________________
Ią! Ią! Munin F'tagn! - [*scendancy]
Heartless is offline   Reply With Quote
Unread 26 Jul 2005, 18:15   #3
Caesar2
Commander
 
Caesar2's Avatar
 
Join Date: Sep 2001
Location: Netherlands
Posts: 146
Caesar2 is just really niceCaesar2 is just really niceCaesar2 is just really niceCaesar2 is just really nice
Re: Exporting to Excel

You can use this at the beginning of your page:
Code:
<% 
   Response.ContentType = "application/vnd.ms-excel"
%>
__________________
Quote:
Originally posted by Cochese
Cathaar are not overpowered.

You were just "bashed", live with it.
Caesar2 is offline   Reply With Quote
Unread 26 Jul 2005, 19:17   #4
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Re: Exporting to Excel

From a quick google,
If they have at least Office 97: http://support.microsoft.com/default...;en-us;Q301044
If they have Office 2003, you could use the new Excel XML format and just print out your data in a clumsy yet simple manner.

Or if you want to generate a .XLS file you can use CreateObject("Excel.Application") and save a workbook to a file. (Heartless: did you mean COM rather than DOM?)
__________________
#linux
queball is offline   Reply With Quote
Unread 27 Jul 2005, 00:11   #5
Heartless
CRASHING BEATS 'N FANTASY
 
Heartless's Avatar
 
Join Date: Mar 2001
Location: Cold Country.
Posts: 1,912
Heartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like him
Re: Exporting to Excel

Quote:
Originally Posted by queball
Or if you want to generate a .XLS file you can use CreateObject("Excel.Application") and save a workbook to a file. (Heartless: did you mean COM rather than DOM?)
Yeah, I meant COM, sorry. Been a bit busy with Javascript lately, so I mixed the two abbreviations, my bad. It is pretty similar to each other anyways.
__________________
Ią! Ią! Munin F'tagn! - [*scendancy]
Heartless is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 05:26.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018