Click here to Skip to main content
15,921,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datalist which has RepeatDirection="Horizontal", RepeatLayout="Table" and RepeatColumns="2" set and i need to print it.I want to print eight items per page. But the problem is i m not able to set the size.some lines of 7th and 8th datalist item exceeds and prints on next page .i want to set this so that i can print all eight items on one single page.

i tried the following..
div.Section1 {
page: Section1;
}
CSS
.boxdiv {
            padding: 3mm 3mm;
            width: 107mm;
            height: 74mm;
            border: 0px solid #333;
        }


XML
<asp:DataList ID="datalis1" runat="server"  RepeatDirection="Horizontal" RepeatColumns="2"
                              BorderStyle="NotSet" CellPadding="0"   CellSpacing="5" RepeatLayout="Table">
                          <ItemStyle />
                       <ItemTemplate
<asp:Panel ID="Panel1" runat="server" CssClass="boxdiv">>
XML
<table style="width: 94%;"  align="center" cellspacing="0" cellpadding="0" border="0" class="table1">
                              <tr style="height:2px;">
                                  <td  colspan="0" rowspan="0" height='2px'>
                                   <asp:Label ID="lblwebsite"  runat="server" Font-Bold="True" Text='<% # bind("website")%>'>
                                   </asp:Label>
                                  </td>
                              </tr
XML
<tr style="height:2px;"    >
                                   <td colspan="0" rowspan="0" height='2px'>
                                       <asp:Label ID="Label13" runat="server" Font-Bold="True" Text="Call #">
                                       </asp:Label>
                                       <asp:Label ID="lblcontact" runat="server" Text='<% # bind("mobile1")%>'>
                                       </asp:Label> &nbsp; &nbsp;
                                       <asp:Label ID="Label15" runat="server" Font-Bold="True" Text="Fax #">
                                       </asp:Label>
                                       <asp:Label ID="lblfax" runat="server" Text='<% # bind("fax")%>'>
                                       </asp:Label>
                                    </td>
                               </tr
>>
XML
<tr style="height:2px;">
                                   <td colspan="0" rowspan="0" height='2px' >
                                       <%--<asp:Label ID="lblfax0" runat="server" Font-Bold="True" Text="Address :">
                                       </asp:Label>--%>
                                       <asp:Label ID="lbladdress" runat="server"    Text='<% # bind("address")%>'   ></asp:Label>
                                   </td>
                               </tr>
                             <tr style="height:4px;">
                             </tr>
                             <tr style="height:4px;">
                             </tr>
                             <tr style="height:2px;">
                                 <td  height='2px'  >
                                       <asp:Label ID="lblfax1" runat="server" Font-Bold="True" Text="Ord #">
                                       </asp:Label>
                                       <asp:Label ID="lblorder" runat="server" text='<% # bind("orderno")%>'>
                                       </asp:Label> &nbsp; &nbsp;
                                       <asp:Label ID="lblfax2" runat="server" Font-Bold="True" Text="Dt:">
                                       </asp:Label>
                                       <asp:Label ID="lblvrdate" runat="server" Text='<% # bind("vr_date")%>'>
                                       </asp:Label>
                                   </td
XML
</tr>
                                <tr >
                                  <td   height='2px' >
                                     <asp:Label ID="lblfax3" runat="server" Font-Bold="True" Text="Pt:">
                                     </asp:Label>
                                     <asp:Label ID="lblpt" runat="server"  Text='<% # bind("pname")%>'   Font-Bold="False" >
                                     </asp:Label> &nbsp; &nbsp;
                                     <asp:Label ID="Label16" runat="server" Font-Bold="True" Text="Dr :">
                                     </asp:Label>
                                     <asp:Label ID="lbldrname"  Text='<% # bind("drname")%>'  runat="server" Font-Bold="False"  >
                                     </asp:Label>
                                  </td>
                               </tr
>>
XML
<tr style="height:4px;"   >
                              </tr>
                               <tr style="height:4px;"   >
                              </tr>
                                <tr   >
                                    <td   height='2px'>
                                        <asp:Label ID="Label17" runat="server" Font-Bold="True"
                                            Text="Rx:"></asp:Label>
                                        <asp:Label ID="lblorderSupplied" runat="server" Font-Bold="False" Text='<% # bind("medicine")%>'
                                            ></asp:Label> <br />
                                             <asp:Label ID="labeld" runat="server" Text="Qty:" Font-Bold="True"></asp:Label>
                                         <asp:Label ID="lblpack"  Text='<% # bind("pack")%>' runat="server"  ></asp:Label>
                                                <asp:Label ID="txtmfgDt" runat="server"  text="x"> </asp:Label>
                                        <asp:Label ID="lblqty" runat="server" text='<% # bind("suppquantity")%>'></asp:Label>
                                    </td>
                                </tr
>
XML
<tr style="height:4px;"   >
                             </tr>
                              <tr style="height:4px;"   >
                             </tr>
                               <tr  >
                                   <td  height='2px'>
                                      <%-- <asp:Label ID="Label18" runat="server" Font-Bold="True"
                                           Text="Directions:"></asp:Label>--%>
                                           <%--  <div style="text-overflow : ellipsis; overflow: hidden; overflow-y: hidden; height:38px">--%>
                                            <asp:Label ID="lbldirections" Height="38PX"   Text='<% # bind("directions")%>' runat="server" Font-Bold="False"></asp:Label>
                                         <%--   </div>--%>
                                   </td>
                               </tr>
                               <tr
XML
<td  height='2px'>
                                   <%--  <asp:Label ID="lblmfg" runat="server" text="Mfg:"></asp:Label>--%>
                                   </td>
                               </tr>
                           </table>
                      </asp:Panel>
                    </ItemTemplate>
>
Posted
Updated 2-Jan-14 20:07pm
v5

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