返回首页
当前位置: 主页 > 网络编程 > .Net实例教程 >

关于jxc自己增加打印字段的方法

时间:2016-06-17 20:05来源:知行网www.zhixing123.cn 编辑:麦田守望者

关于打印销售单

1、在 vch/j_SaleBillSubMenu.asp 中有打印数据的部分,注意,这是在销售单制单后立即打印的。
如果是在经营历程中查找单据后打印应该在 /DispVch/j_s_SaleBillSUBMENU.ASP 中有相关代码。


<!--打印打印打印-->

<script language="vbscript">

Dim PrintOrder,isQueryOver,HeadData(41)
PrintOrder="1"

sub Write()

if not IsObject(WebPrint) then
alert("打印对象失败!")
Exit Sub
end if

'复位Grid中的"nCurSerialLines"序列号行数记累。
parent.VCH_GRID.nCurSerialLines = 0
parent.VCH_GRID.lnSerialPrintNum = GetPrintNumPerLine()


'IF document.all.BTypeName.value<>parent.VCH_HEAD.btype_edit.value Then
' document.all.Turn_BTypeAddAndTel.value="F"
'End IF

'IF (document.all.Turn_BTypeAddAndTel.value="F") and (PrintOrder=0) then
' document.all.BTypeName.value=parent.VCH_HEAD.btype_edit.value
' parent.top.DataSendFrame.location.href="../vch/DoSerialPrint.asp?TimeCheckPoint="+GetTimeCheckPoint("","") & "&BTypeName=" & parent.VCH_HEAD.btype_edit.value & "&DoType=GetBTypeADDAndTEL&WindowMode=0"
' window.setTimeout "Write",1000
' exit sub
'End IF

Dim ColData

if clng(parent.VCH_GRID.GridType)=3 then

Dim ColWidth1(14),ColTitle1(14)

ColWidth1(0)="100"
ColWidth1(1)="100"
ColWidth1(2)="100"
ColWidth1(3)="100"
ColWidth1(4)="100"
ColWidth1(5)="100"
ColWidth1(6)="100"
ColWidth1(7)="100"
ColWidth1(8)="100"
ColWidth1(9)="100"
ColWidth1(10)="100"
ColWidth1(11)="255"
ColWidth1(12)="255"
ColWidth1(13)="255"
ColWidth1(14)="255"

ColTitle1(0) = "No"
ColTitle1(1) = "序列号"
ColTitle1(2)="商品编号"
ColTitle1(3)="商品全名"
ColTitle1(4)="单位"
ColTitle1(5) = "条形码"
ColTitle1(6) = "规格"
ColTitle1(7) = "型号"
ColTitle1(8) = "产地"
ColTitle1(9)="数量"
ColTitle1(10)="辅助单位"
ColTitle1(11)="辅助数量"
ColTitle1(12)="单价"
ColTitle1(13)="金额"
ColTitle1(14)="备注"

end if

Dim ColWidth(17),ColTitle(17),EndData(2)

Dim b

Dim Re

HeadData(36)="税率:"+parent.VCH_HEAD.document.all.taxrate_edit.value

HeadData(37)="收款期限:"+parent.VCH_HEAD.document.all.AlertDay_edit.value
HeadData(38)="审核人:"+parent.VCH_HEAD.document.all.checker.value
HeadData(39) = "VIP卡号:" + parent.VCH_HEAD.VipCardNo.value
HeadData(40) = "VIP卡扣率:" + parent.VCH_HEAD.VipCardKl.value
HeadData(41) = "部门:" + parent.VCH_HEAD.document.all.department_edit.value

ColWidth(0)="100"
ColWidth(1)="100"
ColWidth(2)="100"
ColWidth(3)="100"
ColWidth(4)="100"
ColWidth(5)="100"
ColWidth(6)="100"
ColWidth(7)="100"
ColWidth(8)="100"
ColWidth(9)="100"
ColWidth(10)="100"
ColWidth(11)="100"
ColWidth(12)="100"
ColWidth(13)="100"
ColWidth(14)="255"
ColWidth(15)="255"
ColWidth(16)="255"
ColWidth(17)="255"

