How to build a report with report viewer without datasets, just business objects? RRS feed

  • Question

  • I´ve searching the web to find it. I could, but the problem is, all of them displays the information in a table, that would not work form me since I have to build one page for each record of my Collection (generic list).
    This is what I´m doing:

    I have my application working fine, inputing data and updating/deleting fine. Let´s say you have a Form where you input "Technician info". This form could be loaded with 1 or more "Technicians". Then I want to hit a button and generate a reportViewer document passing as parameter my list of Technicians.
    Also, for each technician in my list, I want the report to generate a new page.

    Is that possible by using only business objects? I ask because have all the data in objects ready to be used, so I would not have to create a dataset.

    Any help is much appreciated.

    Monday, January 11, 2010 3:45 AM


All replies

  • You can pass an IEnumerable of business objects as a data source for the ReportViewer.  This page has some samples for both winforms and webforms that shows how:
    Monday, January 11, 2010 6:19 AM
  • Thanks Brian.

    I built the example you suggested at the link. But I want build something a little different from that. See, the example I developed presents a business objects with 3 objects, and the report is generated in a table. The report I´m building is something like a employee profile register, which you have personal data, contact information, address information, picture, etc. 
    What I need is generate a page for each record in my dataSource. Is that possible?

    Monday, January 11, 2010 11:25 AM
  • You can add a page break to your data region such that it breaks after each group, for example, which should give you the effect you want.  This article has more information:
    Tuesday, January 12, 2010 5:30 AM
  • Thanks very much! That´s exactly what I need!
    Tuesday, January 12, 2010 10:17 AM