SAP Crystal 报告 Header 和详细信息级别折扣
SAP Crystal Report Header and Detail Level Discount
我在 VS 2013 中使用 SAP crystal 报告。我有两个级别的折扣,第一个是 header table,第二个是细节 table。
当我开发它的报告时,有两个级别的组,第一组关于凭证号,第二级组关于客户。详细级别折扣工作正常,但是当我尝试在客户级别总计上显示 header 级别总和时。 header 杠杆折扣的总和显示错误的值。实际上,它将折扣金额乘以发票中的项目数。我怎样才能避免乘法。
如果我可以在查询级别执行此操作,我认为会更好。
这里是SQL报告查询
SELECT TOP (100) PERCENT dbo.Party.Name, dbo.VH.VNo, dbo.VH.VType, dbo.VH.VDate, dbo.Stock.PNO, dbo.Stock.NAME AS IName, dbo.StTrans.RATE, dbo.StTrans.QTY, dbo.StTrans.BATCH, dbo.VH.Discount, dbo.VH.Company,
dbo.StTrans.DISCOUNT AS dDiscount, dbo.StTrans.DPER
FROM dbo.VH INNER JOIN
dbo.StTrans ON dbo.VH.MId = dbo.StTrans.MId INNER JOIN
dbo.Party ON dbo.VH.PerNo = dbo.Party.PerNo INNER JOIN
dbo.Stock ON dbo.StTrans.PNO = dbo.Stock.PNO
WHERE (dbo.VH.PerNo NOT IN
(SELECT PerNo
FROM dbo.Party AS Party_1
WHERE (Type = 10))) AND (dbo.VH.VType = 'SI') AND (dbo.VH.VDate BETWEEN '2021/10/01' AND '2021/10/16') AND (dbo.VH.PerNo <> 0) AND (dbo.VH.Company = 1)
这里是查询结果和报表视图
我在 VS 2013 中使用 SAP crystal 报告。我有两个级别的折扣,第一个是 header table,第二个是细节 table。
当我开发它的报告时,有两个级别的组,第一组关于凭证号,第二级组关于客户。详细级别折扣工作正常,但是当我尝试在客户级别总计上显示 header 级别总和时。 header 杠杆折扣的总和显示错误的值。实际上,它将折扣金额乘以发票中的项目数。我怎样才能避免乘法。
如果我可以在查询级别执行此操作,我认为会更好。
这里是SQL报告查询
SELECT TOP (100) PERCENT dbo.Party.Name, dbo.VH.VNo, dbo.VH.VType, dbo.VH.VDate, dbo.Stock.PNO, dbo.Stock.NAME AS IName, dbo.StTrans.RATE, dbo.StTrans.QTY, dbo.StTrans.BATCH, dbo.VH.Discount, dbo.VH.Company,
dbo.StTrans.DISCOUNT AS dDiscount, dbo.StTrans.DPER
FROM dbo.VH INNER JOIN
dbo.StTrans ON dbo.VH.MId = dbo.StTrans.MId INNER JOIN
dbo.Party ON dbo.VH.PerNo = dbo.Party.PerNo INNER JOIN
dbo.Stock ON dbo.StTrans.PNO = dbo.Stock.PNO
WHERE (dbo.VH.PerNo NOT IN
(SELECT PerNo
FROM dbo.Party AS Party_1
WHERE (Type = 10))) AND (dbo.VH.VType = 'SI') AND (dbo.VH.VDate BETWEEN '2021/10/01' AND '2021/10/16') AND (dbo.VH.PerNo <> 0) AND (dbo.VH.Company = 1)
这里是查询结果和报表视图