We can export a grid in angular JS using “WebApiAdaptor” in DataManager to retrieve data from WebApi Service as follows.
Grid Rendering Code:
Here the toolbar contains ExcelExport, WordExport, PdfExport icons that are used to perform exporting. When we click the toolbar exporting icon, it internally invokes the export() public method of Grid object to make export.
Exporting is achieved by using ExcelExport action controller method. While using WebApi Service we need to return the data as PageResult as we need both data and its count for paging operation.
In controller method (ConvertGridObject), Grid property is passed as string parameter. We need to serialize it into Grid Property. Using Export() server method we can export the Grid into excel, pdf and word documents.
Figure: Exporting using Angular JS
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|