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

RadGrid Export Style

8 Answers 303 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James Raja
Top achievements
Rank 1
James Raja asked on 22 Oct 2008, 09:39 AM
i would like to have the exported document (.xls/.csv/.pdf) as it is in the web page i.e. with all styles whatever applied to the grid in the web page.

Is it possible t ?

Thanks
James

8 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Oct 2008, 11:35 AM
Hello James,

Currently RadGrid would not export any external styles(skins) in PDF. In addition some setting from ItemStyle, AlternatingItemStyle, HeaderStyle, etc. will not be preserved either.But a solution would be to set inline styles for the corresponding cells/rows. For more information on how to get this done go through the following kb article link.
Exporting styles in PDF

Thanks
Princy.
0
Dimo
Telerik team
answered on 22 Oct 2008, 11:39 AM
Hello James,

It is possible to apply styles to an exported RadGrid in Excel:

http://demos.telerik.com/aspnet/prometheus/Grid/Examples/GeneralFeatures/Exporting/DefaultCS.aspx

(check out the ExcelML export)

However, it will be a lot easier to use the PDF export.


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
James Raja
Top achievements
Rank 1
answered on 22 Oct 2008, 11:52 AM
Hello Princy/Dimo,

Thanks for your reply.

I have gone through the KB article. i still have some concerns over applying styles, it seems that the style atrributes are hard-coded.

Consider the scenario below.

I hav a RadGrid with "Vista" skin applied on it. Is it possible to retrieve the value of  "class" attribute of <th><td> etc., after databinding ?. If it is possible, then replacing the hard-coded styles with the retrieved styles will be fine. 

Thanks
James
0
Dimo
Telerik team
answered on 22 Oct 2008, 12:00 PM
Hi James,

I am afraid such CSS styles retrieval is not supported out-of-the-box. You will have to implement some sort of CSS file parsing in order to add non-hard-coded styles to the ExcelML exported file.

The PDF export provides a lot easier way to have a styled exported RadGrid.

Kind regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
James Raja
Top achievements
Rank 1
answered on 22 Oct 2008, 12:24 PM
Hi Dimo,

Thanks for your reply.

One more thing i want to know that is it possible to have the tootip associated with the radgrid item in the exported document (pdf/word/xls) as it appears in the web page. It is like having pdf annotation or word/excel document comment.

Please post your inputs.

Thanks
James
0
Dimo
Telerik team
answered on 27 Oct 2008, 11:48 AM
Hello James,

Yes, it is possible to include cell comments in Excel. Please review the attached example.

Also, refer to the following page for more information:

http://msdn.microsoft.com/en-us/library/aa140066(office.10).aspx#odc_xmlss_ss:comment


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
James Raja
Top achievements
Rank 1
answered on 30 Oct 2008, 07:31 AM
Hi Dimo,

Thanks for your response.

I have gone through the sample and it's working fine. The sample shows exporting the grid data in to the excel file with comments.

Do we have any namespace like "Telerik.Web.UI.GridExcelBuilder" for PDF/Word export with comments ?

Thanks
James
0
Dimo
Telerik team
answered on 30 Oct 2008, 07:57 AM
Hello James Raja,

Currently, there is no such namespace.

Best wishes,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
James Raja
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Dimo
Telerik team
James Raja
Top achievements
Rank 1
Share this question
or