Kendo Angular Grid --> How to Export the entire records to excel instead of page level

8 posts, 0 answers
  1. Sankar
    Sankar avatar
    20 posts
    Member since:
    Jan 2016

    Posted 17 Dec 2018 Link to this post

    Hi Team,

     

    Kendo Angular Grid --> How to Export the entire records to excel instead of page level

    I have Kendo Angular gird and Export to Excel option as well, while doing export to excel it is download only current page not entire records.

    Can you please guide me how to download export to excel with entire records?

     

    Note: if I select page size manually to 1000 (example) download all the records, here our requirement is while clicking on Export to excel itself download all records.

    Thanks,

    Sankar

     

  2. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    1290 posts

    Posted 17 Dec 2018 Link to this post

    Hi Sankar,

    To export a data set that is different than the one, currently displayed in the Grid (after paging, filtering, etc. are applied), you can utilize the fetchData callback as described in the following section of our documentation and the auxiliary runnable demos:

    https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#toc-exporting-specific-data

    I hope this helps.

    Regards,
    Dimiter Topalov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Dimitris
    Dimitris avatar
    22 posts
    Member since:
    Dec 2019

    Posted 20 Nov 2020 in reply to Dimiter Topalov Link to this post

    How can we select which columns / fields to export?
    I cannot find such an option on process.
  4. Martin
    Admin
    Martin avatar
    280 posts

    Posted 20 Nov 2020 Link to this post

    Hello Dmitris,

    To export only selected rows in excel, please take a look at this forum thread.

    https://www.telerik.com/forums/kendo-grid---export-into-excel-only-selected-rows

    Regards,
    Martin
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  5. Dimitris
    Dimitris avatar
    22 posts
    Member since:
    Dec 2019

    Posted 20 Nov 2020 in reply to Martin Link to this post

    Thanks Martin

    I've already did check that and implement it, but the problem with that is that you declare which columns you want to display on the exported file and not just those that are not hidden by the user.
    In my case I have an action column in the begining of the grid with EDIT, VIEW, DELETE icons and of course I don't want to show that one on the PDF and Excel exports.
    How can I only exclude this one but for all the others columns to follow what the user has selected as visible and hidden?
    I tried adding only my actions column with attribute hidden = true but like this it was exporting an empty PDF.

    And my other problem is that I am building the columns in the component because I followed another of your examples for persistent filters, sorting etc (which btw has a bug on column reordering when we have hidden columns), so I had to remove everything from the HTML to the component.

     

    Thanks

  6. Martin
    Admin
    Martin avatar
    280 posts

    Posted 23 Nov 2020 Link to this post

    Hello Dimitris,

    By default, the grid exports its current columns. In order to include or exclude columns in the exported excel file, the developer can customize the exported columns by defining them between the  <kendo-grid-excel> tags e.g.:

     <kendo-grid-excel fileName="Products.xlsx">
                    <kendo-excelexport-column field="ProductName" title="Product Name">
                    </kendo-excelexport-column>
                    <kendo-excelexport-column field="Category.CategoryName" title="Category">
                    </kendo-excelexport-column>
    </kendo-grid-excel>

    https://www.telerik.com/kendo-angular-ui/components/grid/export/excel-export/#customizing-exported-columns

    I hope this helps.

    Regards,


    Martin
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  7. Dimitris
    Dimitris avatar
    22 posts
    Member since:
    Dec 2019

    Posted 24 Nov 2020 in reply to Martin Link to this post

    Thanks Martin,

    but when you define them like this, it ignores which columns are hidden and which are visible by the user.
    What I need is what it does by default excluding the ACTIONS column with the add, edit, view etc buttons.
    All the rest columns should be whaterver the user selected.

  8. Martin
    Admin
    Martin avatar
    280 posts

    Posted 26 Nov 2020 Link to this post

    Hi Dimitris,

    The developer can iterate a column configuration object in  <kendo-excelexport-column> component directly e.g.:

          <kendo-grid-excel fileName="Products.xlsx">
            <kendo-excelexport-column
              *ngFor="let column of columnsConfig"
              [field]="column.field"
              [title]="column.title"
              [hidden]="column.hidden"
            >
            </kendo-excelexport-column>

    When columns are hidden dynamically, in columnVisibilityChange handler, the respective hidden property from the column config array can be updated.

    Regards,
    Martin
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top