Reporting newbie... Subreports and Recursive data?

3 posts, 0 answers
  1. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 16 Aug 2012 Link to this post

    Hi... I'm pretty new to reporting and I need some help solving a problem..

    Firstly, my datasource is a collection of items returned from a web service.  The items can be parents of other items.  I need to create a report that shows all items where IsKey is true.  Then, for each item below that, I need to show the children.  The problem is that since each child can in turn have children, the report needs to be recursive.  My subreport has a parameter and filter on the ID.  My first idea was to add a reference to the same subreport but it says I can't because of circular references.  Is there a way to do this?

    Here is an example class

    pubic class foo
    {
        public Guid ID;
        public String Name;
        public Boolean IsKey;
         
        public List<foo> Children;
    }

    My report needs to look something like this (where the level can be infinite):

    Report Name

    --------------



    Item.Name
    ---Item1.Child1.Name
       ---Item1.Child1.Child1.Name
           ---Item1.Child2.Name
           ---Item1.Child3.Name

    ---Item2.Name
  2. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 16 Aug 2012 Link to this post

    Ok, so I downloaded the newest version of the Reporting libraries and I can make the circular reference now (I think).  But I followed the instructions at Here to put the sub-report into my main report and it doesn't work.  The main report works but then the sub-reports give an error: "Object reference not set to an instance of an object."  I'm not sure what it is that has a null reference though...
  3. DevCraft banner
  4. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 16 Aug 2012 Link to this post

    I fixed that last error.  I've figure out that the problem I'm having is that I can't get the data down to the sub report...   I've set up a filter but it doesn't seem to be working.
Back to Top