Home » Developer & Programmer » Reports & Discoverer » parameter report (oracle report 6i)
parameter report [message #428589] Thu, 29 October 2009 01:14 Go to next message
asalam
Messages: 14
Registered: July 2009
Junior Member
good morning

i have report but i want to path LOV through parameter from
but LOV contains status for client
for every status i must path different period from and to date
for example
if the client accept we enter date
and when client refused we entered another date from another table
what can i do
can you help me

thanx
Re: parameter report [message #428602 is a reply to message #428589] Thu, 29 October 2009 02:17 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps you might select those dates in the AFTER PARAMETER FORM trigger, which would contain different selects (depending on client's status). Something like this:
-- after parameter form trigger

if :parameter.client_status = 'accept' then
   select date_1, date_2
     into :par_date_from, :par_date_to  --> user defined parameters
     from table_1
     where ...;
elsif :parameter.client_status = 'reject' then
   select date_1, date_2
     into :par_date_from, :par_date_to
     from table_2
     where ...;
end if;
Re: parameter report [message #428886 is a reply to message #428602] Fri, 30 October 2009 09:17 Go to previous messageGo to next message
asalam
Messages: 14
Registered: July 2009
Junior Member
thank u for reply, and i'm sorry because i did reply once you sent your message , i had problem with connection.

i did your script but i have a message rep_1401 , fetal error with after parameter form trigger

so i want to ask , would i define 3 paramters in report query model - one client_status and two from date_1 and date_2?


thank you again for your help
Re: parameter report [message #428918 is a reply to message #428886] Fri, 30 October 2009 14:25 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
asalam wrote on Fri, 30 October 2009 15:17
would i define 3 paramters in report query model - one client_status and two from date_1 and date_2?

If I correctly understood your question and if I had to do that job, yes, I probably would create three parameters.
Re: parameter report [message #428978 is a reply to message #428918] Sat, 31 October 2009 06:36 Go to previous messageGo to next message
asalam
Messages: 14
Registered: July 2009
Junior Member
than you Littlefoot for your help

i'll do and reply

thankx agian
Re: parameter report [message #429015 is a reply to message #428978] Sun, 01 November 2009 01:51 Go to previous messageGo to next message
asalam
Messages: 14
Registered: July 2009
Junior Member
this is code
but it doesn't work
please write the paramEters in query model


function AfterPForm return boolean is
begin

IF :p_status = '1' then
SELECT PERM_DATE DATE1, PERM_DATE DATE2
INTO :P_from_DATE, :P_To_DATE
FROM perm;

ELSif

:p_status = '2' then
SELECT ADMIN DATE_1, admin DATE_2
INTO :P_from_DATE, :P_To_DATE
FROM TEMP
end if;

return (TRUE);
exception
when value_error then
dbms_output.put_line('Error'||SQLERRM||' '||SQLCODE);
return (false);
end;
Re: parameter report [message #429042 is a reply to message #429015] Sun, 01 November 2009 10:47 Go to previous messageGo to next message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"It doesn't work" is meaningless to anyone but you. What does that mean? What error did you get?

It would be better if you pasted exact code you used; because, ELSIF's SELECT lacks in semi-colon at the end of the statement (is that an error you are talking about? If so, shame on you! It should have been fixed by you!).

Remove exception handler unit; Oracle will throw an error anyway, you don't have to do anything about it (especially not simulating Oracle's default behaviour). Besides, this is reports PL/SQL block we are discussing, and it does not accept DBMS_OUTPUT package. If you insist on displaying a message, research use of the SRW Reports package.
Re: parameter report [message #429165 is a reply to message #429042] Mon, 02 November 2009 06:31 Go to previous messageGo to next message
asalam
Messages: 14
Registered: July 2009
Junior Member
hi littlefoot
thank you so much , i removed the exception handler unit, and i trace the output by using toad.
and now the report is working.

thank you again
and i'm sorry for upset you from my mistakes.

bye
Re: parameter report [message #429168 is a reply to message #429165] Mon, 02 November 2009 06:59 Go to previous message
Littlefoot
Messages: 21809
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
LOL, these things don't make me upset; their consequence is the fact that you get the answer much later than if you posted accurate information.

OK, never mind that, I'm glad you found the solution.
Previous Topic: printing extra page
Next Topic: Report width setup
Goto Forum:
  


Current Time: Mon May 13 19:43:10 CDT 2024