Last post Dec 20, 2011 04:03 AM by abhishek dutta
Dec 18, 2011 09:24 PM|user-hostile|LINK
This question applies to any ASP.NET reporting tool: CrystalReports, ActiveReports, Microsoft's RDLC reports, etc. Which is the best datasource to bind a report to? Directly to a Dataset, or to a custom object? I'm using ActiveReports right now, and I've
coded the report(s) to bind to a System.Data.DataSet. I'm wondering if there are advantages to instead bind to a business object (class). It seems to me binding to a custom object is an extra layer of work for the runtime to do; whereas binding directly to
a DataSet simply returns data directly to the report.
I hope this question is clear. Thanks in advance.
Dec 19, 2011 05:17 AM|abrly|LINK
design " typed dataset " and let your DAL fill it and let your reporting tool utilise that typed dataset.
by typed dataset you will have data as well as schema
Dec 20, 2011 04:03 AM|abhishek dutta|LINK
If you are binding your reports to SQL Server,Acces,Oracle then using a data reader is more preferable as it would give you a better performance ,I say this because after you have bound the dataset to your report, making modifications to your datasource
would seem redundant as it would not be reflected in the report . You will have to run the report again with the modified dataset to show the changes. but If would are working win the connection less mode then using a dataset is also someting that would work
well with ActiveReports.
This being said ,using a custom object is what most developers would prefer as it would give them the flexibility they need to work the datasource ,but there would be no point in adding an extra layer for something which is not required for you to do in
Using a typed dataset is a good approach when you want to populate your report explorer at design time ,other than that it would not serve much purpose .
There are a couple of blog articles that might interest you in this regard:
Feb 20, 2012 10:43 PM|abhishek dutta|LINK