ASP控制每页打印行数

 

<%
pagenum=55'指定打印行数
%>



销售利润明细报表打印




<%
kdname1=trim(request("kdname1"))
kdname2=trim(request("kdname2"))
keyword1=trim(request("keyword1"))
keyword2=trim(request("keyword2"))

 if keyword1<>"" then
 today=keyword1
 else
 if kdname1="" then
 today=year(date())&"-"&month(date())
 else
 today=kdname1&"至"&kdname2
 end if
 end if
%>
 


   
     
   
 
销售利润汇总报表

<% 
 strSQL="select autoid,sellautoid,productxili,productname,productsize,productnum,productdan,productjia,chaoshi,tiaoma,youhui,fukuan,moncount1,gongshang,lirun1,username,indate,fudate from sell where officename='"&trim(request.cookies("Myoffice"))&"' and monthjie='0' and (year(indate)=year(getdate()) and month(indate)=month(getdate())) and zhuofei is null order by autoid desc"            
 set rs1=server.createobject("adodb.recordset")             
 rs1.open strSQL,conn,1,1
%>              
 

            
                
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
   
 
销售单号商品名称(规格)客户数量单位销售价折%进货价小计利润付款销售日期

<%            
  moncount2=0            
  moncount5=0            
  Do while not rs1.eof 
%>

<%
for i=1 to pagenum
if not rs1.eof then
  if trim(rs1("fukuan"))="欠款" then            
  moncount6=Csng(rs1("lirun1"))            
  moncount5=moncount5+moncount6            
  else            
  moncount3=Csng(rs1("lirun1"))            
  moncount2=moncount2+moncount3            
  end if 
%>     
                
                  
                  
                 
                 
                 
                 
                 
                 
                 
                 
                 
                 
   
<%
rs1.movenext
end if
next
%>
 <%=rs1("sellautoid")%><%=Decode(rs1("productname"))%> <%=rs1("productsize")%><%=left(rs1("gongshang"),9)%><%=rs1("productnum")%><%=rs1("productdan")%><%=formatNumber(rs1("chaoshi"),varnum,-1)%><%=rs1("youhui")%><%=formatNumber(rs1("productjia"),varnum,-1)%><%=formatNumber(rs1("moncount1"),varnum,-1)%><%=formatNumber(rs1("lirun1"),varnum,-1)%><%if trim(rs1("fukuan"))="欠款" then%><%=rs1("fukuan")%><%else%><%=rs1("fukuan")%><%end if%><%=rs1("indate")%>

<%
if not rs1.eof and i=pagenum+1 then '添加分页标记
%>
 
 

 

 
                
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
                  
   
<%
end if
loop
rs1.close    
set rs1=nothing    
%> 
销售单号商品名称(规格)客户数量单位销售价折%进货价小计利润付款销售日期
 
 
               
                  
       
  
现金利润:<%=formatNumber(moncount2,varnum,-1)%>   <%if moncount5<>"" then%>欠款利润:<%=formatNumber(moncount5,varnum,-1)%><%end if%>   <%if moncount5<>"" then%>毛利合计:<%=formatNumber(moncount5+moncount2,varnum,-1)%><%end if%>
           
<%
end if
conn.close
set conn=nothing
%> 




你可能感兴趣的:(ASP控制每页打印行数)