3

I am using ASP.NET MVC with Kendo UI. I want to export grid to an HTML page and print it. Online help is not available. What have your done previously. Thanks in advance.

d219
  • 2,707
  • 5
  • 31
  • 36
Badar Ali
  • 77
  • 11

1 Answers1

0

Did you find a solution to this? I'm looking at the same thing currently and have found a couple of options:

Firstly Telerik have a Javascript example which renders your grid to a new print window, see https://docs.telerik.com/kendo-ui/controls/data-management/grid/print-export

Just alter the name of

var gridElement = $('#grid'), 

to your own existing grid name and omit the function:

$(function () {
    var grid = $('#grid').kendoGrid({
    ...
    };
};

However, this only renders what is currently displayed on screen (so if your grid has multi pages it may not be suitable).

The second option that I'm exploring is exporting to pdf (and then user can then print that if they wish). There are example of this at https://demos.telerik.com/aspnet-mvc/grid/pdf-export and https://docs.telerik.com/kendo-ui/controls/data-management/grid/pdf-export

This does have multi-page printing support (although I haven't got it to work just yet, they have examples which show it working). They do mention potential problems if you have a lot of data as it needs to load all the data on the client side (even if you have paging). There are some example projects to work on data server side in the above links.

In the end our requirements didn't need the paging but I've gone with the pdf option as that delivers quite a nice layout that you can template further.

d219
  • 2,707
  • 5
  • 31
  • 36