ColTitle(0) = "No"
ColTitle(1) = "序列号"
ColTitle(2) = "商品编号"
ColTitle(3) = "商品全名"
ColTitle(4) = "单位"
ColTitle(5) = "条形码"
ColTitle(6) = "规格"
ColTitle(7) = "型号"
ColTitle(8) = "产地"
ColTitle(9)="数量"
ColTitle(10)="单位关系"
ColTitle(11)="辅助数量"
ColTitle(12)="单价"
ColTitle(13)="金额"
if clng(parent.VCH_GRID.GridType)=1 then
ColTitle(14)="税率"
ColTitle(15)="含税单价"
ColTitle(16)="价税合计"
ColTitle(17)="备注"
elseif clng(parent.VCH_GRID.GridType)=2 then
ColTitle(14)="扣率"
ColTitle(15)="折后单价"
ColTitle(16)="折后金额"
ColTitle(17)="备注"
end if

ColData=parent.VCH_GRID.jsGetGridData(0) '取得表格的数据

EndData(0)="收款账户:"+document.all.atypeid_edit.value
EndData(1)="实收金额:"+document.all.totalinmoney_edit.value
EndData(2)="优惠金额:"+document.all.Preference_edit.value

'alert ColData

if clng(parent.VCH_GRID.GridType)=1 then
Re=WebPrint.WriteData("1","销售含税单",HeadData,EndData,ColWidth,ColTitle,ColData)
elseif clng(parent.VCH_GRID.GridType)=2 then
Re=WebPrint.WriteData("2","销售折扣单",HeadData,EndData,ColWidth,ColTitle,ColData)
elseif clng(parent.VCH_GRID.GridType)=3 then
Re=WebPrint.WriteData("31","销售单",HeadData,EndData,ColWidth1,ColTitle1,ColData)
end if

if Re<>0 then
select case WebPrint.ErrCode
case 1 alert("系统初始化错误")
case 2 alert("传入参数错误")
case 3 alert("列数错误")
case 4 alert("创建打印表错误")
case 5 alert("打开表格错误")
case 10 alert("发生未知错误")
end select
else
t=(screen.availHeight-250)/2
l=(screen.availWidth-280)/2
f="height=205,top=" & t & ",left="& l &",width=185,location=no,menubar=no,resizable=no,toolbar=no"
window.open "../common/printreport.asp","",f
end if


//录入赠送单
if document.all.SaleBillBillNumberId.value <> "" and draforbill = 1 then
re=window.confirm("【系统提示】:你现在是否需要录入赠送商品?")
if re then
parent.location.href= "../VCH/j_BillFrame.asp?TimeCheckPoint=" + GetTimeCheckPoint("","")+"&BillTypeID=139&BillCode="+document.all.SaleBillBillNumberId.value
end if
end if

 

end sub

</script>

<!--打印打印打印-->

 

 

 

 

---------------------------------------------------------------------------------

2、在刚才的页面中有 控件

<OBJECT
classid="clsid:340FC08C-5FBF-4F52-9CD7-E50A446A1484"
width=0
height=0
align=center
hspace=0
vspace=0 name="WebPrint" id=WriteReportData1>
</OBJECT>

---------------------------------------------------------------------------------


3、在打印软件 V41 Update 中,关于表头表尾,只要手动在报表设计界面用 @新字段的名字。然后在 ASP 页面定义 HeadData数组中定义 新字段:新值 就可以匹配上。HeadData的声明是在vch/j_SaleBillSubMenu.asp中。但是赋值不在这个文件中。
只要在赋值的时候将新增的字段名和值用英文分号隔开,在管家婆报表编辑器里面就能找到新的字段。

4、步骤1中headdata的赋值主要加载由 vch\js_LoadBTypeInfo.asp负责。

------分隔线----------------------------
标签(Tag):C#
------分隔线----------------------------
推荐内容
猜你感兴趣