locked
Report binding best practice: Dataset or Custom object? RRS feed

  • Question

  • User235819572 posted

    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.

    user-hostile

    Sunday, December 18, 2011 9:24 PM

Answers

  • User457092449 posted

    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 ActiveReports.

    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:

    http://blogs.gcpowertools.co.in/2011/12/using-entity-framework-with-active.html

    http://blogs.gcpowertools.co.in/2011/10/using-xsd-dataset-as-datasource-for.html

    Regards.

    Abhishek Dutta

    Grapecity

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 20, 2011 4:03 AM

All replies

  • User-1923420989 posted

    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

    Monday, December 19, 2011 5:17 AM
  • User457092449 posted

    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 ActiveReports.

    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:

    http://blogs.gcpowertools.co.in/2011/12/using-entity-framework-with-active.html

    http://blogs.gcpowertools.co.in/2011/10/using-xsd-dataset-as-datasource-for.html

    Regards.

    Abhishek Dutta

    Grapecity

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 20, 2011 4:03 AM
  • User457092449 posted

    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 ActiveReports.

    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:

    http://blogs.gcpowertools.co.in/2011/12/using-entity-framework-with-active.html

    http://blogs.gcpowertools.co.in/2011/10/using-xsd-dataset-as-datasource-for.html

    Regards.

    Abhishek Dutta

    Grapecity

    Monday, February 20, 2012 10:43 PM