Expand my Community achievements bar.

Excel sheet download on page

Avatar

Level 4

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.

1 Reply

Avatar

Community Advisor

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