views:

1539

answers:

1

Here is the issue:

We have a report with many gridviews in an aspx page. However, when we print them, they don't page correctly, as one would expect.

I found a library that will create page breaks correctly within a single page break. But, yet again, it is not aware about other gridviews, so if the last gridview ended in the middle of the page, the first page for the next gridview will be broken.

How can we print these multiple gridviews with proper print paging?

The library that I found: http://www.codeproject.com/KB/custom-controls/GridViewPrinting.aspx

+1  A: 

If you want each GridView to print on a new page, you could wrap each GridView in a div and set the "page-break-after" css property to "always" for each div. So, it might look like:

<div style="page-break-after:always;">
    <asp:GridView ID="GridView1" runat="server">
    ...
    </asp:GridView>
</div>

Omit the "page-break-after" property on the last GridView so you don't print an extra page.

Austin