This is a migrated thread and some comments may be shown as answers.

Report Header and Detail Section does not print together

3 Answers 286 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 15 May 2020, 05:14 AM

I want to print Detail Section in the first page, but it could not, all components's keep together are setted false, but it's no effort, 

And the Catogary Name does not print on every Page.

My demo code is bellow:

<?xml version="1.0" encoding="utf-8"?>
<Report Width="18.1cm" Name="Report1" xmlns="http://schemas.telerik.com/reporting/2020/1.0">
  <DataSources>
    <JsonDataSource Name="jsonDataSource1">
      <Source>
        <String>Ww0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiAxfSwNCnsiTmFtZSI6IlRFU1QiLCAiQW1vdW50IjogMn0sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDN9LA0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiA0fSwNCnsiTmFtZSI6IlRFU1QiLCAiQW1vdW50IjogNX0sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDZ9LA0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiA3fSwNCnsiTmFtZSI6IlRFU1QiLCAiQW1vdW50IjogOH0sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDl9LA0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiAxMH0sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDExfSwNCnsiTmFtZSI6IlRFU1QiLCAiQW1vdW50IjogMTJ9LA0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiAxM30sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDE0fSwNCnsiTmFtZSI6IlRFU1QiLCAiQW1vdW50IjogMTV9LA0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiAxNn0sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDE3fSwNCnsiTmFtZSI6IlRFU1QiLCAiQW1vdW50IjogMTh9LA0KeyJOYW1lIjoiVEVTVCIsICJBbW91bnQiOiAxOX0sDQp7Ik5hbWUiOiJURVNUIiwgIkFtb3VudCI6IDIwfQ0KXQ==</String>
      </Source>
    </JsonDataSource>
  </DataSources>
  <Items>
    <DetailSection KeepTogether="False" Height="1.217cm" Name="detailSection1">
      <Items>
        <List Width="17.905cm" Height="1.217cm" Left="0cm" Top="0cm" KeepTogether="False" Name="list1">
          <Body>
            <Cells>
              <TableCell RowIndex="0" ColumnIndex="1" RowSpan="1" ColumnSpan="1">
                <ReportItem>
                  <Panel Width="16.2cm" Height="1.217cm" Left="0cm" Top="0cm" KeepTogether="False" Name="panel1">
                    <Items>
                      <Table DataSourceName="jsonDataSource1" Width="16.2cm" Height="1.217cm" Left="0cm" Top="0cm" KeepTogether="False" Name="table1">
                        <Body>
                          <Cells>
                            <TableCell RowIndex="0" ColumnIndex="2" RowSpan="1" ColumnSpan="1">
                              <ReportItem>
                                <TextBox Width="5.4cm" Height="0.608cm" Left="0cm" Top="0cm" Name="textBox6">
                                  <Style>
                                    <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                                    <BorderColor Top="Black" Bottom="Black" Left="Black" Right="Black" />
                                    <BorderWidth Top="1pt" Bottom="1pt" Left="1pt" Right="1pt" />
                                  </Style>
                                </TextBox>
                              </ReportItem>
                            </TableCell>
                            <TableCell RowIndex="0" ColumnIndex="0" RowSpan="1" ColumnSpan="1">
                              <ReportItem>
                                <TextBox Width="5.4cm" Height="0.608cm" Left="8.095cm" Top="0.6cm" Value="= Fields.Name" Name="textBox8" StyleName="">
                                  <Style>
                                    <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                                  </Style>
                                </TextBox>
                              </ReportItem>
                            </TableCell>
                            <TableCell RowIndex="0" ColumnIndex="1" RowSpan="1" ColumnSpan="1">
                              <ReportItem>
                                <TextBox Width="5.4cm" Height="0.608cm" Left="8.095cm" Top="0.6cm" Value="= Fields.Amount" Name="textBox2" StyleName="">
                                  <Style>
                                    <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                                  </Style>
                                </TextBox>
                              </ReportItem>
                            </TableCell>
                          </Cells>
                          <Columns>
                            <Column Width="5.4cm" />
                            <Column Width="5.4cm" />
                            <Column Width="5.4cm" />
                          </Columns>
                          <Rows>
                            <Row Height="0.608cm" />
                          </Rows>
                        </Body>
                        <Corner />
                        <Style Visible="True">
                          <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                          <BorderColor Top="Black" Bottom="Black" Left="Black" Right="Black" />
                          <BorderWidth Top="1pt" Bottom="1pt" Left="1pt" Right="1pt" />
                        </Style>
                        <RowGroups>
                          <TableGroup Name="detailTableGroup">
                            <Groupings>
                              <Grouping />
                            </Groupings>
                          </TableGroup>
                        </RowGroups>
                        <ColumnGroups>
                          <TableGroup Name="tableGroup">
                            <ReportItem>
                              <TextBox Width="5.4cm" Height="0.609cm" Left="0cm" Top="0cm" Value="Name" Name="textBox1">
                                <Style>
                                  <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                                  <BorderColor Top="Black" Bottom="Black" Left="Black" Right="Black" />
                                  <BorderWidth Top="1pt" Bottom="1pt" Left="1pt" Right="1pt" />
                                </Style>
                              </TextBox>
                            </ReportItem>
                          </TableGroup>
                          <TableGroup Name="tableGroup1">
                            <ReportItem>
                              <TextBox Width="5.4cm" Height="0.609cm" Left="0cm" Top="0cm" Value="Amount" Name="textBox3">
                                <Style>
                                  <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                                  <BorderColor Top="Black" Bottom="Black" Left="Black" Right="Black" />
                                  <BorderWidth Top="1pt" Bottom="1pt" Left="1pt" Right="1pt" />
                                </Style>
                              </TextBox>
                            </ReportItem>
                          </TableGroup>
                          <TableGroup Name="tableGroup2">
                            <ReportItem>
                              <TextBox Width="5.4cm" Height="0.609cm" Left="0cm" Top="0cm" Name="textBox5">
                                <Style>
                                  <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
                                  <BorderColor Top="Black" Bottom="Black" Left="Black" Right="Black" />
                                  <BorderWidth Top="1pt" Bottom="1pt" Left="1pt" Right="1pt" />
                                </Style>
                              </TextBox>
                            </ReportItem>
                          </TableGroup>
                        </ColumnGroups>
                      </Table>
                    </Items>
                  </Panel>
                </ReportItem>
              </TableCell>
              <TableCell RowIndex="0" ColumnIndex="0" RowSpan="1" ColumnSpan="1">
                <ReportItem>
                  <TextBox Width="1.705cm" Height="1.217cm" Left="0cm" Top="0cm" KeepTogether="False" Value="Catogary Name" Name="textBox7" StyleName="">
                    <Style TextAlign="Center" VerticalAlign="Middle" />
                  </TextBox>
                </ReportItem>
              </TableCell>
            </Cells>
            <Columns>
              <Column Width="1.705cm" />
              <Column Width="16.2cm" />
            </Columns>
            <Rows>
              <Row Height="1.217cm" />
            </Rows>
          </Body>
          <Corner />
          <Style>
            <BorderStyle Top="Solid" Bottom="Solid" Left="Solid" Right="Solid" />
            <BorderColor Top="Black" Bottom="Black" Left="Black" Right="Black" />
            <BorderWidth Top="1pt" Bottom="1pt" Left="1pt" Right="1pt" />
          </Style>
          <RowGroups>
            <TableGroup Name="DetailGroup">
              <Groupings>
                <Grouping />
              </Groupings>
            </TableGroup>
          </RowGroups>
          <ColumnGroups>
            <TableGroup Name="group" />
            <TableGroup Name="ColumnGroup" />
          </ColumnGroups>
        </List>
      </Items>
    </DetailSection>
    <ReportHeaderSection KeepTogether="False" Height="0.5cm" Name="reportHeaderSection1">
      <Items>
        <TextBox Width="3cm" Height="0.5cm" Left="7.7cm" Top="0cm" Value="TEST" Name="textBox14" />
      </Items>
    </ReportHeaderSection>
  </Items>
  <PageSettings PaperKind="Custom" PaperSize="210mm, 60mm" Landscape="False" ContinuousPaper="False">
    <Margins>
      <MarginsU Left="1cm" Right="1cm" Top="1cm" Bottom="1cm" />
    </Margins>
  </PageSettings>
  <StyleSheet>
    <StyleRule>
      <Style>
        <Padding Left="2pt" Right="2pt" />
      </Style>
      <Selectors>
        <TypeSelector Type="TextItemBase" />
        <TypeSelector Type="HtmlTextBox" />
      </Selectors>
    </StyleRule>
  </StyleSheet>
