The requested page is not available for the requested platform. You are viewing the content for Default platform.

DashboardExcelDataSource Class

A data source used to extract data from Microsoft Excel workbooks or CSV files.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v19.1.Core.dll

Declaration

public class DashboardExcelDataSource :
    ExcelDataSource,
    IDashboardDataSource,
    IDashboardComponent,
    IComponent,
    IDisposable,
    ISupportInitialize,
    ISupportPrefix,
    IDashboardDataSourceInternal,
    IFederationDataProvider
Public Class DashboardExcelDataSource
    Inherits ExcelDataSource
    Implements IDashboardDataSource,
               IDashboardComponent,
               IComponent,
               IDisposable,
               ISupportInitialize,
               ISupportPrefix,
               IDashboardDataSourceInternal,
               IFederationDataProvider

Remarks

The DashboardExcelDataSource class allows you to extract data from Microsoft Excel workbooks (XLS, XLSX or XLSM files) or CSV files stored on the disk or stream.

To extract data from the specified workbook or CSV file, do the following.

Finally, add the created DashboardExcelDataSource object to the Dashboard.DataSources collection.

The following code snippet shows how to create an Excel data source and select the A1:L100 range of cells located on the SalesPerson worksheet.

using DevExpress.DashboardCommon;
using DevExpress.DataAccess.Excel;
// ... 
            Dashboard dashboard = new Dashboard();
            DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource();
            excelDataSource.FileName = @"c:\temp\Book1.xlsx";
            ExcelWorksheetSettings worksheetSettings = new ExcelWorksheetSettings("SalesPerson", "A1:L100");
            excelDataSource.SourceOptions = new ExcelSourceOptions(worksheetSettings);
            excelDataSource.Fill();
            dashboard.DataSources.Add(excelDataSource);

The following code snippet shows how to create an Excel data source and select the A1:L100 range of cells from the specified CSV file.

using DevExpress.DashboardCommon;
using DevExpress.DataAccess.Excel;
// ...
            Dashboard dashboard = new Dashboard();
            DashboardExcelDataSource csvDataSource = new DashboardExcelDataSource();
            csvDataSource.FileName = @"c:\temp\SalesPerson.csv";
            csvDataSource.SourceOptions = new CsvSourceOptions() { CellRange = "A1:L100" };
            csvDataSource.Fill();
            dashboard.DataSources.Add(csvDataSource);

Inheritance

Object
MarshalByRefObject
Component
DevExpress.DataAccess.DataComponentBase
ExcelDataSource
DashboardExcelDataSource
See Also