Long Tables in Detail section that span over pagebreak cause Master table header to not repeat

  • Hi!

    This is my first time posting here. I am reasonably new to SSRS and am working on a rather large report at the moment. Previously I was using Subreports to accomplish my goal, however they proved to massively underperform when using large datasets.

    I have de-normalised my data and moved to using nested data-regions which perform really well, with the exception of this problem!

    Listed below is a sample of the problem that I am encountering. Basically I have a table structure on the report that can have sub tables displaying detail records. There are 3 types of record in my dataset; RecType 1 (Master level), RecType 2 (detail1) and RecType 3 (detail2).

    The normalised relationships between the record types would be; RecType 1 - RecType2 (1:1), RecType1 - RecType 3 (1:*)

    From my testing it appears that if you nest a subtable and set a group on that table, then the header of the parent does not draw :s

    PLEASE PLEASE PLEASE CAN SOMEONE HELP ME - I'm really struggling here 🙁

    (SSRS 2008 report, setup to use a local datasource with integrated security)

    <?xml version="1.0" encoding="utf-8"?>

    <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">

    <DataSources>

    <DataSource Name="DataSource1">

    <ConnectionProperties>

    <DataProvider>SQL</DataProvider>

    <ConnectString>Data Source=localhost;Initial Catalog=master</ConnectString>

    <IntegratedSecurity>true</IntegratedSecurity>

    </ConnectionProperties>

    <rd:DataSourceID>01783f0b-5b73-4bd4-a976-481263ef6d34</rd:DataSourceID>

    <rd:SecurityType>Windows</rd:SecurityType>

    </DataSource>

    </DataSources>

    <DataSets>

    <DataSet Name="TestData">

    <Fields>

    <Field Name="RecNo">

    <DataField>RecNo</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="RecType">

    <DataField>RecType</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="Detail">

    <DataField>Detail</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="HasSubDetail1">

    <DataField>HasSubDetail1</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="HasSubDetail2">

    <DataField>HasSubDetail2</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="SubDetail1Field">

    <DataField>SubDetail1Field</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="SubDetail2FieldA">

    <DataField>SubDetail2FieldA</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="SubDetail2FieldB">

    <DataField>SubDetail2FieldB</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    </Fields>

    <Query>

    <DataSourceName>DataSource1</DataSourceName>

    <CommandText>-- RecType: 1 = Master, 2 = SubDetail1, 3 = SubDetail2

    -- Report should look like ;

    --

    -- RecType 1

    -- | RecType 2

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

    -- | RecType 3

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

    SELECT 1 As RecNo, 1 AS RecType, 'MasterRow1' AS Detail, 0 AS HasSubDetail1, 0 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 2 As RecNo, 1 As RecType, 'MasterRow2' AS Detail, 1 AS HasSubDetail1, 0 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 2 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 1 AS RecType, 'MasterRow3' AS Detail, 1 AS HasSubDetail1, 1 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '1' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '2' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '3' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '4' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '5' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '6' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '7' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '8' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '9' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '10' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '11' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '12' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '13' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '14' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '15' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '16' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '17' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '18' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '19' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '20' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '21' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '22' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '24' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '25' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '26' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '27' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '28' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '29' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '30' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '31' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '32' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '33' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '34' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '35' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '36' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '37' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '38' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 1 AS RecType, 'MasterRow4' AS Detail, 1 AS HasSubDetail1, 1 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '1' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '2' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '3' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '4' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '5' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '6' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '7' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '8' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '9' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '10' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '11' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '12' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '13' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '14' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '15' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '16' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '17' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '18' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '19' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '20' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '21' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '22' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '24' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '25' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '26' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '27' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '28' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '29' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '30' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '31' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '32' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '33' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '34' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '35' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '36' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '37' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '38' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB</CommandText>

    </Query>

    </DataSet>

    </DataSets>

    <Body>

    <ReportItems>

    <Tablix Name="Tablix1">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>11.91917cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox1">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>HeaderShouldRepeatOnEveryPageButDoesn'tDueToSubDetail2Table</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox1</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>Orange</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Detail">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!Detail.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Detail</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightSteelBlue</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>3.48396cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Rectangle Name="Rectangle1">

    <ReportItems>

    <Tablix Name="Tablix2">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>4.19333cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox13">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail1</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox13</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightGreen</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail1Field">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail1Field.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail1Field</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember />

    <TablixMember />

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestData</DataSetName>

    <Filters>

    <Filter>

    <FilterExpression>=Fields!RecType.Value</FilterExpression>

    <Operator>Equal</Operator>

    <FilterValues>

    <FilterValue>=2</FilterValue>

    </FilterValues>

    </Filter>

    </Filters>

    <Top>0.79355cm</Top>

    <Left>2.98133cm</Left>

    <Height>1.2cm</Height>

    <Width>4.19333cm</Width>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    <Textbox Name="Detail1">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!Detail.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Detail1</rd:DefaultName>

    <Top>0.01716cm</Top>

    <Height>0.6cm</Height>

    <Width>11.91917cm</Width>

    <ZIndex>1</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    <BackgroundColor>LightSteelBlue</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    <Tablix Name="Tablix3">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>4.19333cm</Width>

    </TablixColumn>

    <TablixColumn>

    <Width>4.43146cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox14">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail2FieldA</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox13</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>PaleTurquoise</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox22">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail2FieldB</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox22</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>PaleTurquoise</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail1Field2">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail2FieldA.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail1Field</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail2FieldB">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail2FieldB.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail2FieldB</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <KeepWithGroup>After</KeepWithGroup>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    </TablixMember>

    <TablixMember>

    <Group Name="Details2">

    <GroupExpressions>

    <GroupExpression>=Fields!RecNo.Value</GroupExpression>

    <GroupExpression>=Fields!SubDetail2FieldA.Value</GroupExpression>

    </GroupExpressions>

    </Group>

    </TablixMember>

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestData</DataSetName>

    <Filters>

    <Filter>

    <FilterExpression>=Fields!RecType.Value</FilterExpression>

    <Operator>Equal</Operator>

    <FilterValues>

    <FilterValue>=3</FilterValue>

    </FilterValues>

    </Filter>

    </Filters>

    <Top>2.16994cm</Top>

    <Left>2.98133cm</Left>

    <Height>1.2cm</Height>

    <Width>8.62479cm</Width>

    <ZIndex>2</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    </ReportItems>

    <KeepTogether>true</KeepTogether>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Rectangle>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <KeepWithGroup>After</KeepWithGroup>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    <KeepTogether>true</KeepTogether>

    </TablixMember>

    <TablixMember>

    <Group Name="Details">

    <GroupExpressions>

    <GroupExpression>=Fields!RecNo.Value</GroupExpression>

    </GroupExpressions>

    </Group>

    <TablixMembers>

    <TablixMember>

    <Visibility>

    <Hidden>=Iif(Fields!HasSubDetail1.Value, true, Iif(Fields!HasSubDetail2.Value, true, false))</Hidden>

    </Visibility>

    </TablixMember>

    <TablixMember>

    <Visibility>

    <Hidden>=Iif(Fields!HasSubDetail1.Value, false, Iif(Fields!HasSubDetail2.Value, false, true))</Hidden>

    </Visibility>

    </TablixMember>

    </TablixMembers>

    </TablixMember>

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestData</DataSetName>

    <Height>4.68396cm</Height>

    <Width>11.91917cm</Width>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    </ReportItems>

    <Height>1.84408in</Height>

    <Style />

    </Body>

    <Width>4.69259in</Width>

    <Page>

    <PageHeight>29.7cm</PageHeight>

    <PageWidth>21cm</PageWidth>

    <LeftMargin>2cm</LeftMargin>

    <RightMargin>2cm</RightMargin>

    <TopMargin>2cm</TopMargin>

    <BottomMargin>2cm</BottomMargin>

    <ColumnSpacing>0.13cm</ColumnSpacing>

    <Style />

    </Page>

    <rd:ReportID>b52b1f3f-07f4-4d07-a321-977504abab8f</rd:ReportID>

    <rd:ReportUnitType>Cm</rd:ReportUnitType>

    </Report>

  • Hi,

    As per my understanding your report table have large number of columns bcz of it the page breaks is occuring but report headers are not repeteting.

    you can make group headers or tablix headres repeat in multiple pages.

    http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/ee29da49-5c8c-47f3-a905-c730dcbe9780/

    http://stackoverflow.com/questions/3580780/report-headers-not-repeating-on-random-pages-in-ssrs-2008-when-exporting-to-pdf

    http://justsamson.com/2010/09/17/repeating-tablix-column-headers-with-ssrs-2008/

    Thanks & Regards,
    Veeren.
    Ignore this if you feel i am Wrong. 😉

  • Hi

    Thanks for your speedy response 🙂 I probably should have added that I have applied the Advanced / RepeatOnNewPage properties trick to the example in the code area already.

    This makes the headers appear fine, but only when the table doesn't contain a subtable with a different grouping set on it (as per my example). If it does, then the headers from the parent table just are not visible at all apart from on the first page.

    Because I'm new to SSRS, maybe it's something I'm missing about grouping??

    Cheers 🙂

    PS. Posting this from my actual account :p

  • If anyone stumbles across this in the future and is searching around for a 'solution' in the same way I was, then what I did was to not have either of the sup-grouped data (the rectype 2s and 3s in the example above) repeat.

    This meant that in the SQL I concatenated multiple rectype 2 and rectype 3 rows into a single string, delimited with CHAR(13) + CHAR(10) and then just displayed them in SSRS without a details grouping on the sub-tables.

    For whatever reason this then caused the main table's header to repeat on every single page... stupid, buggy SSRS!!

    So the relationship between the records was previously;

    RecType 1 - RecType 2 (1:1)

    RecType 1 - RecType 3 (1:*)

    and is now;

    RecType 1 - RecType 2 (1:1)

    RecType 1 - RecType 3 (1:1) (detail rows are flattened into a single string value per column)

    Hope this helps!

  • Solution 2008 RDL (with original example as well)

    <?xml version="1.0" encoding="utf-8"?>

    <Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">

    <DataSources>

    <DataSource Name="DataSource1">

    <ConnectionProperties>

    <DataProvider>SQL</DataProvider>

    <ConnectString>Data Source=localhost;Initial Catalog=master</ConnectString>

    <IntegratedSecurity>true</IntegratedSecurity>

    </ConnectionProperties>

    <rd:DataSourceID>01783f0b-5b73-4bd4-a976-481263ef6d34</rd:DataSourceID>

    <rd:SecurityType>Windows</rd:SecurityType>

    </DataSource>

    </DataSources>

    <DataSets>

    <DataSet Name="TestData">

    <Fields>

    <Field Name="RecNo">

    <DataField>RecNo</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="RecType">

    <DataField>RecType</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="Detail">

    <DataField>Detail</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="HasSubDetail1">

    <DataField>HasSubDetail1</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="HasSubDetail2">

    <DataField>HasSubDetail2</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="SubDetail1Field">

    <DataField>SubDetail1Field</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="SubDetail2FieldA">

    <DataField>SubDetail2FieldA</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="SubDetail2FieldB">

    <DataField>SubDetail2FieldB</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    </Fields>

    <Query>

    <DataSourceName>DataSource1</DataSourceName>

    <CommandText>-- RecType: 1 = Master, 2 = SubDetail1, 3 = SubDetail2

    -- Report should look like ;

    --

    --RecType 1

    --| RecType 2

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

    --| RecType 3

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

    SELECT 1 As RecNo, 1 AS RecType, 'MasterRow1' AS Detail, 0 AS HasSubDetail1, 0 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 2 As RecNo, 1 As RecType, 'MasterRow2' AS Detail, 1 AS HasSubDetail1, 0 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 2 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 1 AS RecType, 'MasterRow3' AS Detail, 1 AS HasSubDetail1, 1 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '1' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '2' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '3' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '4' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '5' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '6' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '7' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '8' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '9' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '10' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '11' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '12' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '13' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '14' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '15' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '16' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '17' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '18' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '19' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '20' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '21' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '22' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '24' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '25' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '26' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '27' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '28' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '29' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '30' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '31' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '32' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '33' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '34' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '35' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '36' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '37' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '38' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 1 AS RecType, 'MasterRow4' AS Detail, 1 AS HasSubDetail1, 1 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '1' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '2' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '3' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '4' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '5' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '6' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '7' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '8' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '9' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '10' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '11' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '12' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '13' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '14' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '15' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '16' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '17' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '18' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '19' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '20' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '21' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '22' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '24' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '25' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '26' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '27' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '28' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '29' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '30' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '31' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '32' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '33' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '34' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '23' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '35' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '36' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '37' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '38' AS SubDetail2FieldA, 'SubDetail2Data' AS SubDetail2FieldB</CommandText>

    </Query>

    </DataSet>

    <DataSet Name="TestDataFlatDetail">

    <Fields>

    <Field Name="RecNo">

    <DataField>RecNo</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="RecType">

    <DataField>RecType</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="Detail">

    <DataField>Detail</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="HasSubDetail1">

    <DataField>HasSubDetail1</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="HasSubDetail2">

    <DataField>HasSubDetail2</DataField>

    <rd:TypeName>System.Int32</rd:TypeName>

    </Field>

    <Field Name="SubDetail1Field">

    <DataField>SubDetail1Field</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="SubDetail2FieldA">

    <DataField>SubDetail2FieldA</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    <Field Name="SubDetail2FieldB">

    <DataField>SubDetail2FieldB</DataField>

    <rd:TypeName>System.String</rd:TypeName>

    </Field>

    </Fields>

    <Query>

    <DataSourceName>DataSource1</DataSourceName>

    <CommandText>-- RecType: 1 = Master, 2 = SubDetail1, 3 = SubDetail2

    -- Report should look like ;

    --

    --RecType 1

    --| RecType 2

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

    --| RecType 3

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

    SELECT 1 As RecNo, 1 AS RecType, 'MasterRow1' AS Detail, 0 AS HasSubDetail1, 0 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 2 As RecNo, 1 As RecType, 'MasterRow2' AS Detail, 1 AS HasSubDetail1, 0 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 2 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 1 AS RecType, 'MasterRow3' AS Detail, 1 AS HasSubDetail1, 1 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, 'SubDetail1Data' AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 3 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '1' + CHAR(13) + CHAR(10) + '2' + CHAR(13) + CHAR(10) + '3' + CHAR(13) + CHAR(10) + '4' + CHAR(13) + CHAR(10) + '5' + CHAR(13) + CHAR(10) + '6' + CHAR(13) + CHAR(10) + '7' + CHAR(13) + CHAR(10) + '8' + CHAR(13) + CHAR(10) + '9' + CHAR(13) + CHAR(10) + '10' + CHAR(13) + CHAR(10) + '11' + CHAR(13) + CHAR(10) + '12' + CHAR(13) + CHAR(10) + '13' + CHAR(13) + CHAR(10) + '14' + CHAR(13) + CHAR(10) + '15' + CHAR(13) + CHAR(10) + '16' + CHAR(13) + CHAR(10) + '17' + CHAR(13) + CHAR(10) + '18' + CHAR(13) + CHAR(10) + '19' + CHAR(13) + CHAR(10) + '20' + CHAR(13) + CHAR(10) + '21' + CHAR(13) + CHAR(10) + '22' + CHAR(13) + CHAR(10) + '23' + CHAR(13) + CHAR(10) + '24' + CHAR(13) + CHAR(10) + '25' + CHAR(13) + CHAR(10) + '26' + CHAR(13) + CHAR(10) + '27' + CHAR(13) + CHAR(10) + '28' + CHAR(13) + CHAR(10) + '29' + CHAR(13) + CHAR(10) + '30' + CHAR(13) + CHAR(10) + '31' + CHAR(13) + CHAR(10) + '32' + CHAR(13) + CHAR(10) + '33' + CHAR(13) + CHAR(10) + '34' + CHAR(13) + CHAR(10) + 'etc!!' AS SubDetail2FieldA, 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'etc!!' AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 1 AS RecType, 'MasterRow4' AS Detail, 1 AS HasSubDetail1, 1 AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 2 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, NULL AS SubDetail2FieldA, NULL AS SubDetail2FieldB

    UNION ALL

    SELECT 4 As RecNo, 3 AS RecType, NULL AS Detail, NULL AS HasSubDetail1, NULL AS HasSubDetail2, NULL AS SubDetail1Field, '1' + CHAR(13) + CHAR(10) + '2' + CHAR(13) + CHAR(10) + '3' + CHAR(13) + CHAR(10) + '4' + CHAR(13) + CHAR(10) + '5' + CHAR(13) + CHAR(10) + '6' + CHAR(13) + CHAR(10) + '7' + CHAR(13) + CHAR(10) + '8' + CHAR(13) + CHAR(10) + '9' + CHAR(13) + CHAR(10) + '10' + CHAR(13) + CHAR(10) + '11' + CHAR(13) + CHAR(10) + '12' + CHAR(13) + CHAR(10) + '13' + CHAR(13) + CHAR(10) + '14' + CHAR(13) + CHAR(10) + '15' + CHAR(13) + CHAR(10) + '16' + CHAR(13) + CHAR(10) + '17' + CHAR(13) + CHAR(10) + '18' + CHAR(13) + CHAR(10) + '19' + CHAR(13) + CHAR(10) + '20' + CHAR(13) + CHAR(10) + '21' + CHAR(13) + CHAR(10) + '22' + CHAR(13) + CHAR(10) + '23' + CHAR(13) + CHAR(10) + '24' + CHAR(13) + CHAR(10) + '25' + CHAR(13) + CHAR(10) + '26' + CHAR(13) + CHAR(10) + '27' + CHAR(13) + CHAR(10) + '28' + CHAR(13) + CHAR(10) + '29' + CHAR(13) + CHAR(10) + '30' + CHAR(13) + CHAR(10) + '31' + CHAR(13) + CHAR(10) + '32' + CHAR(13) + CHAR(10) + '33' + CHAR(13) + CHAR(10) + '34' + CHAR(13) + CHAR(10) + 'etc!!' AS SubDetail2FieldA, 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'SubDetail2Data' + CHAR(13) + CHAR(10) + 'etc!!' AS SubDetail2FieldB</CommandText>

    <rd:UseGenericDesigner>true</rd:UseGenericDesigner>

    </Query>

    </DataSet>

    </DataSets>

    <Body>

    <ReportItems>

    <Tablix Name="Tablix1">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>14.32688cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox1">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>HeaderShouldRepeatOnEveryPageButDoesn'tDueToSubDetail2TableGrouping</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox1</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>Orange</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Detail">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!Detail.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Detail</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightSteelBlue</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>3.48396cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Rectangle Name="Rectangle1">

    <ReportItems>

    <Tablix Name="Tablix2">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>4.19333cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox13">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail1</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox13</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightGreen</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail1Field">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail1Field.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail1Field</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember />

    <TablixMember />

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestData</DataSetName>

    <Filters>

    <Filter>

    <FilterExpression>=Fields!RecType.Value</FilterExpression>

    <Operator>Equal</Operator>

    <FilterValues>

    <FilterValue>=2</FilterValue>

    </FilterValues>

    </Filter>

    </Filters>

    <Top>0.79355cm</Top>

    <Left>2.98133cm</Left>

    <Height>1.2cm</Height>

    <Width>4.19333cm</Width>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    <Textbox Name="Detail1">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!Detail.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Detail1</rd:DefaultName>

    <Top>0.01716cm</Top>

    <Height>0.6cm</Height>

    <Width>14.32688cm</Width>

    <ZIndex>1</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    <BackgroundColor>LightSteelBlue</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    <Tablix Name="Tablix3">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>4.19333cm</Width>

    </TablixColumn>

    <TablixColumn>

    <Width>4.43146cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox14">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail2FieldA</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox13</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>PaleTurquoise</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox22">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail2FieldB</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox22</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>PaleTurquoise</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail1Field2">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail2FieldA.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail1Field</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail2FieldB">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail2FieldB.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail2FieldB</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <KeepWithGroup>After</KeepWithGroup>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    </TablixMember>

    <TablixMember>

    <Group Name="Details2">

    <GroupExpressions>

    <GroupExpression>=Fields!RecNo.Value</GroupExpression>

    <GroupExpression>=Fields!SubDetail2FieldA.Value</GroupExpression>

    </GroupExpressions>

    </Group>

    </TablixMember>

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestData</DataSetName>

    <Filters>

    <Filter>

    <FilterExpression>=Fields!RecType.Value</FilterExpression>

    <Operator>Equal</Operator>

    <FilterValues>

    <FilterValue>=3</FilterValue>

    </FilterValues>

    </Filter>

    </Filters>

    <Top>2.16994cm</Top>

    <Left>2.98133cm</Left>

    <Height>1.2cm</Height>

    <Width>8.62479cm</Width>

    <ZIndex>2</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    </ReportItems>

    <KeepTogether>true</KeepTogether>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Rectangle>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <KeepWithGroup>After</KeepWithGroup>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    <KeepTogether>true</KeepTogether>

    </TablixMember>

    <TablixMember>

    <Group Name="Details">

    <GroupExpressions>

    <GroupExpression>=Fields!RecNo.Value</GroupExpression>

    </GroupExpressions>

    </Group>

    <TablixMembers>

    <TablixMember>

    <Visibility>

    <Hidden>=Iif(Fields!HasSubDetail1.Value, true, Iif(Fields!HasSubDetail2.Value, true, false))</Hidden>

    </Visibility>

    </TablixMember>

    <TablixMember>

    <Visibility>

    <Hidden>=Iif(Fields!HasSubDetail1.Value, false, Iif(Fields!HasSubDetail2.Value, false, true))</Hidden>

    </Visibility>

    </TablixMember>

    </TablixMembers>

    </TablixMember>

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestData</DataSetName>

    <PageBreak>

    <BreakLocation>End</BreakLocation>

    </PageBreak>

    <Height>4.68396cm</Height>

    <Width>14.32688cm</Width>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    <Tablix Name="Tablix4">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>14.32688cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox2">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>HeaderDOESrepeatOnEveryPage!!</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox2</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>Orange</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Detail2">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!Detail.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Detail2</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightSteelBlue</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>3.86237cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Rectangle Name="Rectangle2">

    <ReportItems>

    <Tablix Name="Tablix5">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>4.19333cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox16">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail1</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox16</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightGreen</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail1Field1">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail1Field.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail1Field1</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    </TablixMember>

    <TablixMember />

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestDataFlatDetail</DataSetName>

    <Filters>

    <Filter>

    <FilterExpression>=Fields!RecType.Value</FilterExpression>

    <Operator>Equal</Operator>

    <FilterValues>

    <FilterValue>=2</FilterValue>

    </FilterValues>

    </Filter>

    </Filters>

    <Top>1.04097cm</Top>

    <Left>0.85584cm</Left>

    <Height>1.2cm</Height>

    <Width>4.19333cm</Width>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    <Tablix Name="Tablix6">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>4.19333cm</Width>

    </TablixColumn>

    <TablixColumn>

    <Width>4.43146cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox23">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail2FieldA</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox23</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>PaleTurquoise</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    <TablixCell>

    <CellContents>

    <Textbox Name="Textbox25">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>SubDetail2FieldB</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox25</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>PaleTurquoise</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail2FieldA">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail2FieldA.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail2FieldA</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    <TablixCell>

    <CellContents>

    <Textbox Name="SubDetail2FieldB1">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!SubDetail2FieldB.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>SubDetail2FieldB1</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    </TablixMember>

    <TablixMember />

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestDataFlatDetail</DataSetName>

    <Filters>

    <Filter>

    <FilterExpression>=Fields!RecType.Value</FilterExpression>

    <Operator>Equal</Operator>

    <FilterValues>

    <FilterValue>=3</FilterValue>

    </FilterValues>

    </Filter>

    </Filters>

    <Top>2.41736cm</Top>

    <Left>0.85584cm</Left>

    <Height>1.2cm</Height>

    <Width>8.62479cm</Width>

    <ZIndex>1</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    <Textbox Name="Textbox29">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>Both sub-tables;</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>- Filtered RecType = 2 & 3</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>- Remove row grouping</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>- Self-contained in rectangle</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>- Visibility on 'master rows' to make layout consistent</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Textbox29</rd:DefaultName>

    <Top>0.74111cm</Top>

    <Left>9.70139cm</Left>

    <Height>2.87625cm</Height>

    <Width>4.62549cm</Width>

    <ZIndex>2</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    <Tablix Name="Tablix7">

    <TablixBody>

    <TablixColumns>

    <TablixColumn>

    <Width>14.32688cm</Width>

    </TablixColumn>

    </TablixColumns>

    <TablixRows>

    <TablixRow>

    <Height>0.6cm</Height>

    <TablixCells>

    <TablixCell>

    <CellContents>

    <Textbox Name="Detail3">

    <CanGrow>true</CanGrow>

    <KeepTogether>true</KeepTogether>

    <Paragraphs>

    <Paragraph>

    <TextRuns>

    <TextRun>

    <Value>=Fields!Detail.Value</Value>

    <Style />

    </TextRun>

    </TextRuns>

    <Style />

    </Paragraph>

    </Paragraphs>

    <rd:DefaultName>Detail3</rd:DefaultName>

    <Style>

    <Border>

    <Color>LightGrey</Color>

    <Style>Solid</Style>

    </Border>

    <BackgroundColor>LightSteelBlue</BackgroundColor>

    <PaddingLeft>2pt</PaddingLeft>

    <PaddingRight>2pt</PaddingRight>

    <PaddingTop>2pt</PaddingTop>

    <PaddingBottom>2pt</PaddingBottom>

    </Style>

    </Textbox>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestDataFlatDetail</DataSetName>

    <Height>0.6cm</Height>

    <Width>14.32688cm</Width>

    <ZIndex>3</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    </ReportItems>

    <KeepTogether>true</KeepTogether>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Rectangle>

    </CellContents>

    </TablixCell>

    </TablixCells>

    </TablixRow>

    </TablixRows>

    </TablixBody>

    <TablixColumnHierarchy>

    <TablixMembers>

    <TablixMember />

    </TablixMembers>

    </TablixColumnHierarchy>

    <TablixRowHierarchy>

    <TablixMembers>

    <TablixMember>

    <KeepWithGroup>After</KeepWithGroup>

    <RepeatOnNewPage>true</RepeatOnNewPage>

    <KeepTogether>true</KeepTogether>

    </TablixMember>

    <TablixMember>

    <Group Name="Details1">

    <GroupExpressions>

    <GroupExpression>=Fields!RecNo.Value</GroupExpression>

    </GroupExpressions>

    </Group>

    <TablixMembers>

    <TablixMember>

    <Visibility>

    <Hidden>=Iif(Fields!HasSubDetail1.Value, true, Iif(Fields!HasSubDetail2.Value, true, false))</Hidden>

    </Visibility>

    </TablixMember>

    <TablixMember />

    </TablixMembers>

    </TablixMember>

    </TablixMembers>

    </TablixRowHierarchy>

    <DataSetName>TestDataFlatDetail</DataSetName>

    <Top>4.86035cm</Top>

    <Height>5.06237cm</Height>

    <Width>14.32688cm</Width>

    <ZIndex>1</ZIndex>

    <Style>

    <Border>

    <Style>None</Style>

    </Border>

    </Style>

    </Tablix>

    </ReportItems>

    <Height>3.90658in</Height>

    <Style />

    </Body>

    <Width>5.6405in</Width>

    <Page>

    <PageHeight>29.7cm</PageHeight>

    <PageWidth>21cm</PageWidth>

    <LeftMargin>2cm</LeftMargin>

    <RightMargin>2cm</RightMargin>

    <TopMargin>2cm</TopMargin>

    <BottomMargin>2cm</BottomMargin>

    <ColumnSpacing>0.13cm</ColumnSpacing>

    <Style />

    </Page>

    <rd:ReportID>b52b1f3f-07f4-4d07-a321-977504abab8f</rd:ReportID>

    <rd:ReportUnitType>Cm</rd:ReportUnitType>

    </Report>

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply