rookie
|
| Posted: 04/23/2004, 2:44 PM |
|
Why when I export to excel all cell are transform to "General" format?
Haw can I preserve cell formats (date, number, etc) in the CCS page they are
in proper format, I even established the data type, format, dbformat
values....! but it doesnt work...
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 07/02/2004, 11:10 AM |
|
Web applications usually don't create Excel files and cells aren't transformed to anything. Excel simply opens HTML tables in such way.
Possibly there is some solution in Excel for this and you may want to look into Excel help files, Microsoft support site, or Google to see if others were able to solve this.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
LV
|
| Posted: 07/05/2004, 6:50 AM |
|
Try this,
Add this code to before show event of your form. I had a problem of numeric fields output as text in Excel therfore I can't do any calculation on them add the below code provided by help from support and it solved my problem. Just don't ask me to explain what each line does. Hope this work for you.
response.Clear()
response.Charset = ""
Page.EnableViewState=False
Response.ContentType="application/vnd.ms-Excel"
Response.AddHeader("Content-Disposition","inline;filename=""Report5.xls""")
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 07/05/2004, 11:14 AM |
|
The above code doesn't set any formatting for the cells, just tells the browser to open this HTML in Excel. I'm assuming that this is what rookie is using if he is able to open his page in Excel.
But I just thought that maybe the problem is the space (again). Check previous forum posting (search for "Excel space") and you will see how others solved this.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|