How to add multiple tables in same Excel Sheet ?????

2 posts, 0 answers
  1. Rohan
    Rohan avatar
    1 posts
    Member since:
    Jun 2020

    Posted 15 Jun Link to this post

    Very Urgent!!!!Pls help
  2. Svetlin
    Admin
    Svetlin avatar
    382 posts

    Posted 17 Jun Link to this post

    Hi Rohan,

    Let me begin with providing some general information on the Excel Export functionality and then I will provide specific examples of how the requirements can be achieved.

    Basically whenever the default Grid Excel Export functionality is used the Grid data is automatically converted to an object of type Workbook. That is the default type of object when creating Excel files manually provided by Microsoft:

    https://docs.microsoft.com/en-us/office/vba/api/excel.workbook

    One option in order to export two Grids in the same sheet is to construct the desired Workbook manually. Please check the following article from our documentation demonstrating how to create new Workbooks manually:

    https://www.telerik.com/kendo-angular-ui/components/excelexport/workbook/new-custom/

    Here is an example demonstrating how to export a custom Workbook so that it represents two Grid data sets separated with an empty row:

    https://stackblitz.com/edit/angular-l6jymc-ahvbyd?file=app/app.component.ts

    Another option would be to use the Grid built-in feature to construct the two separate Workbooks for the two Grids and then combine them. Please check the following example demonstrating such approach:

    https://stackblitz.com/edit/angular-equv6d-ffwrhx?file=app/app.component.ts

    The essential parts in this example are that the (excelExport) event of the first Grid is prevented. Then the generated Workbook data is saved and then (excelExport) event of the second Grid is fired by calling the second Grid saveAsExcel() method. Finally in the (excelExport) event handler function of the second Grid the automatically generated Workbooks for both Grids are combined.

    I hope the provided information helps you to move forward with this case.

    Regards,
    Svetlin
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top