- Home
- Forum
- ASP.NET Core - EJ 2
- Send Excel File on mail from ejsgrid
Send Excel File on mail from ejsgrid
how to send ejs grid data in excel format as mail attachment where i have multiple grid on the page with different id's
SIGN IN To post a reply.
5 Replies
BS
Balaji Sekar
Syncfusion Team
September 23, 2020 02:52 PM UTC
Hi Nitin,
Based on your query we suspect that you need to export multiple Grids on a single excel file. So, please refer the below code example and sample for more information.
|
[index.cshtml]
<ejs-grid id="Grid1" dataSource="ViewBag.DataSource" allowPaging="true" allowExcelExport="true" toolbar="@(new List<string>() {"ExcelExport"})" toolbarClick="toolbarClick">
<e-grid-columns>
. . . .
</e-grid-columns>
</ejs-grid>
<ejs-grid id="Grid2" dataSource="ViewBag.DataSource" allowExcelExport="true" allowPaging="true">
<e-grid-columns>
. . . .
</e-grid-columns>
</ejs-grid>
<ejs-grid id="Grid3" dataSource="ViewBag.DataSource" allowExcelExport="true" allowPaging="true">
<e-grid-columns>
. . . .
</e-grid-columns>
</ejs-grid>
<ejs-grid id="Grid4" dataSource="ViewBag.DataSource" allowExcelExport="true" allowPaging="true">
<e-grid-columns>
. . . .
</e-grid-columns>
</ejs-grid>
function toolbarClick(args) {
if (args.item.text == "Excel Export") {
var appendExcelExportProperties = {
multipleExport: { type: 'NewSheet' }
};
var grid1 = document.getElementById("Grid1").ej2_instances[0];
var grid2 = document.getElementById("Grid2").ej2_instances[0];
var grid3 = document.getElementById("Grid3").ej2_instances[0];
var grid4 = document.getElementById("Grid4").ej2_instances[0];
grid1.excelExport(appendExcelExportProperties, true).then(function (props) {
grid2.excelExport(appendExcelExportProperties, true, props).then(function (fdata) {
grid3.excelExport(appendExcelExportProperties, true, fdata).then(function (data) {
grid4.excelExport(appendExcelExportProperties, false, data);
})
})
})
}
} |
Sample link: https://www.syncfusion.com/downloads/support/forum/158051/ze/MultipleGridsExportInSingleExcelFile-187601342.zip
If we misunderstood your query, please provide the video demonstration of your requirement it will help us to provide the proper solution.
Regards,
Balaji Sekar
NP
Nitin Pawar
September 23, 2020 03:06 PM UTC
Thanks for your support.
But i don't want to download the excel but i want to attached excel file with multiple grid data dynamically on mail without downloading
BS
Balaji Sekar
Syncfusion Team
September 30, 2020 04:18 AM UTC
Hi Nitin,
We could not understand your requirement with the provided information. Please share more details regarding your query and we would like to know the following details to validate further on reported your requirement.
1. Share the complete grid code example.
2. Explain your exact requirement briefly.
3. If you possible to share the host sample link or local sample.
Regards,
Balaji Sekar
NP
Nitin Pawar
October 1, 2020 12:53 PM UTC
As per the example you show below for export to excel with multiple grid is ok.But my requirement is that i don't wont to export data but i want to send the data in excel file on email from grid without export.
BS
Balaji Sekar
Syncfusion Team
October 7, 2020 04:14 PM UTC
Hi Nitin,
Thanks for your valuable patience.
Currently we do not have support for sending Excel file in email attachment.
Regards,
Balaji Sekar
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
NP Nitin Pawar
- Sep 22, 2020 09:41 AM UTC
- Oct 7, 2020 04:14 PM UTC