supermag.RepTools.LoadClass - вот это взял по аналогии с товарами да ранее делал отчет, конечно неправ я тут был..
LoadCompanies -- вот этот пытался в AFTER PARAMETR FORM подставлять, ругается оракл репортс на него, а Supermag.RepTools.LoadSuppl вот этот норм. идет!
Вот в чем загвоздка у меня: подставил в WHERE но у меня работает он только когда одного только поставщика выбрать, если несколько или все то просто пустой отчет.
Вот полный текст запроса:
SQL код:
:P_SQL := '(select distinct d.id, d.createdat, cl.name, st.docstatename, loc.name,
d.totalsum from supermag.smdocuments d, supermag.SMclientinfo cl, supermag.SMStoreLocations loc,
supermag.SSdocstates st where (d.createdat between :P_FIRSTDATE and :P_LASTDATE)
and (d.docstate = ''2'' OR d.docstate = ''3'') and d.doctype = ''OR'' and cl.id = d.clientindex and loc.id = d.location
and (d.clientindex in :P_SUPPID) and d.doctype = st.doctype and d.docstate = st.docstate and d.ClientIndex = d.ClientIndex '
|| supermag.RepTools.SupplString(0,'d.ClientIndex') ||
')
MINUS (select distinct d.id, d.createdat, cl.name, st.docstatename, loc.name,
d.totalsum from supermag.smdocuments d, supermag.SMclientinfo cl, supermag.SMStoreLocations loc,
supermag.SSdocstates st, supermag.Smcommonbases comm where (d.createdat between :P_FIRSTDATE and :P_LASTDATE)
and (d.docstate = ''2'' OR d.docstate = ''3'') and d.doctype = ''OR'' and cl.id = d.clientindex and loc.id = d.location
and (d.clientindex in :P_SUPPID) and d.doctype = st.doctype
and d.docstate = st.docstate and comm.doctype = ''OE'' and comm.baseid = d.id and d.ClientIndex = d.ClientIndex '
|| supermag.RepTools.SupplString(0,'d.ClientIndex') ||
');';