Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default C#, OWC10 and forcing formatting on columns.

Instead of a trailing space, try a leading single quote (ascii 39).

--

"Diggler" wrote in message ...
I am looking for the proper way to force formats on a columns when streaming an Excel spreadsheet to the browser based on a DataTable. I am using Asp.Net with C#. Data source is from SQL Server 2000. One column that I am having problems with has a varchar data format in the database; it has code numbers like:

595-1
595-9
595-17
etc.

When this shows up in Excel using OWC10, the data that is in the

format ###-## shows up properly, but the data that is in the format
###-# gets converted somehow to a number. For example, 595-1 gets
transformed in Excel to -476639. Why is this, and how can I get this
data to be treated as the string value "595-1"? I can 'hack' it by
adding a space after the value, like "595-1 " but I'd rather have the
clean data with no extraneous whitespace. I don't understand why this
is happening for some values and not others?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing the display of new custom formatting Sagebrook Excel Discussion (Misc queries) 3 July 21st 09 10:10 PM
owc10 pivotchart save in c# windows forms of vs.net Delphi Charts and Charting in Excel 0 November 30th 05 05:59 AM
Forcing Columns to Next Page [email protected] Excel Discussion (Misc queries) 1 July 12th 05 11:33 PM
Live chart on Userform Printing OWC10 rci Excel Programming 1 March 2nd 04 10:37 PM
OWC10, XMLSS and Excel97? Ben Smith Excel Programming 2 September 10th 03 04:11 PM


All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"