none
Page Breaks with tables in RLDC Report RRS feed

  • Question

  • I am using VS 2008 reporting services and have created an RDLC document that has details in a table of varing size repeated for every "Category" type using grouping.  All is well except when it comes to page breaks.  I would like all the details rows to stick together if they cannot fit within the space left on a page; I would like the whole "group" to start on the next page instead of it breaking in the middle of the table.

    I have tried the Keep Together property and although the descriptions seems to be what i want it clearly is not working.  

    I am directly exporting the report to PDF without using a report viewer. 

    Also a simular problem on the same report, I have a datatable that returns several titles and a long narratives (more than a page ussually) which I have the header of a table being the title and the detail being the narrative.  I would like every new title to start on a new page, and never should the title and the narrative be seperated.

    I tried the PageBreakBefore/PageBreakAfter properties on the table and they are not working.  I thought KeepTogether might make sure the header is always above the narrative even if it is moved to next page but it did not.  Is there something i am missing?

     

     - Richard

    Wednesday, February 4, 2009 8:35 PM

Answers

  • I have figured this out, after several wasted hours of Microsoft and our's time i ran across it earlier today.  Under the table properties (have to click the box above detail and group rows then right click the selection and select properties) there is a group tab which will list your normal groups you have. 

    There is also another button at bottom labeled "Details Grouping..." and if you add a group to this it will add an entry like this to thedetails section for your tables in the RDLC xml:

              <Grouping Name="table18_Details_Group">
                <GroupExpressions>
                  <GroupExpression>=Fields!IdentifiedIssue.Value</GroupExpression>
                </GroupExpressions>
              </Grouping>

    which will make keep together act correctly.  I have no idea why the regular group does not preform this function but I am sure there is a great reason.

     - Richard
    • Marked as answer by ASP.NET Lover Wednesday, March 25, 2009 11:38 PM
    Wednesday, March 25, 2009 11:38 PM

