How to print RadHtmlChart

4 posts, 0 answers
  1. Bethany
    Bethany avatar
    9 posts
    Member since:
    Mar 2015

    Posted 15 May 2015 Link to this post

    Hello,

    I am trying to print just my RadHtmlChart using JavaScript but when I press the event button to activate the script the chart disappears, the components I want to hide successfully hide. I specifically state in my JavaScript code to only hide 2 other components but keep the chart. Also, when I cancel the prompt to print all of the components stay hidden, instead of being shown. Here is my code:

     

    01.<script type="text/javascript">
    02.     function printChart() {
    03.          //Hide components but show chart
    04.          document.getElementById("divGrid").style.display = 'none';
    05.          document.getElementById("divOptions").style.display = 'none';
    06.          document.getElementById("divChart").style.display = 'block';
    07. 
    08.          //Call the browser print method
    09.          window.print();
    10. 
    11.          //Show components
    12.          document.getElementById("divGrid").style.display = 'block';
    13.          document.getElementById("divOptions").style.display = 'block';
    14.          document.getElementById("divChart").style.display = 'block';
    15.</script>

     

    Thank you in advance!

  2. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 18 May 2015 Link to this post

    Hi Bethany,

    I tested the provided function but the chart and all other elements on the page get hidden/shown properly when printing - video. Can you verify that there are not any JavaScript errors on the page when the button is print button is clicked at your end?

    For convenience I am attaching my test page to this reply - are you reproducing the same issue with it? If no, can you modify it up to a point where the issue occur and send it back for a further investigation?

    Regards,
    Vessy
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bethany
    Bethany avatar
    9 posts
    Member since:
    Mar 2015

    Posted 19 May 2015 in reply to Vessy Link to this post

    Hello,

     I was able to recreate the problem and fixed it to print just the chart. However, project specifications have changed and I am supposed to export to PDF for printing but I am running into some problems with that as well. Can you help me on this post or should I create a new one?

  5. Vessy
    Admin
    Vessy avatar
    1389 posts

    Posted 22 May 2015 Link to this post

    Hi Bethany,

    You can use the RadClientExportManager  in order to export the HtmlChart to PDF. You can find a live implementation of this approach here: HtmlChart - Export to PDF

    On a side note, yes, it would be better if you open separate tickets/forums for each issue you are facing so we can keep the consistency of each thread. Thank you for the understanding.

    Regards,
    Vessy
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top