Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
How can i implement a page break in a Data List after showing four items. Below is my code where i have binded the DataList with a DataTable.

<asp:DataList ID="DataList1" runat="server"  BackColor="White"
            BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3"
            GridLines="Horizontal" Width="90%">
            <AlternatingItemStyle BackColor="#F7F7F7" />
            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />

            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />

            <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
            <ItemTemplate>
                <table width="100%" height="240px">
                    <tr>
                        <td>
                            <asp:Label ID="lblTestID" runat="server" Text='<%# Eval("Name") %>' Font-Size="32"></asp:Label>
                        </td>
                        <td align="right">
                          <asp:Image ID="Image1" runat="server" src= '<%# Eval("PhotoPath") %>' Height="180" Width="150"  />
                        </td>
                    </tr>
                </table>

            </ItemTemplate>
            <SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
        </asp:DataList>

My actual problem is i have to do bulk printing. Currently when i do, i get half data in one page and half in other page. I thought if page-break is the solution to my problem
Posted
Comments
VishwaKL 6-Dec-12 5:51am    
are you binding data list to pdf/world or directly printing ?
[no name] 11-Dec-12 16:00pm    
printing datalist directly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900