GridView和Repeater打印手动分页

 1 <asp:Repeater ID="DataListTolData" runat="server">
 2           <HeaderTemplate>
 3             <table name="mitab" border="1" align="center" style="border-collapse:collapse;width:98%;word-break: break-all;">
 4             <tr class="Toptr_bg">
 5             <td align="center" style="width:8%;"><b>测点编号</b></td>
 6             <td align="center" style="width:12%;"><b>桩号-管号</b></td>
 7             <td align="center" style="width:20%;"><b>监测日期</b></td>
 8             <td align="center" style="width:10%;"><b>频率(HZ)</b></td>
 9             <td align="center" style="width:10%;"><b>水位(m)</b></td>
10             <td align="center" style="width:10%;"><b>电压(V)</b></td>
11             <td align="center" style="width:10%;"><b>温度(°C)</b></td>
12             <td align="center" style="width:10%;"><b>管内水位(m)</b></td>
13             <td align="center" style="width:10%;"><b>雨量(mm)</b></td>           
14             </tr>
15         </HeaderTemplate>
16           <ItemTemplate>
17             <tr class="TR_BG">
18             <td align="center" style="width:8%;"><%#Eval("item").ToString().Trim()%></td>
19             <td align="center" style="width:12%;"><%#Eval("PegCode").ToString().Trim() + "(" + Eval("PipeCode").ToString().Trim() + ")"%></td>
20             <td align="center" style="width:20%;"><%#Eval("rectime", "{0:yyyy-MM-dd}")%></td>
21             <td align="center" style="width:10%;"><%#Eval("F").ToString().Trim()%></td>
22             <td align="center" style="width:10%;"><%#Eval("Water").ToString().Trim()%></td>
23             <td align="center" style="width:10%;"><%#Eval("Voltage").ToString().Trim()%></td>
24             <td align="center" style="width:10%;"><%#Eval("T").ToString().Trim()%></td>
25             <td align="center" style="width:10%;"><%#float.Parse(Eval("P").ToString().Trim())*1.19%></td>
26             <td align="center" style="width:10%;"><%#Eval("Rain").ToString().Trim()%></td>
27             </tr>     
28              <% 
29                  if (tab_count == 33)
30                  {
31                      if (tab_count % 33 == 0)
32                      {
33                        %>
34                             </table><br /><br /><table name="mitab" border="1" align="center" style="border-collapse:collapse;width:98%;word-break: break-all;"> 
35                       <%    
36                      }
37                 }
38                  else
39                  {
40                      if (tab_count > 35)
41                      {
42                          if ((tab_count - 33) % 35 == 0)
43                          {
44                            %>
45                                 </table><br /><br /><table name="mitab" border="1" align="center" style="border-collapse:collapse;width:98%;word-break: break-all;"> 
46                            <%    
47                         }
48                     }
49                 }
50                 tab_count++; 
51              %> 
52          </ItemTemplate>
53           <FooterTemplate>
54           </table>
55          </FooterTemplate>
56         </asp:Repeater>

 

posted @ 2012-05-10 11:16  一篮饭特稀  阅读(249)  评论(0编辑  收藏  举报