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

[Solved] How to preserve the new line in the row and the row's color in export to Excel?

5 Answers 155 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Viki
Top achievements
Rank 1
Viki asked on 14 Feb 2011, 08:42 AM
Hi,

I have a Grid View that has new lines (System.Environment.NewLine; \n) in its cells and different rows' colors, but if I export the Grid View to Excel, the new line and color of rows are not displayed in the Excel file. How can I preserve them?

Thanks,
Viki

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Feb 2011, 09:04 AM
Hi,

 Generally the grid can export styles only in HTML format. Can you verify if this is your case? 

Kind regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Viki
Top achievements
Rank 1
answered on 14 Feb 2011, 09:20 AM
No, I need that the export will be done to the Excel format

P.S.
I tried the ExportFormat.Html and the result is same as of ExportFormat.ExcelML, the style is not exported
0
Vlad
Telerik team
answered on 14 Feb 2011, 09:29 AM
Hello ,

 I'm not sure how these styles are set in your case however you can check our demo for more info how we've made the same. 

Best wishes,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Viki
Top achievements
Rank 1
answered on 15 Feb 2011, 08:50 AM
Hi,

I checked your demo and the rows' color is perfectly exported by the ElementExporting event, but as you said only for HTML format and I need to export to Excel format. So will there be some solution for Excel format in the near future?

P.S.
The ElementExporting event create a new specialy style for the exporting and what if I just want that the style of the exported document will be the same as of the GridView, that I export? Something like a default style that can be overided by the  ElementExporting event, or a part of ExportOptions (boolean GridViewExportOptions.ShowStyle :)) ....


Thanks,
Viki
0
Vlad
Telerik team
answered on 18 Feb 2011, 08:55 AM
Hello Viki,

 We will do our best to start work on this after our Q1 2011 release (middle of March). Unfortunately for Q1 it will be not possible to include such functionality. 

All the best,
Vlad
the Telerik team
Tags
GridView
Asked by
Viki
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Viki
Top achievements
Rank 1
Share this question
or