Hi Ishan Shah
Thank you for contacting Syncfusion support.
We have checked your reported requirement and we would inform you that we have created the sample for your scenario. In that, we have saved the Csv file with a specified file name while clicking the Downloadcsv button. Please refer the below code snippet and sample link.
Index.cshtml
|
@Html.EJS().Spreadsheet("spreadsheet").OpenUrl("Open").SaveUrl("Save").Sheets(sheet =>
{
sheet.Name("Product").Ranges(ranges =>
{
ranges.DataSource((IEnumerable<object>)ViewBag.DefaultData).Add();
}).Add();
}).Render()
<button class="e-btn" id="saveButton">DownloadCSV</button>
<script>
document.getElementById('saveButton').addEventListener('click', function () {
var ssObj = ej.base.getComponent(document.getElementById('spreadsheet'), 'spreadsheet');
ssObj.save({ saveType: "Csv", fileName:"product" });
});
</script>
|
Sample link:
Could you please check the above sample and let us know whether this is fulfilling your requirement or get back to us if you need further assistance.
Regards,
Aunkumar D