自动生成的 RDLC 代码不考虑子报表中的分页符

eko*_*lis 6 c# rdlc

我有一些 C# 代码可以生成一些 RDLC,例如作为另一个报告的子报告:

<?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">
  <Width>7.5in</Width>
  <Code>
  (some VB scripts go here)
  </Code>
  <rd:ReportID>REDACTED</rd:ReportID>
  <rd:ReportUnitType>Inch</rd:ReportUnitType>
  <Body>
    <Height>3in</Height>
    <ReportItems>
      <Rectangle Name="Zb2f2f8b4ff494d15bc6585b34efb7652">
        <Style>
          <Border />
        </Style>
        <Height>0.125in</Height>
        <Width>7.5in</Width>
        <Top>0.01in</Top>
        <Left>0in</Left>
        <KeepTogether>false</KeepTogether>
        <ReportItems>
            (one and a half godzillion report items go here)
        </ReportItems>
        <PageBreak>
          <BreakLocation>Start</BreakLocation>
        </PageBreak>
        <Bookmark>Zfe6b6d34b3e1409dadd5fd77a1acb08c</Bookmark>
      </Rectangle>
      <Rectangle Name="Zfe6b6d34b3e1409dadd5fd77a1acb08c">
        <Style>
          <Border />
        </Style>
        <Height>0.125in</Height>
        <Width>7.5in</Width>
        <Top>0.26in</Top>
        <Left>0in</Left>
        <KeepTogether>false</KeepTogether>
        <ReportItems>
            (seven to the 9001st power report items go here)
        </ReportItems>
        <Bookmark>Zfe6b6d34b3e1409dadd5fd77a1acb08c</Bookmark>
      </Rectangle>
    </ReportItems>
  </Body>
  <DataSets>
    (some data sets go here)
    </DataSet>
  </DataSets>
  <ReportParameters>
    <ReportParameter Name="Title">
      <DataType>String</DataType>
      <Prompt>ReportParameter1</Prompt>
      <AllowBlank>true</AllowBlank>
      <Nullable>true</Nullable>
      <DefaultValue>
        <Values>
          <Value>Events</Value>
        </Values>
      </DefaultValue>
    </ReportParameter>
    <ReportParameter Name="r19">
      <DataType>String</DataType>
      <Prompt>ReportParameter1</Prompt>
      <AllowBlank>true</AllowBlank>
      <Nullable>true</Nullable>
    </ReportParameter>
    <ReportParameter Name="EventFilter">
      <DataType>String</DataType>
      <Prompt>ReportParameter1</Prompt>
      <AllowBlank>true</AllowBlank>
      <Nullable>true</Nullable>
    </ReportParameter>
    <ReportParameter Name="r51">
      <DataType>String</DataType>
      <Prompt>ReportParameter1</Prompt>
      <AllowBlank>true</AllowBlank>
      <Nullable>true</Nullable>
    </ReportParameter>
  </ReportParameters>
  <Page>
    <PageHeight>11in</PageHeight>
    <PageWidth>8.5in</PageWidth>
    <LeftMargin>0.5in</LeftMargin>
    <RightMargin>0.5in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
  </Page>
  <DataSources>
    <DataSource Name="RootModel">
      <rd:DataSourceID>ead9fb2d-33cb-4023-9052-e431eff63ba5</rd:DataSourceID>
      <ConnectionProperties>
        <DataProvider>System.Data.DataSet</DataProvider>
        <ConnectString>/* Local Connection */</ConnectString>
      </ConnectionProperties>
    </DataSource>
  </DataSources>
  <CodeModules>
    <CodeModule>REDACTED.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=REDACTED</CodeModule>
  </CodeModules>
</Report>
Run Code Online (Sandbox Code Playgroud)

然而 <BreakLocation>元素并未得到尊重;报告中的分页符是任意的,而不是出现在指定部分之前。我需要做一些特别的事情来使分页符在子报表中工作吗?

编辑:我将此添加为<ReportItems>集合中的最后一个元素,但无济于事:

<Rectangle Name="Zfdfe94b4111c481abc7df3ca2a2f4f92">
    <Height>0in</Height>
    <Width>0in</Width>
    <Top>0in</Top>
    <Left>0in</Left>
    <KeepTogether>false</KeepTogether>
    <PageBreak>
        <BreakLocation>End</BreakLocation>
    </PageBreak>
</Rectangle>
Run Code Online (Sandbox Code Playgroud)

ale*_*lex 2

据此应该可以在每个子报表底部的所有渲染对象之后的矩形的帮助下在子报表之后添加中断。“PageBreak”属性应设置为“End”。当子报表完成时,矩形会强制分页。