Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
160
Reports and Charts export to PDF and other formats
posted

Hi,

I recently completed the evaluation of Infragistics controls for Jquery and MVC, and I found them highly satisfying. I had a couple of questions though.

 

Q1 :  Can we export the charts and reports to pdf, excel and other formats?

 

Q2: How is the localization handled in grids and charts? Apart from Date picker controls, which other controls from infragistics jquery, offer the localization feature?

 

Regards,

Shahan

Parents
No Data
Reply
  • 24671
    Suggested Answer
    posted

    Hi Shahan,

    Glad to hear that ! 

    Q1: Yes, the charts content can be exported as images. It cannot be directly exported as PDF/Excel, but you can use our server-side libraries in order to embed the exported image into the document. The jQuery Chart is basically rendered on a HTML5 Canvas. You use something like this to export the canvas data to an image, send its data to the server using a POST request, then on the server, you can use our APIs in order to generate a PDF or an Excel report:

    Where "canvas" is your canvas element for the chart. 

     

    $.post('/upload',
           
    {
                someImgID
    : <id>,
                img
    : canvas.toDataURL('image/jpeg'),
                <extra params>
           
    },
           
    function(data) {});

    Where "canvas" is your canvas element for the chart. 


    Q2: Localization for grids / charts is handled in localization files which contain key/value pairs. Basically all strings are exposed in those files instead of hardcoding them in the code. So for example, if you'd like to localize the paging feature in a different language, you can have a look at the following folder:

    js\i18n\igGrid\ig.ui.grid.paging-<your language>.js

    and add this new file and change the values of the keys.

    Then in your page, you need to reference:
    <script type="text/javascript" src="./js/ig.ui.grid.paging.js"></script>
    <script type="text/javascript" src="./js/i18n/igGrid/ig.ui.grid.paging-en.js"></script>

    Something like this, but basically that's the idea.

    Hope it helps. Please let me know if you have any other questions.

    Thank you,

    Angel 

     

Children