Hello,
I have created a Wep Application Pick List for the company I work for. The page looks great on the web, but when we go to print the document, the gridview rows are getting split and it looks generally bad. This is not acceptable behavior for this page, so Ineed to be able to page-break the document after so many rows.
Gridview1 1 row
Gridview2 1 row
Gridview3 1-100 rows
per record, this document could have 10 to 20 rows of the first two gridviews and a minimum of 1 and a top end of unknown size. I am thinking I need a page-break on the first page after four or five rows. while the second page may be able to contain more.
I can include code and screenshots whatever you think would be helpful.
This problem is very similar to a forum written by Mudassar Ahmed Khan located here though I am not using a button off my page to print, just the File: Print at the top of any web page:
http://www.aspsnippets.com/Articles/Print-ASPNet-GridView-with-page-breaks-and-repeat-header-on-each-page.aspx
<asp:GridView ID="PickListGV" runat="server" AutoGenerateColumns="false" AlternatingRowStyle-BackColor="#FFFFFF"
HeaderStyle-Height="25px" OnRowDataBound="PickListGV_OnRowDataBound" DataKeyNames="PDH_OUR_PART" CssClass="PL_GV">
<Columns>
<asp:BoundField DataField="PDH_OUR_PART" HeaderText="Part Number">
<ItemStyle Width="15%" />
</asp:BoundField>
<%--<asp:TemplateField HeaderText="Part Number">
<ItemTemplate>
<%#Eval("PDH_OUR_PART")%></ItemTemplate>
<ItemStyle VerticalAlign="Top" />
</asp:TemplateField>--%>
<asp:TemplateField>
<HeaderTemplate>
Part Information</HeaderTemplate>
<ItemTemplate>
<asp:GridView ID="PartInfoGV" runat="server" AutoGenerateColumns="false" DataKeyNames="ItemCodeDesc, PDH_CUST_PART, PDD_UOFM, PDD_ORIG_QTY, PDD_SHIP_QTY, PDD_DOCK"
AlternatingRowStyle-BackColor="#FFFFFF" CssClass="PI_GV">
<Columns>
<asp:BoundField DataField="ItemCodeDesc" HeaderText="Description">
<ItemStyle Width="35%" />
</asp:BoundField>
<asp:BoundField DataField="PDH_CUST_PART" HeaderText="TP Part">
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="PDD_UOFM" HeaderText="UM">
<ItemStyle Width="9%" />
</asp:BoundField>
<asp:BoundField DataField="PDD_ORIG_QTY" HeaderText="Req Qty">
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="PDD_SHIP_QTY" HeaderText="Net Qty">
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="PDD_DOCK" HeaderText="Dock">
<ItemStyle Width="8%" />
</asp:BoundField>
</Columns>
</asp:GridView>
<asp:GridView ID="MasterSerialGV" runat="server" OnRowDataBound="MasterSerialGV_OnRowDataBound" AutoGenerateColumns="false" DataKeyNames="MasterSerial, HRN" AlternatingRowStyle-BackColor="#FFFFFF" CssClass="MS_GV" >
<Columns>
<%--<asp:BoundField DataField="MasterSerial" HeaderText="Master Serial Number" ItemStyle-CssClass="Serial">
<ItemStyle CssClass="Serial" />
</asp:BoundField>
<asp:BoundField DataField="HRN" HeaderText="" />--%>
<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="Barcode" runat="server" CssClass="Serial"></asp:Label>
<br />
<asp:Label ID="HRN" runat="server"></asp:Label>
</ItemTemplate>
<ItemStyle CssClass="lbl2" />
</asp:TemplateField>
<asp:TemplateField HeaderText=" Pull ">
<ItemTemplate></ItemTemplate>
<ItemStyle VerticalAlign="Top" Width="10.1%" />
</asp:TemplateField>
</Columns>
</asp:GridView>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>