All replies

  • I fixed the second part of this post by making the header of the table a group row and then checking the Break After Group box in the Edit Group Properties. 
    Wednesday, February 4, 2009 9:39 PM
  • Ok so it looks like the Keep together applies to groups and not the details row so I added a group on a unique identifier of the details and then put the first header in it and set KeepTogether = true and the number of broken tables was significantly reduced. 

    There is still an issue with sometimes it will break the table up i was wondering what are the rules on "if possible" in the "Indicates that the data region (all Repeated sections) should be kept together on one page if possible."  so i can always make it possible.

    Wednesday, February 4, 2009 10:27 PM
  •  Ok, I am still having issues with this and figured I would provide more information.  According to 

    http://msdn.microsoft.com/en-us/library/aa178942(SQL.80).aspx

    The keep together and textboxes are supposed to act exactly like I want them to behave but the RDLC is still redering incorrectly, in PDF or in the Repoerviewer control. 

    Example code from report

    <?xml version="1.0" encoding="utf-8"?>  
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">  
       
                                    <ReportItems> 
                            <Textbox Name="textbox233">  
                              <rd:DefaultName>textbox233</rd:DefaultName> 
                              <Style> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value /> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox234">  
                              <rd:DefaultName>textbox234</rd:DefaultName> 
                              <Style> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value /> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                      </TableCells> 
                      <Height>0.25in</Height> 
                    </TableRow> 
                  </TableRows> 
                </Footer> 
              </TableGroup> 
              <TableGroup> 
                <Grouping Name="table17_Group2">  
                  <GroupExpressions> 
                    <GroupExpression>=Fields!ToolTypeID.Value</GroupExpression> 
                  </GroupExpressions> 
                </Grouping> 
                <Header> 
                  <TableRows> 
                    <TableRow> 
                      <TableCells> 
                        <TableCell> 
                          <ColSpan>3</ColSpan> 
                          <ReportItems> 
                            <Textbox Name="textbox239">  
                              <Style> 
                                <FontWeight>700</FontWeight> 
                                <TextAlign>Center</TextAlign> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value>=First(Fields!ToolType.Value)</Value> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                      </TableCells> 
                      <Height>0.25in</Height> 
                    </TableRow> 
                  </TableRows> 
                </Header> 
                <Footer> 
                  <TableRows> 
                    <TableRow> 
                      <TableCells> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox236">  
                              <rd:DefaultName>textbox236</rd:DefaultName> 
                              <Style> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value /> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox237">  
                              <rd:DefaultName>textbox237</rd:DefaultName> 
                              <Style> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value /> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox238">  
                              <rd:DefaultName>textbox238</rd:DefaultName> 
                              <Style> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value /> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                      </TableCells> 
                      <Height>0.25in</Height> 
                    </TableRow> 
                  </TableRows> 
                </Footer> 
              </TableGroup> 
              <TableGroup> 
                <Grouping Name="table17_Group3">  
                  <GroupExpressions> 
                    <GroupExpression>=Fields!PlanGridIssueID.Value</GroupExpression> 
                  </GroupExpressions> 
                </Grouping> 
                <Header> 
                  <TableRows> 
                    <TableRow> 
                      <TableCells> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox232">  
                              <Style> 
                                <BackgroundColor>#89d396</BackgroundColor> 
                                <BorderStyle> 
                                  <Default>Solid</Default> 
                                </BorderStyle> 
                                <FontWeight>700</FontWeight> 
                                <TextAlign>Center</TextAlign> 
                                <VerticalAlign>Middle</VerticalAlign> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value>Issue</Value> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox222">  
                              <Style> 
                                <BackgroundColor>#89d396</BackgroundColor> 
                                <BorderStyle> 
                                  <Default>Solid</Default> 
                                </BorderStyle> 
                                <FontWeight>700</FontWeight> 
                                <TextAlign>Center</TextAlign> 
                                <VerticalAlign>Middle</VerticalAlign> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value>Accomplishments</Value> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                        <TableCell> 
                          <ReportItems> 
                            <Textbox Name="textbox223">  
                              <Style> 
                                <BackgroundColor>#89d396</BackgroundColor> 
                                <BorderStyle> 
                                  <Default>Solid</Default> 
                                </BorderStyle> 
                                <FontWeight>700</FontWeight> 
                                <TextAlign>Center</TextAlign> 
                                <VerticalAlign>Middle</VerticalAlign> 
                                <PaddingLeft>2pt</PaddingLeft> 
                                <PaddingRight>2pt</PaddingRight> 
                                <PaddingTop>2pt</PaddingTop> 
                                <PaddingBottom>2pt</PaddingBottom> 
                              </Style> 
                              <CanGrow>true</CanGrow> 
                              <Value>Date Completed</Value> 
                            </Textbox> 
                          </ReportItems> 
                        </TableCell> 
                      </TableCells> 
                      <Height>0.25in</Height> 
                    </TableRow> 
                  </TableRows> 
                </Header> 
              </TableGroup> 
            </TableGroups> 
            <Details> 
              <TableRows> 
                <TableRow> 
                  <TableCells> 
                    <TableCell> 
                      <ReportItems> 
                        <Textbox Name="IdentifiedIssue">  
                          <rd:DefaultName>IdentifiedIssue</rd:DefaultName> 
                          <Style> 
                            <BorderStyle> 
                              <Default>Solid</Default> 
                            </BorderStyle> 
                            <PaddingLeft>2pt</PaddingLeft> 
                            <PaddingRight>2pt</PaddingRight> 
                            <PaddingTop>2pt</PaddingTop> 
                            <PaddingBottom>2pt</PaddingBottom> 
                          </Style> 
                          <CanGrow>true</CanGrow> 
                          <Value>=Fields!IdentifiedIssue.Value</Value> 
                        </Textbox> 
                      </ReportItems> 
                    </TableCell> 
                    <TableCell> 
                      <ReportItems> 
                        <Textbox Name="AccomplishmentNarrative_1">  
                          <rd:DefaultName>AccomplishmentNarrative_1</rd:DefaultName> 
                          <Style> 
                            <BorderStyle> 
                              <Default>Solid</Default> 
                            </BorderStyle> 
                            <PaddingLeft>2pt</PaddingLeft> 
                            <PaddingRight>2pt</PaddingRight> 
                            <PaddingTop>2pt</PaddingTop> 
                            <PaddingBottom>2pt</PaddingBottom> 
                          </Style> 
                          <CanGrow>true</CanGrow> 
                          <Value>=Fields!AccomplishmentNarrative.Value</Value> 
                        </Textbox> 
                      </ReportItems> 
                    </TableCell> 
                    <TableCell> 
                      <ReportItems> 
                        <Textbox Name="TargetDate_1">  
                          <rd:DefaultName>TargetDate_1</rd:DefaultName> 
                          <Style> 
                            <BorderStyle> 
                              <Default>Solid</Default> 
                            </BorderStyle> 
                            <PaddingLeft>2pt</PaddingLeft> 
                            <PaddingRight>2pt</PaddingRight> 
                            <PaddingTop>2pt</PaddingTop> 
                            <PaddingBottom>2pt</PaddingBottom> 
                          </Style> 
                          <CanGrow>true</CanGrow> 
                          <Value>=Format(Fields!TargetDate.Value,"Short Date")</Value> 
                        </Textbox> 
                      </ReportItems> 
                    </TableCell> 
                  </TableCells> 
                  <Height>0.25in</Height> 
                </TableRow> 
              </TableRows> 
            </Details> 
            <TableColumns> 
              <TableColumn> 
                <Width>2.675in</Width> 
              </TableColumn> 
              <TableColumn> 
                <Width>3.3in</Width> 
              </TableColumn> 
              <TableColumn> 
                <Width>1.15in</Width> 
              </TableColumn> 
            </TableColumns> 
            <Height>1.5in</Height> 
          </Table> 
        </ReportItems> 
        <Height>34.3in</Height> 
      </Body> 
      <Language>en-US</Language> 
      <PageFooter> 
        <PrintOnFirstPage>true</PrintOnFirstPage> 
        <ReportItems> 
          <Textbox Name="textbox226">  
            <rd:DefaultName>textbox226</rd:DefaultName> 
            <Width>1.15in</Width> 
            <Style> 
              <PaddingLeft>2pt</PaddingLeft> 
              <PaddingRight>2pt</PaddingRight> 
              <PaddingTop>2pt</PaddingTop> 
              <PaddingBottom>2pt</PaddingBottom> 
            </Style> 
            <CanGrow>true</CanGrow> 
            <Left>5.8in</Left> 
            <Value>="Page " &amp; Globals!PageNumber &amp; " of " &amp; Globals!TotalPages</Value> 
          </Textbox> 
        </ReportItems> 
        <Height>0.25in</Height> 
        <PrintOnLastPage>true</PrintOnLastPage> 
      </PageFooter> 
      <TopMargin>0.5in</TopMargin> 
    </Report> 
    Example Info, Report is actually much larger 30 in or so 
    Friday, February 20, 2009 2:43 AM
  • I have figured this out, after several wasted hours of Microsoft and our's time i ran across it earlier today.  Under the table properties (have to click the box above detail and group rows then right click the selection and select properties) there is a group tab which will list your normal groups you have. 

    There is also another button at bottom labeled "Details Grouping..." and if you add a group to this it will add an entry like this to thedetails section for your tables in the RDLC xml:

              <Grouping Name="table18_Details_Group">
                <GroupExpressions>
                  <GroupExpression>=Fields!IdentifiedIssue.Value</GroupExpression>
                </GroupExpressions>
              </Grouping>

    which will make keep together act correctly.  I have no idea why the regular group does not preform this function but I am sure there is a great reason.

     - Richard
    • Marked as answer by ASP.NET Lover Wednesday, March 25, 2009 11:38 PM
    Wednesday, March 25, 2009 11:38 PM
  • Hi,

    I have rdlc file which has 20 to 25 subreports which are dynmaically loaded using streams.  All the reports have tables along with details section and grouping is not in all the tables but very few sub reports.  I have set the property Keep Together on single page if possible. 

    When i export the data to PDF everything looks good but when it is exported to Word documents it does not behave the same way as in PDF/Reportviewer page.  if my deatils has 10 rows it is showing 5 rows in one page and 5 page in the next page instead it should take all the data to the next page, which is my requirement.

     

    And also i am trying to set visibility expression in page footer for disclaimer text to show on the last page, it works well on PDF/Report Viwere but not on word export from report viewer.

    Please let me know if there is any way to avoid extra blank spaces which are result of page break on the detail data.

    Any help on this is greatly appreciated.

    -Suman

    Thursday, August 25, 2011 2:09 PM
  • Did you ever get this resolved?
    Thursday, February 2, 2012 6:09 PM
  • I realize this is 6 years after the date of this post but I just wanted to say thank you. You provided the solution to my problem that I haven't been able to figure out until I came across this post.
    Tuesday, July 14, 2015 4:38 PM