Microsoft Reporting Services and C#
-
Hi All, I'm trying to build some reporting into an app that I've been working on for a while. The app has a range of class objects in memory, which I want to use to populate the report. In short, I want to push the data to the report at runtime. I have designed the report structure (and created the .rdlc file), added a report viewer and bound the viewer to the report. However, I cannot seem to access the objects in the report for assignment. All net searches return info on binding to database tables, but I've found nothing on binding to class objects. Any ideas / pointers? Thanks in advance, John.
-
Hi All, I'm trying to build some reporting into an app that I've been working on for a while. The app has a range of class objects in memory, which I want to use to populate the report. In short, I want to push the data to the report at runtime. I have designed the report structure (and created the .rdlc file), added a report viewer and bound the viewer to the report. However, I cannot seem to access the objects in the report for assignment. All net searches return info on binding to database tables, but I've found nothing on binding to class objects. Any ideas / pointers? Thanks in advance, John.
Open the .rdlc file and you should now have a Data menu item in the VS menu. Click Add New Data Source, select Object and go through the wizard. Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.” -Edsger Dijkstra
-
Open the .rdlc file and you should now have a Data menu item in the VS menu. Click Add New Data Source, select Object and go through the wizard. Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.” -Edsger Dijkstra
Hi Scott, I can do that, but once a class is in my data sources tab, I can't look at the componants and can't attach them to a part of my report. In addition, a lot of the data items I have are time-series items. I will want to set a date for the report and include only data items up to that date. Is there a way to create a dataset in code and dynamically attach it to the report? Thanks, John.
-
Hi Scott, I can do that, but once a class is in my data sources tab, I can't look at the componants and can't attach them to a part of my report. In addition, a lot of the data items I have are time-series items. I will want to set a date for the report and include only data items up to that date. Is there a way to create a dataset in code and dynamically attach it to the report? Thanks, John.
If you have your report active in a tab, you should have a Report menu item. You have to use that to add sources to the particular report. Then you should have them as choices when you put components down on the report. If you didn't know already, you have to pass data in as a generic list even if there's only one object that you're working with. And be warned that the editor is NOT NICE when it comes to revising the report, I can't tell you how many times I've had to manually edit the rdlc file to fix something that the automation broke. Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.” -Edsger Dijkstra