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

Grid export to excel new line issue

3 Answers 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex Vr
Top achievements
Rank 1
Alex Vr asked on 19 Oct 2010, 02:54 PM
Hello,

I have RadGrid with GridTemplateColumn that has text with <br> tags and some other html tags.
When I excport the grid to excel it splits every text line within the template row to cells.
How can I make all the text in the template cell exported as single cell?

Best Regards,
Alex Vr.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Oct 2010, 03:04 PM
Hello Alex,

Please have a look at this forum thread:
Export to Excel Issues

I hope this helps

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alex Vr
Top achievements
Rank 1
answered on 19 Oct 2010, 03:41 PM
Hello Daniel,

Thanks for the quick reply.
It's exectly the problem I have (#2 in the post), however the solution didn't work for me.
I tried using:
protected void LeadsRadGrid_GridExporting(object source, GridExportingArgs e)
    {
        if (e.ExportType == ExportType.Excel)
        {
            string css = "<style type='text/css'> br { mso-data-placement: same-cell; } </style>";
            e.ExportOutput = e.ExportOutput.Replace("</head>", css + "</head>");
        }
    }

But it still splits the cells.
Maybe it's bacuse I'm using OpenOffice to view the files?

Best Regards,
Alex Vr.
0
Daniel
Telerik team
answered on 19 Oct 2010, 04:27 PM
Hello Alex,

OpenOffice does not support the Microsoft Office HTML format. It parses the HTML code however the formatting tags/styles are probably ignored.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Alex Vr
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Alex Vr
Top achievements
Rank 1
Share this question
or