Starting with my existing, working page which has one DataSourceControl and one Gridview bound to the control.
1. Add a ReportViewer to the page.
2. Select "Design a new report" from the viewers smart-tag
3. Add a Table to the report
4. Add a DataSet to the project
5. Add a DataTable to the DataSet
6. Add 2 columns to the DataTable (assuming the case where my DataSourceControl will be returning 2 columns)
7. Now that I've added the DataSet and DataTable, it appears in the ReportViewer's "Website Data Sources" toolbox, so I drag "Column1" and Column2" out onto the table. This gives me 2 headers and the data cells look like "=Fields!Column1.Value" etc.
8. Only after I have added the columns can I go back to the ReportViewer's smart tag and select "Choose Data Sources". This brings up a dialog with a 2 column table with the headings "Report Data Source" and "Data Source Instance". The ReportDataSource is already set to "DataSet1_DataTable1" and the "DataSourceInstance is defaulted to "(None)" but has a drop-down with which I can either select the instance of my DataSourceControl which is on the page (DataSourceControl1) or else select "<New Data Source...> which brings up a Data Source Configuration Wizard. I choose to select my Data Source Control instance.
9. I select "Rebind Data Sources" on the Report Viewer's smart-tag. This adds a new "Object Data Source" to the page, but I don't see how this has any relation to my DataSourceControl. It's SelectMethod is set to "GetData" and its TypeName is set to "DataSet1TableAdapters." which doesn't make much sense to me.
What am I missing? Is there a simpler way to do this? Can I bind a ReportViewer to my DataSource control directly? or do I need to add methods to my DataSourceControl which return the tabular data as a DataTable inside of a DataSet?
Thanks for any help. This is way too confusing.no replys? is my question too complex? i would think this would not be too hard. any help would be greatly appreciated.
No comments:
Post a Comment