Hi,
I want a grid export to PDF but after exporting formatting not showing on PDF.
I am using this style for formatting but it not works
item["Average"].Style["font-weight"] = "Bold"; item["Average"].Style["text-decoration"] = "underline";
OR
item["Average"].Font.Bold=true; item["Average"].Font.Underline=true;
Please Check the attachment .
I want a grid export to PDF but after exporting formatting not showing on PDF.
I am using this style for formatting but it not works
item["Average"].Style["font-weight"] = "Bold"; item["Average"].Style["text-decoration"] = "underline";
OR
item["Average"].Font.Bold=true; item["Average"].Font.Underline=true;
Please Check the attachment .
4 Answers, 1 is accepted
0
Hello Rahul,
I would recommend that you use the HTML tags for underline (u) and bold (b). Your approach with applying inline font-weight style will work properly if you change "Bold" to "bold".
Regards,
Daniel
Telerik
I would recommend that you use the HTML tags for underline (u) and bold (b). Your approach with applying inline font-weight style will work properly if you change "Bold" to "bold".
Regards,
Daniel
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
rahul
Top achievements
Rank 1
answered on 30 Dec 2014, 06:56 AM
Hi Daniel,
Thanks for reply, Actually my grid or its column is a dynamically created so i want to apply this style server side but it effects on Grid Data not work for after grid export to PDF. On PDF style not apply.
Please provide working simple source code with demo.
Thanks for reply, Actually my grid or its column is a dynamically created so i want to apply this style server side but it effects on Grid Data not work for after grid export to PDF. On PDF style not apply.
Please provide working simple source code with demo.
0
Hello Rahul,
Please try the following:
If you have a case where the whole column must have the same style then try this:
The above approach can also be implemented programmatically.
Regards,
Daniel
Telerik
Please try the following:
var cell = item[
"Average"
];
cell.Text = String.Format(
"<u>{0}</u>"
, cell.Text);
If you have a case where the whole column must have the same style then try this:
<
telerik:GridBoundColumn
... DataFormatString="<b>{0}</
b
>"></
telerik:GridBoundColumn
>
The above approach can also be implemented programmatically.
Regards,
Daniel
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
rahul
Top achievements
Rank 1
answered on 01 Jan 2015, 12:01 PM
Thanks Daniel, its work fine. :)