duhe
2023-07-24 6bb16e8722eef2db9911e20ca0667165eece4b6f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="xmlLBM_Sc_HPPickingBillList.aspx.cs" Inherits="WebTM.views.基础资料.公用基础资料.xmlLBM_Sc_HPPickingBillList" %>
 
<!DOCTYPE html>
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script runat="server"> 
        protected void Page_Load(object sender, EventArgs e)
        {
            //★特别提示★:
            //不同的数据库应该选用不同的报表XML数据生成类,SQL Server数据库用SqlXMLReportData,Oracle数据库用OracleXMLReportData
            //OledbXMLReportData适合于Access等本地数据库,为了演示方便,这里从Grid++Report的Access例子数据库中获取报表数据
 
            //OledbXMLReportData.GenOneRecordset(this, "select * from Customers order by CustomerID");
            //SqlXMLReportData.GenOneRecordset(this, "select * from h_v_Kf_POStockInBillList_K3 where hmainid=1781");
            var ids = Request.Params["linterid"];
            var idsArray = ids.Split(',');
            var PrintIds = "";
            for (int i = 0; i < idsArray.Length; i++)
            {
                PrintIds += "'" + idsArray[i] + "',";
            }
            PrintIds = PrintIds.Substring(0, PrintIds.Length - 1);
            string sql = string.Format(@"select b.HInterID,b.HEntryID,b.HBarCode as 条形码,a.HDate as 日期,m.HNumber as 物料代码,m.HName as 物料名称,m.HModel as 规格型号,
                            b.HPieceQty as 件数,b.HQty as 数量,a.HBillNo as 领料单号,pm.HBillNo as 源单单号,b.HMaker 制单人,u.HName 计量单位
                            from Kf_ICStockBillMain a
                            left join KF_ICSTOCKBILLSUB_WMS b on b.HInterID=a.HInterID
                            left join Gy_Material m on b.HMaterID=m.HItemID
                            left join gy_unit u on m.HUnitID=u.HItemID
                            left JOIN Sc_PPBomBillSub p ON b.HSourceEntryID = p.HInterID
                            left JOIN Sc_PPBomBillMain pm ON p.HInterID=pm.HInterID
                            where convert(varchar(50),b.HInterID)+'-'+convert(varchar(50),b.HEntryID) in  ("+ PrintIds+")");
            LogService.Write(sql);
            SqlXMLReportData.GenOneRecordset(this, sql);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>
</body>
</html>