Last post Oct 17, 2011 05:03 AM by george_d37
Oct 15, 2011 04:03 AM|george_d37|LINK
I have a website with a report viewer. I need to set the report of this report viewer to an rdlc report. I have also created a dataset to generate the report from. My problem is that the data I need to use to generate the report from is data from a dataset
and NOT data from an sql database. How can I do this? When I set the report to the report viewer using the smart tags, I get an ObjectDataSource. Now, when I open the report viewer smart tag and select choose datasource, in the datasource options, I only get
ObjectDataSource but I do not get the dataset I want! When I open the smart tag of the ObjectDataSource, a wizard opens in which I need to enter a connection string (I can not use connection strings because i need the data from a dataset not a database). My
dataset is populated by code and not through the datatableadapter which I believe is the cause of the problem since I can only bind the ObjectDataSource to datatableadapters which don't exist in my case. What can I do in this case? Can't you generate a report
from data within the project? Should the data be from an external database? I don't understand the ObjectDataSource and how can I link it to a dataset in the project! Sorry for some questions if they are simple but this is the first time I use reportviewer
in a website. Any help much appreciated.
Oct 16, 2011 09:31 PM|TimoYang|LINK
You should try to create a class with a select method, and then drag and drop an ObjectDataSource to bind to this select method. And then Bind the ObjectDataSource to the ReportViewer.
PS: Part of this problem may be related to ReportViewer, you can refer to
Oct 17, 2011 01:25 AM|george_d37|LINK
Thanks for the help. Much appreciated! Can you please give me some more details about how to create the class? What structure should the class have? How can the ObjectDataSource identify the select method? Should the select method have a specific name to
be identified? What should the return type of the select method be? I would appreciate it if you guide me through these questions or provide a link that answers them as I wasn't able to find one!
Oct 17, 2011 05:03 AM|george_d37|LINK
I think what you mean is listed here
I followed the tutorial in this link and everything works fine but when the report opens, it is empty! No data appears in the columns. What is wrong? Any help much appreciated. Thanks