Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Download Table view Data Using Button

Hi,

I have a requirement to disable the export data option on live reports and provide a button that will do the same. The report table data should download when this button is clicked.

any suggestions? It's pretty urgent

Thank you

2 REPLIES 2
Krina234pestro
New Member

Hello,

 

To achieve this, you can follow these steps:

Disable the Export Data Option:
If you’re using Power BI, you can disable the export data option for specific reports by going to the report settings and setting the “Export Data” option to "None".
For ASP.NET Core Report Viewer, you can hide the export options using the exportOptions property.
Create a Custom Download Button:
You can add a custom button to your report or web page that triggers the download of the table data. Here’s a basic example using Javascript: 

<button id="downloadButton">Download Data</button>
<table id="dataTable">
<!-- Your table data here -->
</table>

<script>
document.getElementById('downloadButton').addEventListener('click', function() {
var table = document.getElementById('dataTable');
var rows = table.rows;
var csvContent = '';

for (var i = 0; i < rows.length; i++) {
var cells = rows[i].cells;
var rowContent = [];
for (var j = 0; j < cells.length; j++) {
rowContent.push(cells[j].innerText);
}
csvContent += rowContent.join(',') + '\n';
}

var blob = new Blob([csvContent], { type: 'text/csv' });
var url = window.URL.createObjectURL(blob);
var a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('download', 'table_data.csv');
a.click();
});
</script>

This script will create a CSV file from the table data and download it when the button costcoess is clicked.

monica345
New Member

Hello,

Remove Export to Excel/CSV: In the Power BI Desktop, go to View -> Data View, and right-click on the table you want to disable exports for. Uncheck Export Data: In the Properties pane, uncheck the Export Data option. Create a Custom Action: In the Power BI Desktop, go to View -> Data View, right-click on the table, and select New Custom Action. Define Action: In the New Custom Action dialog, give the action a Patient Gateway name and define the logic to download the data (e.g., using a REST API call or DAX query). Add Button: Add a button to your report and assign the custom action to it. Develop a Custom Visual: Create a custom visual that replaces the default table visual and disables the built-in export functionality. Implement Download Button: Add a button to the custom visual that triggers the download functionality when clicked.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.