export webpages to PDF and retreiving data from DataSource without keeping the old data

4 posts, 0 answers
  1. Jurgen
    Jurgen avatar
    9 posts
    Member since:
    Oct 2011

    Posted 25 Nov 2013 Link to this post

    During our development we are wondering how we best can export the webpages we created which contains Kendo elements to PDF format. We saw earlier on the forum that there was a post where was asked what the best way would be to export a grid to PDF, but we would like to do this with the entire page. these pages also contains CSS files which does not makes in any easier to export this to a file. 

    We also noticed that Telerik has some functions for this(exporting data to PDF or Excel). Is Kendo going to include these features also?

    One final thing currently we need to keep the DataSources in our memory after initializing it. is there a smarter solution for this or is there a smarter solution coming for this.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Nov 2013 Link to this post

    Hi Jurgen,

    Kendo UI doesn't include any features to export a whole web page to PDF format. You can try a third party web site such as http://pdfcrowd.com/ (you can test PDF generation by pasting some Kendo UI live demo URL).

    Adding export features to certain Kendo UI widgets (but not a whole page) is part of our long term plans. 

    I do not understand your final question. What do you mean by a smarter solution for storing data sources in memory?

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Jurgen
    Jurgen avatar
    9 posts
    Member since:
    Oct 2011

    Posted 25 Nov 2013 Link to this post

    Thank you for a fast answer.


    what we meant with “a smarter solution for storing data sources in memory” is that Currently we need to use the ToDataSourceResult extension method. But this method requires a collection of the original data through this we need to do again a service call throughout our system to access the data that could be available
    in the UI element.  This would make our system fairly slow. So we where wondering if there is a smarter way to get the data back. Else we would have to
    make a choice between storing the data temperately in our memory or recalling the data though our system. also note that most of the initialization of the
    Kendo elements is done with AJAX calls.
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 25 Nov 2013 Link to this post

    Hi Jurgen,

    You can either implement caching in your application level or disable the server-side operations (paging, sorting etc) of the grid's data source. Then the grid will make a single request for all data and keep it in memory at the client-side.
    .DataSource(dataSource => dataSource
                   .Ajax()
                   .Batch(true)
                   .PageSize(20)               
                   .ServerOperation(false)

    On the other hand the ToDataSourceResult method uses LINQ expression trees in order to minimize the amount of data retrieved from the data base. For example it only retrieves a single page of data (determined by the PageSize option). Of course you need to give an IQueryable instance returned from a LINQ-enabled provider (Entity Framework, Linq 2 SQL).

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top