How to preview an Excel file instead of download( On Click )

I have a attachment in my case. So, when the user clicks on the attachment he should be able to preview the excel file. Instead, in my case the user is able to download the file once he clicks on the excel file.

I hope you’re referring the UI Kit application. Please check this post

Download a Section as PDF on click of a button

Natively, Pega doesn’t support direct inline rendering or previewing of Excel files (.xlsx / .xls) within the browser out-of-the-box; clicking them will default to a file download.

If a true Excel preview is a hard requirement, you generally have to look at custom implementation:

  • Third-Party Viewers: You can build a custom UI control using an iframe that embeds third-party cloud viewer APIs (like Microsoft 365 Web Viewer or Google Docs Viewer). However, these usually require the file to be hosted or accessible on a public/cloud storage endpoint rather than stored locally as a standard Pega case attachment. I have tried this approach couple of years back and this only worked for documents that are present in the respective cloud storage and our profile should have access to that document.

Implementing XLSX preview can be quite challenging task and you need 3rd party implementation for it. Please verify with business the exact intent before starting work on it.