This is a migrated thread and some comments may be shown as answers.

Kendo Grid export to excel remove desired column and remove footer row

0 Answers 494 Views
Forum suggestions
This is a migrated thread and some comments may be shown as answers.
ASPN
Top achievements
Rank 1
ASPN asked on 26 Feb 2019, 11:44 AM

I am using UI for ASP.NET MVC Grid.

I need to export editable grid data into excel and then import on same grid for some data manipulation

But I have restriction not to export the footer row and having 15 visible column out of which 6 column need not to exported.

After doing a lot of research I found this way I can only export without footer  but could not able achieve removing  desired column in gird data export.

function ExportToExcel(e) {

         var rows = e.workbook.sheets[0].rows;
       
        var newRows = []
        for (var ri = 0; ri < rows.length; ri++) {
            var row = rows[ri];
                        
            //row.hideColumn.hideColumn("Col1");
            //row.hideColumn.hideColumn("Col2");
            //row.hideColumn.hideColumn("Col3");
            //row.hideColumn.hideColumn("Col4");
            //row.hideColumn.hideColumn("Col5");
            //row.hideColumn.hideColumn("Comments");
            if (row.type !== "group-footer" && row.type !== "footer") {
               
                newRows.push(row)
            }
        }
        e.workbook.sheets[0].rows = newRows
       
    }

Kindly post your solution with sample code  to remove desired columns from gird while export along with removing footer row.

Please let me know if any more detail needed. in the code above commented code is just example one of the example how many way I tried but not succeeded.

 

Thank you


No answers yet. Maybe you can help?

Tags
Forum suggestions
Asked by
ASPN
Top achievements
Rank 1
Share this question
or