mm/dd/yyyy

3.0.1.0 When trying to apply a NumberFormat of "mm/dd/yyyy", I only get "m/d/yyyy" when viewing in Excel. Here''s the code: for ( int i = 0; i < reportData.Count; i++ ) { mySheet.Range[ currentRow, 1 ].Text = reportData[ i ][ "Portfolio" ].ToString(); if ( reportData[ i ][ "TradeDate" ] != DBNull.Value ) mySheet.Range[ currentRow, 2 ].DateTime = Convert.ToDateTime( reportData[ i ][ "TradeDate" ] ); mySheet.Range[ currentRow, 2 ].NumberFormat = "mm/dd/yyyy"; currentRow++; } Any issue with this in version 3.0.1.0? Thanks!

1 Reply

AD Administrator Syncfusion Team February 24, 2005 12:17 PM UTC

Hi Shannon, Could you please try using this number format mySheet.Range[ "j1" ].NumberFormat = "mm/dd/yyyy;@"; This is a format that MS Excel uses to represent mm/dd/yyyy format Please let me know if you have any questions. Thanks, Stephen. >3.0.1.0 > >When trying to apply a NumberFormat of "mm/dd/yyyy", I only get "m/d/yyyy" when viewing in Excel. > >Here''s the code: > > for ( int i = 0; i < reportData.Count; i++ ) > { > mySheet.Range[ currentRow, 1 ].Text = reportData[ i ][ "Portfolio" ].ToString(); > if ( reportData[ i ][ "TradeDate" ] != DBNull.Value ) > mySheet.Range[ currentRow, 2 ].DateTime = Convert.ToDateTime( reportData[ i ][ "TradeDate" ] ); > mySheet.Range[ currentRow, 2 ].NumberFormat = "mm/dd/yyyy"; > > currentRow++; > } > >Any issue with this in version 3.0.1.0? > >Thanks!

Loader.
Up arrow icon