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

Page number in Excel

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 29 May 2018, 07:43 AM

Hello.

I am using Export to Excel functionality.

Is there a way of adding page numbers to the excel generated from the grid?

I have tried the following but it does not work.

function excelExport(e) {
        var sheet = e.workbook.sheets[0];

        sheet.pageNumber = true;

}

Or is there any property which can be set when defining the Excel?

       .Excel(excel => excel
        .FileName("Users.xlsx")
        .Filterable(true)
        .ProxyURL(Url.Action("Excel_Export_Save", "UserAndGroup"))
       )

 

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 30 May 2018, 02:37 PM
Hello,

In general the excel export exports the data to a single sheet so in theory there are no really pages compared to the PDF export. 

Just in case if you need to add a separate row to the excel export document indicating the end of each page (from the datasource perspective) you can use the approach demonstrated in the Export the Entire Grid Data to Excel KB article. While iterating the entire data you can add a separate row when the current page ends (for example on 20th, 40th, 60th item and so on) containing some text indicating the end of the current page. 
 

Regards,
Boyan Dimitrov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or