Parent/Children/Grandchildren RRS feed

  • Question

  • Greetings,


    I was suprised I didn't find any info on this searching, maybe I just missed it.


    Using VS 2005 and .rdlc reports. I need to show a structure like Customer/Invoices/Invoice Items. I don't have a problem with listing the invoices, say in a table in a subreport. But I'm not sure how to list each invoice's items. There can be many invoices each with many items.


    If anyone can help me out or point me to a link/tutorial I'd appreciate it.




    Wednesday, April 23, 2008 1:34 PM

All replies

  • Mike,
      I'm do not have a lot of experience using rdlcs however it sounds like you would want to use a table data region and add a couple of groups (one for customer and one for invoices) placing the Invoice Items in the detail row.

    Hope that helps get you started,
    R Hope
    Wednesday, April 23, 2008 2:14 PM
  • We are having the same question and also finding a significant lack of info.

    From what we can see you could indefinetly nest subreports.  However, the main thing we are seeing is that use of a subreport is very inefficient when your parent collection has a reasonable size of child collections.

    I keep finding people asking how to do this without a subreport - but no responses.

    Basically bind to an object which contains an array/list/collection of child objects as a member, then bind that member (the array/list/collection of the current item) to a nested list, and so on.

    We created a simple example to test and have not been able to get it to work.  It is similar to your situation.  Say you bind the report to an array of customers.  The report binds the customer type to a list.  For each customer you want to print out each invoice and for each invoice the items on the invoice.  All without nested subreports, but instead using nested lists.

    This is what we cannot figure out either...

    It is making Reporting Services less useful and making us consider other reporting tools.  Unless we can solve this...
    Thursday, April 24, 2008 3:40 PM
  • Hi LSDO,


    Well, that's not too encouraging. Maybe other reporting tools is the answer.


    Could you do me a favor and point me to an example using the subreports? I know how to use subreports when it's just a parent and then children lists, but I couldn't find anything with grandchildren.


    Even if it's inefficient, we may roll with that until we can find a better solution.




    Monday, April 28, 2008 1:32 PM
  • I didn't actually implement any examples since I found so many reports of the problems the inefficientcy caused.  I would assume some of the samples here contain that:

    It seems that it should be the same to me (of course I haven;t tired) - where each subreport acts as if it were just a report on that collection and passes info to it's subreport.  The base child report would just access a single object.

    I would start from the bottom up.  Create a child report.
    Create a parent report that binds to the parent and has a subreport to the children
    Create a grandparent report that does the similar...

    But as this really won't work for us, (even if there weren't issues) I haven't pursued it...
    Tuesday, April 29, 2008 11:09 PM
  • Thanks for the info, LSDO, much appreciated.



    Wednesday, April 30, 2008 2:14 PM