C# ReportViewer and data from several databases
I'm trying to make a report which will be able to receive data from a DB I'm current开发者_如何学Pythonly connected to.
The problem is that when I'm creating the report using the wizard or just putting in it a table, it requires a dataset and then I have to choose a specific DB, therefore it will not be able to get data from another database.
I also noticed that I can give it a ReportDataSource which gets a dataTable, but I don't understand how it would put in the data (to which textboxes?) or how I tell it how to do it. Anyway, even so I get an error that tells me that the report doesn't have a dataset and again pops the first problem.
Does anybody know how I can do this or have a link? examples? anything???
thanks :)The report designer and report wizard in VS are trying to be a little too smart for you. There is a simple workaround involving a dummy dataset. It lets you take full advantage of the report designer and still hook up to a different DB at runtime. It's not ideal, but it does work. I've outlined that approach here.
精彩评论