高格-塑料管业中厂内工单列表的处理【5】
由于塑料管业生产中,一个车间多个生产线,每条生产线生产一个品名产品。因此不太合适用高格厂内工单打印方式来安排生产,
需要用列表方式比较合适。
那么如何实现一览表的方式,花点时间还是成功实现了。
1、使用条文作为表格的质量要求
2、工单备注长度255个字节,作为表格说明。
SELECT ( SELECT STRING+char(10) FROM VCHRART where SRCERI = B.ERI order by SERIAL FOR XML PATH('') ) AS MYMEMO, B.MEMO, case B.CLOSETYPE when 1 then '已结案' else '' end 结案,B.SDATE,B.CODE,B.MAKER,(CASE B.WORKTYPE WHEN 0 THEN (SELECT NAME FROM BOMMAKE WHERE CODE=B.MAKER) WHEN 1 THEN (SELECT ABBR FROM SUPPLIER WHERE CODE=B.MAKER) END ) AS MAKERNAME, CASE B.SRCTRACK WHEN 0 THEN '报工单' ELSE '移转单' END SRCTRACK, B.MPROD,P.CNAME AS MPRODNAME,B.SPEC,O2.CODE AS ORDCODE, B2.PRSNO,BS.NAME AS PRSNAME,B2.QTY,(B2.SCRAPQTY + B2.RPTQTY) BQTY,B2.GQTY, B2.SCRAPQTY,B2.RPTQTY, (CASE WHEN B.CLOSETYPE=1 THEN 0 WHEN B2.QTY<B2.GQTY THEN 0 ELSE ISNULL(B2.QTY-B2.GQTY,0) END) AS NOCOMQTY, B2.GQTY+B2.SCRAPQTY+B2.RPTQTY AS TOTQTY, case when B2.SCRAPQTY+B2.RPTQTY = 0 then 100 else 100.0*B2.COMQTY/(B2.GQTY+B2.SCRAPQTY+B2.RPTQTY) end PRSRATE, B2.TOTAL, B.ERI, B.VPNO FROM BOMWORK B LEFT JOIN PRODUCT P ON B.MPROD=P.CODE LEFT JOIN ORDCORD2 O2 ON B.ORDERI=O2.ERI LEFT JOIN BOMWORK2 B2 ON B.ERI=B2.MASTERI LEFT JOIN BOMMPRS BS ON B2.PRSNO=BS.CODE WHERE B.NEEDPRS=1 AND B2.ERI IS NOT NULL AND B.SDATE BETWEEN :SDATE1 AND :SDATE2 AND B.CODE=:CODE AND B.MPROD=:PRODCODE AND O2.CODE=:ORDCODE AND B2.PRSNO=:PRSNO ORDER BY B.SDATE,B.CODE,B2.SERIAL
在打印模板设计时注意自动换行等属性值即可