Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Formatting Excel spreadsheet with asp

Reply
Thread Tools

Formatting Excel spreadsheet with asp

 
 
Josh Schmidt
Guest
Posts: n/a
 
      11-18-2004
I'm using the Excel application object to create a
spreadsheet from a recordset. Everything seems to work
fine except any date fields are not displaying properly.
For example 4/18/2004 is displaying as 38095 in the
spreadsheet.

I loop through the recordset to display each row. The
line that actually writes out the field is:

objSpreadsheet.Cells(iRow, iCol).Value = objField.Value

Any suggestions?

Thanks,

Josh Schmidt
 
Reply With Quote
 
 
 
 
Tom Kaminski [MVP]
Guest
Posts: n/a
 
      11-19-2004
"Josh Schmidt" <(E-Mail Removed)> wrote in message
news:74bd01c4cdbf$98eca630$(E-Mail Removed)...
> I'm using the Excel application object to create a
> spreadsheet from a recordset.


Generally not a good idea:
http://support.microsoft.com/default...b;en-us;257757

> Everything seems to work
> fine except any date fields are not displaying properly.
> For example 4/18/2004 is displaying as 38095 in the
> spreadsheet.
>
> I loop through the recordset to display each row. The
> line that actually writes out the field is:
>
> objSpreadsheet.Cells(iRow, iCol).Value = objField.Value
>
> Any suggestions?


Display ASP Results Using Excel in IE with MIME Types
http://support.microsoft.com/default...b;en-us;199841

How To Format Cell Data When You Are Creating an Excel File With an Active
Server Pages Page
http://support.microsoft.com/default...b;en-us;260239

How to Create an Office Document in an ASP Application
http://support.microsoft.com/default...b;en-us;301044

To make sure you get formats right, "reverse engineer" the HTML by creating
a sample file in Excel and save it as HTML - look at the resulting HTML as
an example of what you need to do.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import an excel spreadsheet in ASP.NET Uma Muthu ASP .Net 5 04-10-2006 07:09 PM
ASP Page not opening a new Excel Spreadsheet each time. lds ASP .Net 2 01-04-2006 08:16 PM
ASP Page not opening a new Excel Spreadsheet each time. lds ASP .Net 0 01-04-2006 07:12 PM
Formatting asp generated spreadsheet + DiamondEagle ASP General 1 07-28-2004 05:24 PM
Re: Converting XML spreadsheet to native Excel in ASP.NET Ken Cox [Microsoft MVP] ASP .Net 1 07-02-2004 05:48 AM



Advertisments