ExcelDataSource.FillAsync() Method
Populates the ExcelDataSource in an asynchronous manner.
Namespace: DevExpress.DataAccess.Excel
Assembly: DevExpress.DataAccess.v24.2.dll
Declaration
Returns
Type | Description |
---|---|
Task | A task that populates the data source. |
Remarks
Use this method to populate an Excel data source in an individual task asynchronously. Unlike the Fill() method call, FillAsync does not lock other actions performed concurrently. For instance, the user interface remains operational while the data source is populated.
Call the FillAsync method with the await operator.
Example
The code sample below creates an ExcelDataSource and populates it in an asynchronous manner.
using DevExpress.DataAccess.Excel;
using DevExpress.XtraReports.UI;
using System.Threading;
XtraReport report = new XtraReport();
// Creates and configures the Excel data source.
ExcelDataSource excelDataSource = new ExcelDataSource();
excelDataSource.Name = "Excel Data Source";
excelDataSource.FileName = "Sales.xlsx";
ExcelWorksheetSettings worksheetSettings = new ExcelWorksheetSettings("SalesPerson", "A1:L2000");
excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);
// Populates the data source.
await excelDataSource.FillAsync();
report.DataSource = excelDataSource;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the FillAsync() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.