我的选拔专家有以下内容:
(
if {?Job} <> "All" then
{SPSYSPRO_PO_CapexJobs;1.MJob} = {?Job}
else
true
) OR
(
if {?Supplier} <> "All" then
{SPSYSPRO_PO_CapexJobs;1.MJob}= {?Job}
else
true
)
然而它没有做我想要的^^ 我需要的是如果Job没有选择值,那么使用供应商的列表来获取数据。 因此,如果Job没有价值且Supplier =多个值,它应该给我带来所有这些供应商的工作,反之亦然...... 如果我选择Job = All并选择多个供应商,那么它应该将我所有的工作带回给所选择的供应商,反之亦然...
嘿,只是认为生病了我的SP,然后你可能会理解我正在寻找什么,因为你的配方在这方面不起作用。
SELECT SUBSTRING(PD.PurchaseOrder,9,7) PurchaseOrder
,PD.[Line]
,PD.[MStockCode]
,PD.[MStockDes]
,PD.[MOrderQty]
,PD.[MReceivedQty]
,SUBSTRING(RD.Supplier,9,7) Supplier
,AP.SupplierName
,PH.OrderEntryDate CreateDate
,PH.OrderStatus
,PD.[MLatestDueDate]
,PD.[MLastReceiptDat]
,PD.[MDiscValue]
,PD.[MPrice]
,PD.[MForeignPrice]
,PD.MJob
,PD.[MRequisition]
,PD.[MRequisitionLine]
FROM [SysproCompanyR].[dbo].[PorMasterDetail] PD
INNER JOIN [SysproCompanyR].[dbo].[PorMasterHdr] PH
on PD.PurchaseOrder = PH.PurchaseOrder
INNER JOIN [SysproCompanyR].[dbo].ReqDetail RD
on PD.MRequisition = RD.Requisition and PD.MRequisitionLine = RD.Line
INNER JOIN [SysproCompanyR].[dbo].ApSupplier AP
on RD.Supplier = AP.Supplier
Where SUBSTRING(PD.MJob,1,1)= 'C'
and PD.MCompleteFlag <> 'Y'
and PH.OrderStatus <> '*'
答案 0 :(得分:0)
如果您只需要为所选供应商提供工作,那么您最好使用子报告
在主报表中为供应商和作业创建参数,并将供应商参数传递给子报表,并将主报表中的作业参数链接到子报表
使用子报告链接并在子报告record selection formula
对于参数创建2个默认值All
,None
和您的普通列表
if {?Job} = "All" and ({?suppliers} <> "ALL" and {?suppliers} <> "none") then
{SPSYSPRO_PO_CapexJobs;1.MJob} = {?Job} and
{SPSYSPRO_PO_CapexJobs;1.Msuppliers} in ("list of comma saperated suppliers")
//For above case you need to have relation between jobs and suppliers
else if
(({?Job} = "All" or {?suppliers} = "none") and {?suppliers} <> "ALL")
then {SPSYSPRO_PO_CapexJobs;1.MJob} = {?Job}
else if
({?Job} <> "All" and ({?suppliers} = "ALL" or {?Job} = "none"))
then {SPSYSPRO_PO_CapexJobs;1.MJob}= {?Job}
如果您不想使用子报告,则检索所有记录并在水晶报告中进行选择
if
(({?Job} = "All" or {?suppliers} = "none") and {?suppliers} <> "ALL")
then {SPSYSPRO_PO_CapexJobs;1.MJob} = {SPSYSPRO_PO_CapexJobs;1.MJob} else if
({?Job} <> "All" and ({?suppliers} = "ALL" or {?Job} = "none"))
then {SPSYSPRO_PO_CapexJobs;1.MJob}= {SPSYSPRO_PO_CapexJobs;1.Supplier}
希望有所帮助