</Report>

3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 19 May 2020, 01:54 PM

Hello Anders,

Thank you for the report definition. I confirm that although there are no PageBreaks or GroupPageBreaks and all KeepTogether properties are False, the Detail section starts from the second page. I did some more tests and found out that when the PaperSize Height is 89mm or more, the Detail section starts rendering from the first page. Up to 88mm height, the Detail section starts from the second page.

We consider the above behavior as a bug and I have logged it on your behalf in our public feedback portal so that other users can vote for it - Report Header and Detail Section do not print together. We have updated your Telerik points as a token of gratitude.

I noticed that between 88mm and 89mm height the 'Catogary Name' is split differently between the pages. To experiment further, I set its Style-VerticalAlign to the default Top. Interestingly, this fixed the issue and the Detail started rendering from the first page with the original Paper Height of 60mm.

The issue most probably comes from textBox7 'Catogary Name' that needs to be split among all the pages and when its content is vertically centered, there is ambiguity on which page the content will fall as the exact position of the text in the final document depends on the page height.

I suggest another approach that would solve this problem. You may use a Crosstab with an additional static parent row group, in which row header to display 'Catogary Name'. This way the table will start from the first page even when the row header is vertically centered.

My understanding is that you would like the content 'Catogary Name' to be displayed on every page. This is not possible unless the report item that contains this text is rendered on each page. You can achieve this by adding such a row group that would be rendered on a single page. For example, if it is known that on each page there will be 6 records, you may group by the number of the current record divided by 6. You need to introduce an index field in the data source that gives the current record number. Note that the aggregate and data functions cannot be utilized in the Grouping expressions.

I have attached a sample report demonstrating the approach with the Crosstab and the Grouping - on the right, and the original List on the left. As an index field, I used Fields.Amount.

Regards,
Todor
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
PASCAL
Top achievements
Rank 1
answered on 18 Sep 2020, 03:43 PM
Has it been solved? As i still have the same issue 
0
Todor
Telerik team
answered on 23 Sep 2020, 02:43 PM

Hi PASCAL,

You have already voted for the bug report, so you will be automatically notified when the status of the work item changes. The current status is still 'unplanned'.

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Report Designer (standalone)
Asked by
Anders
Top achievements
Rank 1
Answers by
Todor
Telerik team
PASCAL
Top achievements
Rank 1
Share this question
or