We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Any Sample for ASP.NET Web API Server Side Grid Export?

https://ej2.syncfusion.com/angular/documentation/grid/excel-export/exporting-grid-in-server/?_gl=1*1tri1i6*_ga*MTIzNjM3MDE0My4xNjY1MzcwNzQz*_ga_WC4JKKPHH0*MTY2Nzk2MTE4NS4xLjAuMTY2Nzk2MTIzMy4wLjAuMA..


Hi Team,

Very happy to find the MVC Sample for above link.

But I am wondering how can I interact with the Angular frontend when I am using a Web API Controller instead of an MVC Controller?

Thanks,

Wilber


2 Replies

WL wilber lin November 14, 2022 02:15 AM UTC

Angular code like this:

case "table":
                const table = find(
                    (this.table as any)._results,
                    (el) => el.portlet.newId === item.newId
                );
                const excelExportProperties: ExcelExportProperties = {
                    fileName: title
                        ? title + ".xlsx"
                        : "Table-" + new Date().toISOString() + ".xlsx",
                };
                table.grid.serverExcelExport('/api/xxxx');
                break;


PS Pavithra Subramaniyam Syncfusion Team November 14, 2022 01:27 PM UTC

Hi wilber lin,


Thanks for contacting Syncfusion support.


Since our EJ2 server-side exporting is implemented with the partial form submitting with a POST request based on the UrlAdaptor, we could not perform the server exporting with the API endpoint. Please get back to us if you need further assistance on this.


Regards,

Pavithra S


Loader.
Live Chat Icon For mobile
Up arrow icon