bugao7 Posted April 17, 2013 Share Posted April 17, 2013 Hi.... This is my query:SELECT DISTINCT getcoursename(C.courseid) nomeCurso, getcontractclassid(C.contractid) nomeTurma, A.personid CodAluno, COALESCE(C.contractid, getinvoicecontract(B.invoiceid)) codContratoAluno, A.name nomeAluno, E.description tipoConvenio, G.description tipoOperacao, ROUND(B.value,2) ValorTitulo, (CASE WHEN E.value IS NULL THEN 0 ELSE (CASE WHEN E.ispercent IS FALSE AND E.value IS NOT NULL THEN (E.value * 100)/B.value ELSE E.value END) END) percDescontoConvenio, (CASE WHEN E.ispercent IS TRUE THEN (B.value * E.value)/100 ELSE (B.value * ((E.value * 100)/B.value) / 100) END) ValorDesconto FROM ONLY basperson A INNER JOIN ONLY fininvoice B ON A.personid = B.personid INNER JOIN ONLY acdcontract C ON A.personid = C.personid INNER JOIN ONLY finconvenantperson D ON C.contractid = D.contractid INNER JOIN ONLY finconvenant E ON D.convenantid = E.convenantid INNER JOIN ONLY finentry F ON B.invoiceid = F.invoiceid INNER JOIN ONLY finoperation G ON F.operationid = G.operationid INNER JOIN ONLY finreceivableinvoice H ON F.invoiceid = H.invoiceid INNER JOIN ONLY acdenroll I ON C.contractid = I.contractid INNER JOIN ONLY acdgroup J ON I.groupid = J.groupid INNER JOIN ONLY acdlearningperiod K ON J.learningperiodid = K.learningperiodid INNER JOIN ONLY acdclass L ON J.classid = L.classid INNER JOIN ONLY acdcourse M ON K.courseid = M.courseid INNER JOIN ONLY finoperationgroup N ON G.operationgroupid = N.operationgroupid WHERE B.iscanceled IS FALSE AND B.invoiceiddependence IS NULL AND D.enddate >= now() AND K.periodid = '2013-1' AND K.enddate >= now() AND G.operationid = 1 AND I.statusid = 1 AND CASE WHEN $P{dataIni} IS NOT NULL AND $P{dataFim} IS NOT NULL THEN F.entrydate BETWEEN TO_DATE($P{dataIni},'DD/MM/YYYY') AND TO_DATE($P{dataFim},'DD/MM/YYYY') ELSE TRUE END AND CASE WHEN $P{codCurso} IS NOT NULL THEN M.courseid = $P{codCurso} ELSE TRUE END AND CASE WHEN $P{codTurma} IS NOT NULL THEN L.classid = $P{codTurma} ELSE TRUE END AND CASE WHEN $P{mesReferencia} IS NOT NULL THEN extract('MONTH' FROM B.maturitydate) = $P{mesReferencia} ELSE TRUE END AND CASE WHEN $P{anoReferencia} IS NOT NULL THEN extract('YEAR' FROM B.maturitydate) = $P{anoReferencia} ELSE TRUE END AND $P{list}{IN, E.convenantid, codConvenio} /*CASE WHEN $P{codConvenio} IS NOT NULL THEN E.convenantid = $P{codConvenio} ELSE TRUE END*/ ORDER BY 1,2,5I have one problem with $list parameter, i need it be one list as checkbox or one multi selection list, but i cant do this. In report, the list parameter appears like one simple text dialog, and dun have list to selection. Before try this my parameter list was control = selection with one query="select....". it worked like one list with simple selection, but i need one list with 2 or more selection. Anyonce can help. Sry poor english =D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now