首页 新闻 会员 周边 捐助

链式打印机预览正常,但打印出来不正常

0
悬赏园豆:100 [已关闭问题] 关闭于 2016-01-04 08:02

现在预览的效果是治疗费有6条数据:

 

但是打印出来的,就成了三条(大勾的是)

 

原因可能是 因为换行导致的。但是程序中并没有设置换行,分页等。后台没有涉及到打印。

前台代码:

  1 <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="ZhuYuanQingDanXinNongHePrintZZ.aspx.cs" Inherits="modules_JingJi_ZhuYuan_FeiYong_ZhuYuanQingDanPrint" %>
  2 
  3 <html xmlns="http://www.w3.org/1999/xhtml" >
  4 <head id="Head1" runat="server">
  5     <title>费用清单打印</title>
  6 
  7     <script src="../../../../javascript/pubfunpro.js" type="text/javascript"></script>
  8     
  9 </head>
 10 <style type="text/css">
 11     .rightborder
 12     {
 13        border-right:1px solid black;
 14        border-bottom:1px solid white;
 15     }
 16     .tdfontsize
 17     {
 18         font-size:<%=tdfontsize %>;
 19     }
 20     .hejifontsize
 21     {
 22         font-size:<%=hejifontsize %>;
 23     }
 24     .headfontsize
 25     {
 26         font-size:<%=headfontsize %>;
 27     }
 28     </style>
 29 <body style="background-color:White" onload="PageSetup_Null(0,0,0,0);">
 30     <form id="form1" runat="server">
 31     <OBJECT  id="WebBrowser"  classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"  height="0"  width="0">
 32             </OBJECT>
 33     <table class="notDisplay" id="tableDaYin2" runat="server" visible="false" width="100%">
 34         <tr>
 35             <td align="center">
 36                 <input id="Button5" type="button" value="打印"  class="input_submit"
 37                     onclick="document.all.WebBrowser.ExecWB(6,1)" />&nbsp;
 38                 <input id="Button6" type="button" value="直接打印"  class="input_submit"
 39                     onclick="document.all.WebBrowser.ExecWB(6,6)" />
 40                 <input id="Button7" type="button" value="打印设置"  class="input_submit"
 41                     onclick="document.all.WebBrowser.ExecWB(8,1)" />&nbsp;
 42                 <input id="Button8" type="button" value="打印浏览"  class="input_submit"
 43                     onclick="document.all.WebBrowser.ExecWB(7,1)" />      
 44             </td>
 45         </tr>
 46     </table>
 47     <div align="left" >
 48     <asp:DataList ID="dlShowData" runat="server"  Width="100%" OnItemDataBound="dlShowData_ItemDataBound" DataKeyField="danganid"   EnableViewState="false">
 49             <HeaderStyle  Font-Size ="X-Small" Height ="20pt"  />
 50             <ItemTemplate >
 51             <div align="left">
 52             <table id="tblHead" style="width:75mm;" runat ="server" >
 53                 <tr>
 54                     <td class="hejifontsize" align="center">
 55                         <%= PageTitle%>
 56                     </td>
 57                 </tr>
 58               <tr> 
 59               <td style="text-align: left;" class="headfontsize">
 60                   &nbsp;住院号:<%# DataBinder.Eval(Container, "DataItem.ZhuYuanHao")%>
 61                   &nbsp;姓名:<%# DataBinder.Eval(Container, "DataItem.XingMing")%>
 62                   &nbsp;&nbsp;性别:<%# DataBinder.Eval(Container, "DataItem.XingBie")%>
 63             </tr>      
 64             <tr >
 65             <td  align="center"> 
 66               <div id="div1">
 67                 <asp:Repeater ID="rptRiQingDan1" runat="server">
 68                     <HeaderTemplate>
 69                         <table width="100%" cellpadding="2" cellspacing="0" style="border-bottom:2px black solid;border-top:2px black solid;" class="hejifontsize">
 70                             <tr align="center">
 71                                 <td style="border-bottom:2px black solid;">项目
 72                                 </td>
 73                                 <td style="border-bottom:2px black solid;">金额
 74                                 </td>
 75                                 <td style="border-bottom:2px black solid;">项目
 76                                 </td>
 77                                 <td style="border-bottom:2px black solid;">金额
 78                                 </td>
 79                                  <td style="border-bottom:2px black solid;">项目
 80                                 </td>
 81                                 <td style="border-bottom:2px black solid;">金额
 82                                 </td>                              
 83                             </tr>
 84                     </HeaderTemplate>
 85                     <ItemTemplate>
 86                         <tr >
 87                             <td class="tdfontsize">
 88                                 &nbsp;<%# DataBinder.Eval(Container, "DataItem.ShouJuFenLei1")%>
 89                             </td>
 90                             <td class="tdfontsize">
 91                                 <%# DataBinder.Eval(Container, "DataItem.JinE1")%>
 92                             </td>
 93                             <td class="tdfontsize" nowrap>
 94                                 <%# DataBinder.Eval(Container, "DataItem.ShouJuFenLei2")%>
 95                             </td>
 96                             <td align="right" class="tdfontsize">
 97                                 <%# DataBinder.Eval(Container, "DataItem.JinE2")%>
 98                             </td>
 99                             <td align="right" class="tdfontsize">
