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

Export RadGrid to PDF with CSS

1 Answer 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 22 Sep 2011, 03:41 AM
Hi,
I am trying to export RadGrid to PDF or Excel with CSS, I looked at the sampe at:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx
and have the following questions:
(1) What ever css I apply to the grid for rendering will not apply for exporting, right?
(2) Can I use css class for exporting styles? The sample seems to use inline styling only
(3) Will the same styles for exporting pdf work with exporting for Excel?

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 26 Sep 2011, 04:17 PM
Hello Ed,

Straight onto your questions:

1) Inline styles will be applied in all cases (except for CSV of course). HTML formats (Word and Excel) supports CSS classes, but you must ensure that the corresponding classes are added to the exported file.

2) PDF format does not support classes because it is not HTML-based.

3) As mentioned above, inline styles are best choice if you want to reuse the code for all formats.

Regards
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Ed
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or