This is a migrated thread and some comments may be shown as answers.

Abreviate month for 'fr-FR' not compatible with Excel

5 Answers 124 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anne
Top achievements
Rank 1
Anne asked on 24 Jun 2011, 08:50 AM
Hi,

The data format string 'MMM' display a point (janv.) with culture 'fr-FR'.
But when whe export data in Excel, it is not recognize like a date and user can't change display for another date format.

Can you help me to display abreviate month without point like 'en-GB', for compatibility with Excel date format.
Anne

Precisions :

DataFormatString

 

="{0:dd-MMM-yy}" = 03-janv.-11 (fr-FR)

 

DataFormatString="{0:dd-MMM-yy}" = 03-jan-11 (en-GB)

 

5 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 30 Jun 2011, 09:52 PM
Hello Anne,

You shouldn't change the number format directly as Microsoft Excel won't recognize the dates properly. Instead, leave the values in their default format and use mso-number-format style to set it to French.
For more information, please examine the following link:
Word/Excel export (HTML-based)

Best regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Anne
Top achievements
Rank 1
answered on 01 Jul 2011, 01:53 PM
Hello Daniel,

Thanks for your anwer.

I add this code :
Private Sub MyRadGrid_ExportCellFormatting(ByVal sender As Object, ByVal e As Telerik.Web.UI.ExportCellFormattingEventArgs) Handles MyRadGrid.ExportCellFormatting
        Select Case e.FormattedColumn.UniqueName
           Case "MyDate"
                If sculture = "fr-FR" Then
                    e.Cell.Style("mso-number-format") = "dd-MMM-yy"
                End If
                Exit Select
             End Select
    End Sub

And in Excel, it is the same result : 03-janv.-11

Why Telerik Grid display a point ?

Regards,
Anne
0
Daniel
Telerik team
answered on 05 Jul 2011, 02:12 PM
Hello Anne,

Please test the attached project and let me know whether it works properly at your side.

Regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Anne
Top achievements
Rank 1
answered on 11 Jul 2011, 11:13 AM
Hello Daniel,

I tested your project which works properly on my PC (VS2008).

On my owner project, I delete the DataFormatString on a datetime column of my RadGrid. The Format of excel export is good
dd-MMM-yy = 03-janv-11

But I don't want delete the DataFormatString of my RadGrid.

Regards,
Anne
0
Daniel
Telerik team
answered on 15 Jul 2011, 10:44 AM
Hello Anne,

You don't have to drop the DataFormatString properies. The solution is simple - in the export button's handler (when using external button) or in the ItemCommand event (when using the built-in buttons) traverse all columns and clear the aforementioned property. This setup won't break the existing functionality of your website.

Regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Anne
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Anne
Top achievements
Rank 1
Share this question
or