In the first column I get some color names (White, Navy, Red, Olive, Yellow, ...) - DATA IS NOT IN DATASETIn the second column I get some weird dates - DATA IS NOT IN DATASETIn the third column I get day names (Friday, Saturday, ...) - DATA IS NOT IN DATASETIn the fourth column I get some strings ("Document Import Tool", "Form", "OLAP", ...) - DATA IS NOT IN DATASET
Where is the report getting data from?!I think I found something, when I create dataset and all other stuff (Fill method), the table gets filled, but after that the following code gets executed: private void SetupReport() { this.m_crFilteredMetersDocument = new ReportDocument(); // creates new report document string reportPath = "C:\\Documents and Settings\\markofr\\Desktop\\CatsPlusPlus\\Reporter\\FilteredMeters.rpt"; this.m_crFilteredMetersDocument.Load(reportPath); this.m_crFilteredMetersDocument.SetDataSource(this.m_DataSetFilteredMeters); this.m_crViewerFilteredMeters.ReportSource=m_crFilteredMetersDocument; this.m_crFilteredMetersDocument.Refresh(); }and in this.crFilteredMetersDocument the table is empty (zero size). Can someone tell me why??I have rewritten the code in a fashion: private void SetupReport() { this.m_crFilteredMetersDocument = new ReportDocument(); // creates new report document string reportPath = "FilteredMeters.rpt"; this.m_crFilteredMetersDocument.Load(reportPath); this.m_crFilteredMetersDocument.SetDataSource(this.m_DataSetFilteredMetersDataTable as DataTable); this.m_crViewerFilteredMeters.ReportSource=m_crFilteredMetersDocument; this.m_crFilteredMetersDocument.Refresh(); }And now it works, but can someone tell me why? I need background ...
private void SetupReport() { this.m_crFilteredMetersDocument = new ReportDocument(); // creates new report document string reportPath = "C:\\Documents and Settings\\markofr\\Desktop\\CatsPlusPlus\\Reporter\\FilteredMeters.rpt"; this.m_crFilteredMetersDocument.Load(reportPath); this.m_crFilteredMetersDocument.SetDataSource(this.m_DataSetFilteredMeters); this.m_crViewerFilteredMeters.ReportSource=m_crFilteredMetersDocument; this.m_crFilteredMetersDocument.Refresh(); }
private void SetupReport() { this.m_crFilteredMetersDocument = new ReportDocument(); // creates new report document string reportPath = "FilteredMeters.rpt"; this.m_crFilteredMetersDocument.Load(reportPath); this.m_crFilteredMetersDocument.SetDataSource(this.m_DataSetFilteredMetersDataTable as DataTable); this.m_crViewerFilteredMeters.ReportSource=m_crFilteredMetersDocument; this.m_crFilteredMetersDocument.Refresh(); }