Hello,
I have an OrgChart and a couple of labels and an image that I want to export to PDF using the RadClientExportManager.
Code .aspx:
table id="exporttopdf">
<
tr
>
<
td
>
<
asp:image
runat
=
"server"
imageurl
=
"~/styles/images/logo.png"
/>
<
asp:panel
runat
=
"server"
id
=
"Panel1"
visible
=
"false"
>
<
span
class
=
"content"
>
GRUPP: <
asp:Label
runat
=
"server"
ID
=
"Label1"
></
asp:Label
><
br
/>
DATUM: <
asp:Label
runat
=
"server"
ID
=
"Label2"
></
asp:Label
>
</
span
>
</
asp:panel
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadOrgChart
ID
=
"RadOrgChart2"
runat
=
"server"
GroupColumnCount
=
"1"
DisableDefaultImage
=
"true"
>
<
GroupEnabledBinding
>
<
NodeBindingSettings
DataFieldID
=
"ID"
DataFieldParentID
=
"ParentID"
/>
<
GroupItemBindingSettings
DataFieldNodeID
=
"NodeID"
DataFieldID
=
"ID"
DataTextField
=
"Text"
/>
</
GroupEnabledBinding
>
</
telerik:RadOrgChart
>
</
td
>
</
tr
>
</
table
>
However my swedish special characters doesn't show properly in the PDF.
I've been using this demo http://docs.telerik.com/devtools/aspnet-ajax/controls/clientexportmanager/how-to/exporting-special-characters
and it works as expected.
What do I need to do to get it to work with the orgChart?
Any suggestions appreciated
Regards
Janne
7 Answers, 1 is accepted
As it is explained in the Documentation article mentioned, you will have to load a Unicode font to the RadClientExportManager control:
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadClientExportManager1.PdfSettings.Fonts.Add(
"Arial Unicode MS"
,
"Fonts/ArialUnicodeMS.ttf"
);
}
and to assign the same font to be the font for the exported content:
#exporttopdf {
font-family
:
'Arial Unicode MS'
;
}
Keep in mind that you may also have to first import the font to your CSS.
Regards,
Veselin Tsvetanov
Telerik by Progress
Hello Vaselin,
Thank you for your reply. I have done what you suggest. To verify that I included a <div> vid some swdish characters in the <table> I export and they come out ok but not the special characters in the OrgChart. Do you have a working sample?
Best regards
Jan
#exporttopdf{
font-family
:
'ARIALN'
;
}
<script type=
"text/javascript"
>
function
exportElement() {
var
exp = $find(
"RadClientExportManager1"
);
exp.exportPDF($telerik.$(
"#exporttopdf"
));
}
</script>
<
table
id
=
"exporttopdf"
>
<
tr
>
<
td
>
<
div
>åäöÅÄÖ</
div
>
<
asp:image
runat
=
"server"
imageurl
=
"~/styles/images/logo.png"
/>
<
asp:panel
runat
=
"server"
id
=
"Panel1"
visible
=
"false"
>
<
span
class
=
"content"
>
GRUPP: <
asp:Label
runat
=
"server"
ID
=
"Label1"
></
asp:Label
><
br
/>
DATUM: <
asp:Label
runat
=
"server"
ID
=
"Label2"
></
asp:Label
>
</
span
>
</
asp:panel
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
telerik:RadOrgChart
ID
=
"RadOrgChart2"
runat
=
"server"
GroupColumnCount
=
"1"
DisableDefaultImage
=
"true"
>
<
GroupEnabledBinding
>
<
NodeBindingSettings
DataFieldID
=
"ID"
DataFieldParentID
=
"ParentID"
/>
<
GroupItemBindingSettings
DataFieldNodeID
=
"NodeID"
DataFieldID
=
"ID"
DataTextField
=
"Text"
/>
</
GroupEnabledBinding
>
</
telerik:RadOrgChart
>
</
td
>
</
tr
>
</
table
>
Attached you will find the sample. In order to make the export functionality work properly, I had to specify the same font-family for the RadOrgChart too:
#exporttopdf,
html .RadOrgChart {
font-family
:
'ARIALN'
;
}
Please excuse me for the missing selector in my previous reply.
Regards,
Veselin Tsvetanov
Telerik by Progress
Hello Vaselin,
Thank you, your code sample works fine when I try it on my end too. However when I replace your OrgChart with my databound one it doesn't work and I haven't been able to reproduce my problem in a sample solution. I'll work on that and get back to you if and when I do!
Best regards
Jan
Hey Jan,
Did you find a solution for this issue when exporting with a databound control?
In our browser the name ("Decaluwé") is displayed as it should be but in the PDF the "é" has been changed to an unknown character...
Kind regards,
Thomas
Hello Thomas,
I'm afraid I haven't. But let's share it here if any of us find a solution!
Thanks
Jan
I have tested the discussed scenario with a databound RadOrgChart, but I was not able to reproduce the issue observed. It seems, that there are some differences in the implementation I am testing with.
As I mentioned, my best suggestion is to isolated the issue in a runnable sample, which you could submit in a Support ticket. This way we will have the full information needed to troubleshoot the problem.
Regards,
Veselin Tsvetanov
Telerik by Progress