How to skip the columns with space based on parameters [message #488601] |
Mon, 10 January 2011 03:06 |
madhuarepalli
Messages: 53 Registered: June 2010 Location: Hyderabad
|
Member |
|
|
Hi,
I have Two Paramets like 'YES' & 'NO'
when parameter is YES, column having values
when Parameter is NO, column having no values
In this scenario, how can i skip the column with space when parameter is NO because the column exist in middle of columns in report and Present with space when parameter is YES. Please help me.
Regards,
Madhu
|
|
|
|
|
Re: How to skip the columns with space based on parameters [message #488626 is a reply to message #488622] |
Mon, 10 January 2011 04:53 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
"Format trigger" can be found in column's property palette window. By default, it looks like this:function F_kpc_OIBFormatTrigger return boolean is
begin
return (TRUE);
end;
If it returns TRUE, column will be displayed. Otherwise, it will not.
Now, depending on parameter's value, you could write it as follows:
if :param_value = 'YES' then
return (TRUE);
else
return (FALSE);
end;
Or, shorter, simplyreturn (:param_value = 'YES'); which means: if parameter's value equals YES, condition is true and TRUE will be returned (and column displayed). In any other case (which means anything but YES), it will return FALSE and column wouldn't be displayed.
|
|
|
Re: How to skip the columns with space based on parameters [message #488642 is a reply to message #488626] |
Mon, 10 January 2011 05:52 |
madhuarepalli
Messages: 53 Registered: June 2010 Location: Hyderabad
|
Member |
|
|
Hi LittleFoot,
Thanks for your support. Can you clarify below doubt..
I would like to print output likr "number is not exist in system."
Parameter value
Eg: NUMBER 3
output should be "3 is does not exist in system".
My query is :num is not in(select number from emp);
Above query, where can i put in report.
Regards,
Madhu
|
|
|
|
|
|
|
Re: How to skip the columns with space based on parameters [message #488860 is a reply to message #488751] |
Tue, 11 January 2011 15:39 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
A formula column, as I've said.
It would, actually, be something like
l_msg varchar2(100);
begin
select null
into l_msg
from emp e
where e.number = :num;
return (l_msg);
exception
when no_data_found then
l_msg := to_char(:num) || ' does not exist in the table';
return (l_msg);
end;
|
|
|