Resolving "The Data Input Collection is Null or Empty" Error in Report Processing
Encountering the error message “The data input collection is null or empty for the dataset used in the report” is a common issue, particularly when utilizing the local processing mode in your application. Below, scenarios where this error may occur are outlined along with steps to resolve it.
Case 1: Data Source Not Added in the Application
If the value for the data source is not added in the application while rendering an RDLC report, the error will occur. To fix this, include the following line in your application:
reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource { Name = "list", Value = ProductList.GetData() });
Ensure to replace “list” with the correct data source name specified in your report’s “Name” attribute. Also, replace “ProductList.GetData()” with the relevant data class method used in your application.
If multiple datasets are used, ensure to add all dataset names. Please refer to the example below:
reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource { Name = "Product", Value = ProductList.GetData() });
reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource { Name = "Company", Value = CompanyList.GetData() });
Case 2: RDL File Usage
When working with an RDL file, if the processing mode is set to Local, the error may occur. To resolve this, either remove the processing mode property entirely or switch it to Remote.
RDL report:
processingMode: ej.ReportViewer.ProcessingMode.Remote,
RDLC report:
processingMode: ej.ReportViewer.ProcessingMode.Local,
By addressing these cases, you can effectively resolve the “The Data Input Collection is Null or Empty” error in your report processing.