100                                 <%# DataBinder.Eval(Container, "DataItem.ShouJuFenLei3")%>
101                             </td>
102                             <td align="right" class="tdfontsize">
103                                 <%# DataBinder.Eval(Container, "DataItem.JinE3")%>
104                             </td>                          
105                         </tr>
106               </ItemTemplate>
107                     <FooterTemplate>
108                         </table>
109                     </FooterTemplate>
110                 </asp:Repeater></div>
111                 <div id="div2" runat="server">
112                 <table width="100%" cellpadding="2" cellspacing="0" style="border-bottom:2px black solid;border-top:2px black solid;" class="hejifontsize">
113                             <tr align="center">
114                                 <td style="border-bottom:2px black solid;"><%=XiangMuBianMa%>
115                                 </td>
116                                 <td style="border-bottom:2px black solid;">项目名称规格
117                                 </td>
118                                 <td style="border-bottom:2px black solid;">数量
119                                 </td>
120                                 <td style="border-bottom:2px black solid;">单价
121                                 </td>
122                                 <td style="border-bottom:2px black solid;">金额<%--<%=YingShouJinE%>--%>
123                                 </td>
124                                 <td style="border-bottom:2px black solid;">
125                                 <asp:Label ID="lblYbzfbl" runat="server"></asp:Label>
126                                 </td>
127                             </tr>
128                 <asp:Repeater ID="rptRiQingDan" runat="server">
129                     <ItemTemplate>
130                         <tr>
131                             <td class="tdfontsize">
132                                 &nbsp;<%# DataBinder.Eval(Container, "DataItem.xiangmubianma")%>
133                             </td>
134                             <td class="tdfontsize">
135                                 <%# DataBinder.Eval(Container, "DataItem.mingcheng")%>
136                             </td>
137                             <td class="tdfontsize" nowrap>
138                                 <%# DataBinder.Eval(Container, "DataItem.shuliang")%><%# DataBinder.Eval(Container, "DataItem.danwei")%>
139                             </td>
140                             <td align="right" class="tdfontsize" nowrap>
141                                 <%# DataBinder.Eval(Container, "DataItem.danjia")%>
142                             </td>
143                             <td align="right" class="tdfontsize" nowrap>
144                                 <%# DataBinder.Eval(Container, "DataItem.feiyong")%>&nbsp;
145                             </td>
146                            
147                            <td align="right" class="tdfontsize" >
148                                 <%# DataBinder.Eval(Container, "DataItem.shoufeidengji")%>&nbsp;
149                             </td>
150                         </tr>
151                         <tr>
152                             <td colspan="10" class="hejifontsize" style=" font-family:楷体_GB2312; font-weight:bold" align="right">
153                                  <%# DataBinder.Eval(Container, "DataItem.xiaoheji")%>
154                             </td>
155                         </tr>
156                     </ItemTemplate>
157                 </asp:Repeater>
158                 </table>
159                 </div>
160             </td>
161             </tr>
162             <tr>
163             <td align ="right" >
164                 <span style=" font-family:楷体_GB2312; font-weight:bold" class="hejifontsize">
165                 <asp:Label ID="lblJinEHeJi" runat ="server" ></asp:Label> &nbsp; 
166                 </span></td>
167             </tr>
168             
169             <tr runat="server" id="trIsRow">
170                 <td align ="left" class="tdfontsize" >
171                     <table >
172                         <tr >
173                             <td class="tdfontsize">
174                             截止:<asp:Label ID="lblJieZhiShiJian" runat ="server" ></asp:Label>
175                             </td>
176                             <td class="tdfontsize">
177                             押金累计:<asp:Label ID="lblYuShou" runat ="server" ></asp:Label>
178                             </td>
179                         </tr>
180                         <tr>
181                             <td class="tdfontsize">
182                             费用累计:<asp:Label ID="lblLeiJi" runat ="server" ></asp:Label>
183                             </td>
184                             <td class="tdfontsize">
185                             余额:<asp:Label ID="lblYuE" runat ="server" ></asp:Label>
186                             </td>
187                         </tr>
188                         <tr>
189                             <td colspan="2" class="tdfontsize">
190                             请补交押金:
191                             <asp:Label ID="lblBuJiaoYaJin" runat ="server" Width="60px" ></asp:Label>192                             </td>
193                         </tr>
194                         <tr>
195                             <td colspan="2" class="tdfontsize">
196                             注:此单据仅供参考,不作其他凭证,费用如有误,以出院结算为准。 
197                             </td>
198                         </tr>
199                     </table>
200                 </td>
201             </tr>
202           
203             <tr>
204             <td align ="right" >
205                 <span class="tdfontsize">
206                打印日期:<asp:Label ID="lblDaYinRiQi" runat ="server" ></asp:Label> 
207                 </span></td>
208             </tr>
209             <tr>
210              <td style="text-align: left;width:100%;" class="tdfontsize"><br /><span style='font-family:Wingdings; font-size:10pt;'>#</span>┉┉┉┉ 裁 ┉┉┉┉ 剪 ┉┉┉┉ 线 ┉┉┉┉
211              <div style="page-break-after:always"></div>  
212              </td>
213             </tr>
214             
215             
216             </table>
217             </div>
218             </ItemTemplate>
219             </asp:DataList>
220             <asp:Label ID="lblMessage" Font-Size="Large" Text="无发生费用" Visible="false" runat="server"></asp:Label>            
221             <table class="notDisplay" id="tableDaYin" runat="server" visible="false" width="100%">
222                 <tr>
223                     <td align="center">
224                         <input id="Button1" type="button" value="打印"  class="input_submit"
225                             onclick="document.all.WebBrowser.ExecWB(6,1)" />&nbsp;
226                         <input id="Button2" type="button" value="直接打印"  class="input_submit"
227                             onclick="document.all.WebBrowser.ExecWB(6,6)" />
228                         <input id="Button4" type="button" value="打印设置"  class="input_submit"
229                             onclick="document.all.WebBrowser.ExecWB(8,1)" />&nbsp;
230                         <input id="Button3" type="button" value="打印浏览"  class="input_submit"
231                             onclick="document.all.WebBrowser.ExecWB(7,1)" />
232                         
233                     </td>
234                 </tr>
235             </table>
236     </div> 
237     </form>
238 </body>
239 </html>


打印机格式设置的是纵向打印:

 

 

 

 

 

请各位高手指教,万分感谢

微笑在嘴边的主页 微笑在嘴边 | 初学一级 | 园豆:104
提问于:2015-12-16 18:35
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册