Posts Tagged ‘Excel’

Prepare your report date fields for Excel export

May 26, 2008

I made some rdlc reports to be shown in report viewer.
Often theese reports are exported to Excel, for further processing.

I made a typed dataset for my tables, defining the date columns as ‘xs:date’
To remove the timestamp in the report, I used FormatDateTime(Fields!OrderDate.Value, 2), and everything was fine….. Untill the users start complaining, that the date columns where not formatted as date in the exported excel sheet.

The solution is to use the ‘Format’ property of the field, here you can specify the formatting for dates.
For example =”dd/MM/yyyy”. Here you can also make an expression to handle different language options etc.
This approach preserves the date format in exorted excel sheets.