none
Creating nested lists displaying data from grandparent, parent and child tables - Grouping problem - VS2005 RRS feed

  • Question

  • I have an xml file, from which I have created a strongly typed dataset (not straight forward in VS2005 - see: http://groups.google.com/group/microsoft.public.dotnet.framework.adonet/browse_thread/thread/2862c14e84a61c97/2812d624f0eac417).


    Code Block

    <?xml version="1.0" encoding="utf-8" ?>
    <ScheduleDataSet xmlns="http://tempuri.org/ScheduleDataSet.xsd">
    <dispatch>
        <name>Schedule name</name>
        <schedule>Schedule number</schedule>
        <callin>
            <number>call in 1</number>
            <part>
                <partnumber>part 1</partnumber>
                <quantity>1</quantity>
        </part>
            <part>
                <partnumber>part 2</partnumber>
                <quantity>2</quantity>
            </part>
      </callin>
        <callin>
            <number>call in 2</number>
            <part>
                <partnumber>part 3</partnumber>
                <quantity>3</quantity>
            </part>
            <part>
                <partnumber>part 4</partnumber>
                <quantity>4</quantity>
            </part>
      </callin>
    </dispatch>
    </ScheduleDataSet>




    This creates 3 tables:

    dispatch
    name
    schedule

    callin
    number
    callin_Id
    dispatch_Id

    part
    partnumber
    quantity
    callin_Id

    I now want a report where dispatch.name is shown, then a list with all the callin.number rows.  Within that list is another list, with all the part rows for that callin.

    So, all simple stuff, but I just can't get it to work.  The callin list works fine, its dataset is set to ScheduleDataSet_callin and its grouping expression is =Fields!callin_Id.Value.  The part list's dataset is set to ScheduleDataSet_part, however when I come to setting its grouping expression I only get the callin fields listed!  What I need to set it to is =Fields!part.partnumber.  If I manually enter this, I get the following build error:

    The Group expression for the list ‘list1’ refers to the field ‘partnumber’.  Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.


    I want my report to look something like this:

    Schedule name
    Schedule number

    call in 1
    part 1     x1
    part 2     x2

    call in 2
    part 3     x3
    part 4     x4


    What am I doing wrong??

    Thanks!

    Thursday, December 13, 2007 9:33 PM

All replies

  • I suspected maybe my dataset wasn't correct, so I created another test project and created the following xml:

    Code Block

    <?xml version="1.0" encoding="utf-8" ?>
    <grandparent>
        <text>Hello world</text>
        <parent>
            <parenttext>foo</parenttext>
            <child>
                <childtext>foo1</childtext>
            </child>
            <child>
                <childtext>foo2</childtext>
            </child>
        </parent>
        <parent>
            <parenttext>bar</parenttext>
            <child>
                <childtext>bar1</childtext>
            </child>
            <child>
                <childtext>bar2</childtext>
            </child>
        </parent>
    </grandparent>



    This time I used xsd.exe to create the following schema file:

    Code Block

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
      <xs:element name="grandparent">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="text" type="xs:string" minOccurs="0" />
            <xs:element name="parent" minOccurs="0" maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="parenttext" type="xs:string" minOccurs="0" />
                  <xs:element name="child" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="childtext" type="xs:string" minOccurs="0" />
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
        <xs:complexType>
          <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element ref="grandparent" />
          </xs:choice>
        </xs:complexType>
      </xs:element>
    </xs:schema>




    From that I created a dataset, again with xsd.exe.  I then created a new report in my project, added the NewDataSet pbject as the datasource.  However I get even less far this time.  The only option now in my DataSetName dropdown property for a report list is NewDataSet_grandparent.
    Thursday, December 13, 2007 10:11 PM
  • I added the extra datasources (parent and child) by manually hacking the rdlc file, but I think I could have done it with the Report Data Sources dialog (Report->Data Sources...).  Either way it doesn't solve my problem.

    This must be a common thing to want to do?

    Chris
    Friday, December 14, 2007 9:24 AM
  • Getting desperate now! lol..  Nesting list boxes n deep is either possible or its not, someone please put me out of my misery!
    Monday, December 17, 2007 9:58 PM
  • Still stuck with this.. Sad  Any guidence, no matter how small, would really be appreciated.
    Sunday, December 30, 2007 1:06 PM