Excel sheet download on page | Community
Skip to main content
Prashardan
Level 4
December 23, 2024
Solved

Excel sheet download on page

  • December 23, 2024
  • 1 reply
  • 505 views

Hi Team

 

I have a requirement where I would like to download the data into excel sheet. First I will get the data from API and this data I will filter based on parameters/filters. I want to have an option to download the data on click of download excel button.

 

Kindly advise on this.

 

Thanks in advance.

Best answer by arunpatidar

Hi @prashardan 

For a client-side solution, you can use a JavaScript library to generate Excel files directly in the browser


Implementation Steps

  1. Fetch Data from API or AEM Servlet
    Retrieve data using an API call or by integrating with an AEM Servlet.

  2. Create Filtering Logic in JavaScript
    Process the fetched data based on the filters provided by the user to ensure only relevant information is exported.

  3. Generate Excel File on the Client Side
    Use a library like SheetJS to convert the filtered data into an Excel file.

  4. Add a Download Button
    Include a download button in your AEM component dialog. Configure it to trigger the download function to save the Excel file locally.

 

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
December 23, 2024

Hi @prashardan 

For a client-side solution, you can use a JavaScript library to generate Excel files directly in the browser


Implementation Steps

  1. Fetch Data from API or AEM Servlet
    Retrieve data using an API call or by integrating with an AEM Servlet.

  2. Create Filtering Logic in JavaScript
    Process the fetched data based on the filters provided by the user to ensure only relevant information is exported.

  3. Generate Excel File on the Client Side
    Use a library like SheetJS to convert the filtered data into an Excel file.

  4. Add a Download Button
    Include a download button in your AEM component dialog. Configure it to trigger the download function to save the Excel file locally.

 
Arun Patidar