When I pass the dataset as an explicit interface, instead of implicit, the fields are blank. I can't figure out why the explicit interface calls don't work, while the implicit does. I am able to see all the fields in the report viewer wizard to drag the 'fields' to the display as placeholders. But they are displayed as blank when the program runs.
Classes:
public class MyReportData : IMyReportData
{
string IMyReportData.Field1 { get; set; }
string IMyReportData.Field2 { get; set; }
}
public class TestData : ITestData
{
public string MyTest { get; set; }
public string MyTest2 { get; set; }
}
When passed to the report viewer:
IMyReportData data = new MyReportData();
data.Field1 = "Field 1";
data.Field2 = "Field 2";
reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", new List<IMyReportData>() { data }));
ITestData test = new TestData;
test.MyTest = "Test 1";
test.MyTest2 = "Test 2";
reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", new List<ITestData >() { test}));
The data in 'test' displays. But the data in 'data' is empty in the report.