The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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!
ADAdministrator 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!