Pagebreaks in RDLC Subreports not showing up

I am trying to present a parent-child-grandson relationship in an RDLC report of SQL Server Services reports. The report appears in the reportviewer control hosted by the WPF application. I am using the IEnumberable <> -based CLR dataset and linking reportviewer datasources to my datasets in a virtual machine.

I want each child to appear on a new page (and span pages if there are enough big children in the data set).

Currently, I have a master report for the parent object, a subordinate report for the child, and another sub-register for the grandchildren.

Each report uses Tablix to place the fields of the corresponding CLR class on the page. I assigned a group to a Tablix child of the slave and set PageBreaks to StartAndEnd (i.e., all 3 checkboxes are selected in the Group Properties dialog box).

I disconnected everything together to find it.

Unfortunately, page breaks are ignored when I view a report in print layout mode or export to PDF, and the children in the sub stream all get along without page breaks separating them.

I saw several problems in SO and MSDN talking about unwanted page breaks, but I did not find a discussion of missing page breaks.

Does anyone know how to make page breaks appear in sub-reports? If not, is there a better / alternative way to present parent / child type data, for example, without using a sub-report?

Thanks for any information you can offer.

FWIW, the following are a few extracts of RDLC that can be relavent:

Parent Report:

<TablixRow> <Height>0.25in</Height> <TablixCells> <TablixCell> <CellContents> <Rectangle Name="Rectangle1"> <ReportItems> <Subreport Name="InvoicePageDetail"> <ReportName>InvoicePageDetail</ReportName> <Parameters> <Parameter Name="InvoiceID"> <Value>=Fields!InvoiceID.Value</Value> </Parameter> <Parameter Name="CustID"> <Value>=Fields!CustID.Value</Value> </Parameter> </Parameters> <Height>0.25in</Height> <Width>6.4in</Width> <Style> <Border> <Style>None</Style> </Border> </Style> </Subreport> </ReportItems> <PageBreak> <BreakLocation>End</BreakLocation> </PageBreak> </Rectangle> <ColSpan>3</ColSpan> </CellContents> </TablixCell> <TablixCell /> <TablixCell /> </TablixCells> </TablixRow> 

Sub report:

 <?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="ISCBillingDataModel"> <ConnectionProperties> <DataProvider>System.Data.DataSet</DataProvider> <ConnectString>/* Local Connection */</ConnectString> </ConnectionProperties> <rd:DataSourceID>50ce54a7-32e3-46df-bd7c-97f194ba4390</rd:DataSourceID> </DataSource> </DataSources> <DataSets> snip... </DataSets> <Body> <ReportItems> <Tablix Name="Tablix1"> <TablixBody> <TablixColumns> snip... </TablixColumns> <TablixRows> <TablixRow> <Height>0.25in</Height> <TablixCells> <TablixCell> <CellContents> <Subreport Name="InvoiceFixedFeeDetail"> <ReportName>InvoiceFixedFeeDetail</ReportName> <Parameters> <Parameter Name="InvoicePageID"> <Value>=Fields!InvoicePageID.Value</Value> </Parameter> </Parameters> <Style> <Border> <Style>None</Style> </Border> </Style> </Subreport> <ColSpan>3</ColSpan> </CellContents> </TablixCell> <TablixCell /> <TablixCell /> </TablixCells> </TablixRow> </TablixRows> </TablixBody> <TablixColumnHierarchy> <TablixMembers> <TablixMember /> <TablixMember /> <TablixMember /> </TablixMembers> </TablixColumnHierarchy> <TablixRowHierarchy> <TablixMembers> <TablixMember> <Group Name="Group1"> <GroupExpressions> <GroupExpression>=Fields!InvoicePageID.Value</GroupExpression> </GroupExpressions> <PageBreak> <BreakLocation>StartAndEnd</BreakLocation> </PageBreak> </Group> <SortExpressions> <SortExpression> <Value>=Fields!InvoicePageID.Value</Value> </SortExpression> </SortExpressions> <TablixHeader> <Size>0.03125in</Size> <CellContents> <Textbox Name="Textbox11"> <CanGrow>true</CanGrow> <CanShrink>true</CanShrink> <KeepTogether>true</KeepTogether> <Paragraphs> <Paragraph> <TextRuns> <TextRun> <Value /> <Style /> </TextRun> </TextRuns> <Style /> </Paragraph> </Paragraphs> <rd:DefaultName>Textbox11</rd:DefaultName> <Style> <Border> <Color>LightGrey</Color> <Style>None</Style> </Border> </Style> </Textbox> </CellContents> </TablixHeader> <TablixMembers> <TablixMember> <Group Name="Details"> <PageBreak> <BreakLocation>StartAndEnd</BreakLocation> </PageBreak> </Group> <TablixMembers> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> <TablixMember /> </TablixMembers> </TablixMember> </TablixMembers> </TablixMember> </TablixMembers> </TablixRowHierarchy> <DataSetName>pages</DataSetName> <PageBreak> <BreakLocation>Start</BreakLocation> </PageBreak> <Height>3.45in</Height> <Width>6.38125in</Width> <Style> <Border> <Style>None</Style> </Border> </Style> </Tablix> </ReportItems> <Height>3.6in</Height> <Style> <Border> <Color>Green</Color> <Style>None</Style> </Border> </Style> </Body> <ReportParameters> <ReportParameter Name="InvoiceID"> <DataType>Integer</DataType> <Prompt>ReportParameter1</Prompt> </ReportParameter> <ReportParameter Name="CustID"> <DataType>String</DataType> <Prompt>ReportParameter1</Prompt> </ReportParameter> </ReportParameters> <Width>6.43125in</Width> <Page> <LeftMargin>1in</LeftMargin> <RightMargin>1in</RightMargin> <TopMargin>1in</TopMargin> <BottomMargin>1in</BottomMargin> <Style /> </Page> <rd:ReportID>a360303c-713c-4baf-b9ce-32ae0997c855</rd:ReportID> <rd:ReportUnitType>Inch</rd:ReportUnitType> </Report> 
+6
ssrs-2008 page-break rdlc subreport
source share
1 answer

I have a partial answer, but it seems to hack IMO. I will leave this question open for a while to find out if anyone can suggest a better answer ...

To make page breaks appear where I wanted them, I excluded sub-tasks by denormalizing the CLR dataset that managed the main report. Then I used the row groups in the main report to create the page layout and checked the “Between each instance” and “Also at the beginning” checkboxes on the Page Breaks tab in the Group Properties dialog box, equivalent to the following setting in RDLC xml

  <PageBreak> <BreakLocation>Start</BreakLocation> </PageBreak> 

I saved the grand-child object (invoice lines), normalized to my own data set and sub-report, because the location of the row columns is significantly different from the level of the invoice header or the level of the invoice page.


While this gives the desired layout, I am not completely satisfied with this answer, because I don't like the denormalization of the dataset. I want to learn how a DataElementName works, and whether this can provide a better solution.

Alternative answers are welcome.

0
source share

All Articles