RDLC: How to Print Multiple Tables in One Report

I am creating an RDLC XML Schema and displaying a report in a ReportViewer control. No problems.

Now I want a report with two tables with two differents datasets.
Something like this is generated:

<Body>
    <ReportItems>
            <Table Name="Table1">
            ....
            </Table>
            <Table Name="Table2">
            ....
            </Table>           
    </ReportItems>
</Body>

      

But when printing, both tables start at the top, printing one table on top of the other (not nice)

Is there a way to tell Table2 to start after Table1?

Update: I've tried with List

with a fake DataSource, but it doesn't work.

+2


a source to share


3 answers


I use a lot of reports with multiple tables, I just add the beginning of the second table exactly to the end of the second table, when rendered, they appear one after the other. Therefore, you need to customize the first table with:

<Table Name="table1">
<DataSetName>DataSets_ChiamateGroup</DataSetName>
<KeepTogether>true</KeepTogether>
<Top>36cm</Top>
<Height>3.00001cm</Height>

      

AND

<Table Name="table2">
<DataSetName>DataSets_ChiamateGroup</DataSetName>
<KeepTogether>true</KeepTogether>
<Top>39cm</Top>
<Height>5.00000cm</Height>

      



Note that Table1.Top + Table1.Height = Table2.Top

Here is an example of two table layouts (with additional diagrams on top)

create two report designers

Hope it helps!

+2


a source


The tables should be displayed one after the other. There must be something else in your RDLC. Are you generating RDLC yourself? Have you tried creating a dummy report with a report designer dropping two tables in it and examining the RDLC it generates? Multiple tables in one report are extremely common.

Also try setting their elements Top

:



        <Table Name="Table1">
            <Top>1in</Top>
        </Table>
        <Table Name="Table2">
            <Top>5in</Top>
        </Table> 

      

+1


a source


OMG! It was as easy as adding ZIndex=2

to a second table.

It ZIndex

doesn't even matter, it all matters for setting the fake magic Top

.

<Body>
    <ReportItems>
            <Table Name="Table1">
                 <Top>1cm</Top> 
                 ....
            </Table>
            <Table Name="Table2">
                 <Top>2.25cm</Top> <!-- more than table1 Top + Height -->
                 ....
            </Table>           
    </ReportItems>
</Body>

      

Not sure if the order in XML is important and setting different Top

s

The order in XML is not important, but Top. You have to set Table1's top top vertex top + height (whatever height it actually has in the designer)

0


a source







All Articles