Here is a line by line explanation of the complete code for exporting the data grid to an excel sheet.
Here we'll not consider the pagination and will export th entire grid data. The point pagination is not considered is because in most of the cases while exporting to excel it is needed to display the entire data rather a paricular portion of it(which of course makes no sense).
For this shake we'll not depend on the grid that is currently in view in the page(if at all it is,here i am asuming that there is a grid in your ui and you want to export it to an excel).
Hence we'll create a grid on the fly provide it with the style that we wanted to be displayed in the excel and bind it with the complete data-source.
Here we'll not consider the pagination and will export th entire grid data. The point pagination is not considered is because in most of the cases while exporting to excel it is needed to display the entire data rather a paricular portion of it(which of course makes no sense).
For this shake we'll not depend on the grid that is currently in view in the page(if at all it is,here i am asuming that there is a grid in your ui and you want to export it to an excel).
Hence we'll create a grid on the fly provide it with the style that we wanted to be displayed in the excel and bind it with the complete data-source.
No comments:
Post a Comment