PDF-Report with Chart

4 posts, 0 answers
  1. Jens
    Jens avatar
    2 posts
    Member since:
    Feb 2013

    Posted 26 Jun 2015 Link to this post

    Hi!

    We're currently evaluating KendoUI and trying to build a little example app which consists of a PDF-Report. Is it possible to extract a rendered chart and insert it into a multipage PDF-Report? My PDF renders fines but the chart is missing in the PDF-Output (see attached files)

    App structure (It's basically a print preview with PDF-Export):

    - One browser window with 1 Chart 

    - The User hits the report button (see report screenshot)

    - A -new- window is opened and the Chart from the first window is inserted (via JQuery) into the DOM of the 2. window (which holds the report).

    - A PDF is generated (see pdf screenshot).

     

    Thanks in advanced.

    Best regards,

    Jens

     

     

     

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2771 posts

    Posted 30 Jun 2015 Link to this post

    Hi,

    I assume that you're taking the SVG output from the chart and move it to the new window. As opposed to running an actual instance there.

    This is not a supported configuration, as the PDF export engine will not process inline SVG documents.
    Normally, the chart widget will cooperate with the export routine, returning a Drawing API "visual tree" to be processed.

    The solution is to host a normal chart instance in the output window.

    Does this make sense?

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Jens
    Jens avatar
    2 posts
    Member since:
    Feb 2013

    Posted 02 Jul 2015 in reply to T. Tsonev Link to this post

    Hm yeah thanks. 

    Is there a recommend way on how to draw the Chart into the report window? Is there a workaround (e.g. render to an image)?

     

    Thanks & best regards,

    Jens

  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2771 posts

    Posted 06 Jul 2015 Link to this post

    Hello,

    Rendering to an image should work, but will obviously produce a raster image.
    That might or might not be a problem depending on what you plan to do with the PDF. High-resolution prints will suffer for example.

    The exportImage method should get you a Base64-encoded image that can be set as a source on a plain img element.

    The only way to get the vector shapes in place is to have the live instance of the widget during export.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready