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

OrgChart export to pdf special characters

7 Answers 176 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 11 Aug 2016, 07:42 AM

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

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 16 Aug 2016, 06:26 AM
Hi Jan,

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
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Jan
Top achievements
Rank 1
answered on 16 Aug 2016, 08:29 AM

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>
0
Veselin Tsvetanov
Telerik team
answered on 16 Aug 2016, 12:12 PM
Hello Jan,

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
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Jan
Top achievements
Rank 1
answered on 17 Aug 2016, 07:54 AM

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

0
Thomas
Top achievements
Rank 1
answered on 25 Nov 2016, 03:21 PM

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

0
Jan
Top achievements
Rank 1
answered on 28 Nov 2016, 07:31 AM

Hello Thomas,

I'm afraid I haven't. But let's share it here if any of us find a solution!

Thanks

Jan

0
Veselin Tsvetanov
Telerik team
answered on 30 Nov 2016, 09:21 AM
Hi Jan, hi Thomas,

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
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Tags
OrgChart
Asked by
Jan
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Jan
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Share this question
or