Home » Developer & Programmer » Reports & Discoverer » Show parameter field value in margin text box (ORACLE 10G DB,REPORT BUILDER 6I)
Show parameter field value in margin text box [message #430700] Wed, 11 November 2009 17:22 Go to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

Hello All,

Am using the parameter form , where am using parameter date field
(:pdate).
After press the enter ,i wants to show in margin with text and parameter value in the following

Report for to_char(:pdate,'yyyy').

Please support me in this..

normally for summary and formula column i used to do &summ_nam_col.
But for displaying the parameter variable its not showing ..


Thanks in advance..

Re: Show parameter field value in margin text box [message #430717 is a reply to message #430700] Thu, 12 November 2009 00:05 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell (keeping in mind that I use Reports 10g), parameters are displayed without any problems using the "&field" notation. Therefore, perhaps it is you who did something wrong.
Re: Show parameter field value in margin text box [message #430752 is a reply to message #430700] Thu, 12 November 2009 03:50 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Based on your previous posts,I am assuming that you are using Repors6i...
Even In report 6i You can use in the parameter validation trigger By assigning your format into another variable2...
and set the source as variable2 @margin level so that you can get.

If you use '&' notation along with to_char

It will display...like tochar('Your format','YYYY').

So use a validation trigger for parameter form field.

Sriram.

Re: Show parameter field value in margin text box [message #430794 is a reply to message #430700] Thu, 12 November 2009 06:14 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

Thanks ram .

How can i create a parameter validation trigger ?..

Can you help me in this please? .
Re: Show parameter field value in margin text box [message #430799 is a reply to message #430794] Thu, 12 November 2009 06:25 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Just right click on the parameter filed,
select property pallete--->select the option validate trigger..there you can enter the code.....

follow the above steps....if your unable to perform then i will give you screen shots.. Smile


Sriram.
Re: Show parameter field value in margin text box [message #430824 is a reply to message #430799] Thu, 12 November 2009 07:28 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

Thanks Ram.
I did the validation trigger .The following code i written inside the validation trigger

function PDATE1ValidTrigger return boolean is
V2 VARCHAR2(4);
begin
  V2 := TO_CHAR(:PDATE1,'YYYY');
  return (TRUE);
end;




I struck here now.If you dont mind can you provide screen shot please.
Re: Show parameter field value in margin text box [message #430827 is a reply to message #430824] Thu, 12 November 2009 07:38 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
seyed456 wrote on Thu, 12 November 2009 07:28
function PDATE1ValidTrigger return boolean is
V2 VARCHAR2(4);



Does it compiled?

sriram
Re: Show parameter field value in margin text box [message #430832 is a reply to message #430827] Thu, 12 November 2009 07:48 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why wouldn't it compile? It is valid declaration.
SQL> declare
  2    v2 varchar2(4);
  3  begin
  4    v2 := to_char(sysdate, 'yyyy');
  5  end;
  6  /

PL/SQL procedure successfully completed.

SQL>
Re: Show parameter field value in margin text box [message #430833 is a reply to message #430832] Thu, 12 November 2009 07:52 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

Its done.Its working ..what i wud do after that ?...
Re: Show parameter field value in margin text box [message #430834 is a reply to message #430832] Thu, 12 November 2009 07:59 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Of course it is, i did not mean that actually, In his post he is not taking that as a bind variable.... Smile i suggested him to hold the string in a variable and give it as a source @ margin.

sriram.
Re: Show parameter field value in margin text box [message #430836 is a reply to message #430834] Thu, 12 November 2009 08:15 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
/forum/fa/7011/0/
And I am Using the following at Afterparameter form

function AfterPForm return boolean is
begin
  srw.message(1,'Subhead:'||nvl(:subhead,'sriram'));
  	begin
	  select nvl('Report for Employee '||' On '||to_char(hiredate,'YYYY'),'sriram') into :subhead from emp_sriram a
  	where a.empno=:emp_no;
	exception when no_data_found then
		:subhead := null;
		srw.message(1001,'subhead:' ||:subhead);
	end;
	  return (TRUE);
end;


And used subhead as a source for the Required output.

sriram Smile
Re: Show parameter field value in margin text box [message #430850 is a reply to message #430836] Thu, 12 November 2009 09:37 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

THANKS.

What i write in the query ?..can u tell me.Am facing an error called uncomplied plsql..Can u tell me what i write inside report wizard data thats nothing but query..
Re: Show parameter field value in margin text box [message #430885 is a reply to message #430850] Thu, 12 November 2009 20:54 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
seyed456 wrote on Thu, 12 November 2009 09:37
THANKS.
What i write in the query ?..can u tell me.Am facing an error called uncomplied plsql..Can u tell me what i write inside report wizard data thats nothing but query..



I dont have your tables,i dont have your data....Nothing with me..thats why i already provided a sample example based on the normal tables Please use the same logic.....


Debug the error using srw package(upto which level your code working properly)....That might be because of afterPform trigger....


sriram.
Re: Show parameter field value in margin text box [message #430983 is a reply to message #430700] Fri, 13 November 2009 09:19 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

I have got it ..since one of my friend has helped me the same to get it done..
Thanks for all your time bro ram..


i Just write down what my friend has told

1. Create a parameter P_DATE under User Parameter section and make the DataType as Character.
2. Add the coding in Report Trigger->After Parameter Form

function AfterPForm return boolean is
begin
SELECT TO_CHAR(TO_DATE(:P_DATE),'YYYY') INTO :P_DATE FROM DUAL;
return (TRUE);
end;

3. Take a Field in Report layout form and choose Field Source as P_Date. Then run the report.

Re: Show parameter field value in margin text box [message #430987 is a reply to message #430983] Fri, 13 November 2009 09:40 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Ok..congratulations Smile What will you do if you want that :pdate to be used in the query ? again convert into date ?.

In my case i used :subhead of type char,:pdate as date so that i can use this :subhead any where at margin....What ever your friend suggested thats equal to my post is n`t it ?

Any way You got the desired output..congrats once again Smile Wink
And one more just now i re read your post,Please use proper format model for to_date As you are using :pdate as char...

Good luck.

sriram
Re: Show parameter field value in margin text box [message #430998 is a reply to message #430987] Fri, 13 November 2009 10:23 Go to previous messageGo to next message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

I did it in date type..No issues..

And i have posted another thing which am facing since today.
I have posted with subject "i wants the formula column to be implemented"..

Please look on it..\

Thanks always..
Re: Show parameter field value in margin text box [message #431003 is a reply to message #430700] Fri, 13 November 2009 10:52 Go to previous messageGo to next message
cookiemonster
Messages: 13960
Registered: September 2008
Location: Rainy Manchester
Senior Member
If p_date is a date you shouldn't be to_dateing it. That's just a bug waiting to happen.
Also I would have thought it'd make more sense to put the results of your query in a different variable.
Re: Show parameter field value in margin text box [message #431017 is a reply to message #431003] Fri, 13 November 2009 11:57 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
cookiemonster wrote on Fri, 13 November 2009 10:52
If p_date is a date you shouldn't be to_dateing it. That's just a bug waiting to happen.
Also I would have thought it'd make more sense to put the results of your query in a different variable.


Yes you are right...But
He changed his mind now he wants the :pdate as a char....
Quote:
Create a parameter P_DATE under User Parameter section and make the DataType as Character


Sriram Smile
Re: Show parameter field value in margin text box [message #431021 is a reply to message #431017] Fri, 13 November 2009 12:20 Go to previous message
seyed456
Messages: 220
Registered: May 2008
Location: south india .
Senior Member

dude help me over there in the other post..
My deadline is tomorrow ..Please ...

Link
http://www.orafaq.com/forum/t/152216/124185/
Previous Topic: Oracle Reports 6i Error "REP-0771: AFter Form trigger failed.
Next Topic: I wants the formula column to be implemented
Goto Forum:
  


Current Time: Wed Dec 04 19:42:26 CST 2024