Hi,
I'm having another problem exporting a radgrid to PDF, it seems to be very flakey. Working one minute and then not another. I get this error when I try to apply a font-family style to either the CommandItem, GridDataItem or GridFooterItem:
This is the code I have in the ItemCreated on the RadGrid:
The grid exports with the font family set to Arial but the actual font in the pdf export does not change. I've looked at the tips and tricks and can't see anything missing.
Also, this works on the dev server but not on my dev machine (local copy). Am I missing something, does something need to be set installed on the server. Like I mentioned before it does seem flakey.
Thanks
I'm having another problem exporting a radgrid to PDF, it seems to be very flakey. Working one minute and then not another. I get this error when I try to apply a font-family style to either the CommandItem, GridDataItem or GridFooterItem:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Web.Apoc.Pdf.PdfFontCreator.CreateBase14Font(String pdfFontID, Base14Font base14)
at Telerik.Web.Apoc.Pdf.PdfFontCreator.MakeFont(String pdfFontID, Font font)
at Telerik.Web.Apoc.Pdf.FontSetup.AddToResources(PdfFontCreator fontCreator, PdfResources resources)
at Telerik.Web.Apoc.Render.Pdf.PdfRenderer.StopRenderer()
at Telerik.Web.Apoc.StreamRenderer.StopRenderer()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)
This is the code I have in the ItemCreated on the RadGrid:
if
(e.Item
is
GridDataItem)
{
//e.Item.Style["color"] = "white"; //Default color for headeritem/dataitem
foreach
(TableCell cell
in
e.Item.Cells)
{
cell.Style[
"font-family"
] =
"Arial Unicode MS"
;
cell.Style[
"font-size"
] =
"10px"
;
}
}
if
(e.Item
is
GridFooterItem)
{
foreach
(TableCell cell
in
e.Item.Cells)
{
cell.Style[
"font-family"
] =
"Arial Unicode MS"
;
cell.Style[
"color"
] =
"#000"
;
cell.Style[
"font-size"
] =
"8px"
;
}
}
if
(e.Item
is
GridCommandItem)
{
//.Style["font-weight"] = "bolder";
e.Item.Style[
"font-size"
] =
"10px"
;
e.Item.Style[
"font-family"
] =
"Arial Unicode MS"
;
//Set UNICODE font
//e.Item.Style["color"] = "#990099";
}
The grid exports with the font family set to Arial but the actual font in the pdf export does not change. I've looked at the tips and tricks and can't see anything missing.
Also, this works on the dev server but not on my dev machine (local copy). Am I missing something, does something need to be set installed on the server. Like I mentioned before it does seem flakey.
Thanks