Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Exporting to Excel using CSS

 
Thread Tools Search this Thread
Old 01-12-2004, 08:19 PM   #1
Default Exporting to Excel using CSS


I have code that generates a dataset and sends the results to the user
and automatically opens Excel when the link is clicked. It works fine on
my own machine and one server but I get the following error on another
server:

Problems cam up in the following areas during load: Missing file
http://abc.com/app/mystylesheet.css

The style sheet is present on the website so it isn't missing. It's some
kind of permission problem but I don't know what. The working server
appears configured the same as the non-working server in IIS.

Here's a basic idea of how I'm sending the data to the user:

1) set response.contenttype = "application/vnd.ms-excel"
2) create stringwriter and htmltextwriter objects
3) write the HTML HEAD information (including the LINK to the
stylesheet) to the htmltextwriter object
4) write a BODY tag to the htmltextwriter
5) fill a datagrid with the query results
6) render the datagrid to the htmltextwriter
7) end the BODY and HTML tags in the htmltexwriter
reponse.write the stringwriter and do a response.end

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Matt
  Reply With Quote
Old 01-12-2004, 11:09 PM   #2
Matt
 
Posts: n/a
Default Re: Exporting to Excel using CSS
It turns out that the problem is easy to recreate. If I save the file as
HTML to the server then try to open the file using Excel the same thing
happens. This is basically what is happening when I do the response.end and
send the file to the user. The LINK statement in the code tries to open the
CSS file but it can't find it.

Still not sure what I can do about it though.

"Matt" <> wrote in message
news:...
> I have code that generates a dataset and sends the results to the user
> and automatically opens Excel when the link is clicked. It works fine on
> my own machine and one server but I get the following error on another
> server:
>
> Problems cam up in the following areas during load: Missing file
> http://abc.com/app/mystylesheet.css
>
> The style sheet is present on the website so it isn't missing. It's some
> kind of permission problem but I don't know what. The working server
> appears configured the same as the non-working server in IIS.
>
> Here's a basic idea of how I'm sending the data to the user:
>
> 1) set response.contenttype = "application/vnd.ms-excel"
> 2) create stringwriter and htmltextwriter objects
> 3) write the HTML HEAD information (including the LINK to the
> stylesheet) to the htmltextwriter object
> 4) write a BODY tag to the htmltextwriter
> 5) fill a datagrid with the query results
> 6) render the datagrid to the htmltextwriter
> 7) end the BODY and HTML tags in the htmltexwriter
> reponse.write the stringwriter and do a response.end
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!





Matt
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting from Avid Newscutter for DVD production. (PLEASE HELP!) Richard Stewart DVD Video 0 01-21-2008 03:20 AM
Save an Excel file, created from a DataGrid, programmatically.. tapasmahata Software 0 01-12-2008 05:39 AM
How to run a Excel Macro from the Java application? Kiranu General Help Related Topics 0 09-12-2007 02:11 PM
Uploading Excel file into sql table shalim Software 1 10-31-2006 08:57 AM
DVD Verdict reviews: EXCEL SAGA: IMPERFECT COLLECTION and more! DVD Verdict DVD Video 0 09-02-2004 10:08 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46