Home » Developer & Programmer » Reports & Discoverer » How to skip the columns with space based on parameters (6i)
How to skip the columns with space based on parameters [message #488601] Mon, 10 January 2011 03:06 Go to next message
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 #488605 is a reply to message #488601] Mon, 10 January 2011 03:27 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try to write a Format Trigger on those columns. As they return BOOLEAN, you could simply
return (:param_value = 'YES');
Re: How to skip the columns with space based on parameters [message #488622 is a reply to message #488605] Mon, 10 January 2011 04:42 Go to previous messageGo to next message
madhuarepalli
Messages: 53
Registered: June 2010
Location: Hyderabad
Member
Hi LittleFoot,

I am new for oracle reports, Can you elaborate the coding part..

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 Go to previous messageGo to next message
Littlefoot
Messages: 21549
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, simply
return (: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 Go to previous messageGo to next message
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 #488645 is a reply to message #488642] Mon, 10 January 2011 05:55 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In AFTER PARAMETER FORM trigger.
Re: How to skip the columns with space based on parameters [message #488648 is a reply to message #488645] Mon, 10 January 2011 06:15 Go to previous messageGo to next message
madhuarepalli
Messages: 53
Registered: June 2010
Location: Hyderabad
Member
i have tried in After Paramater Form.It give alert message but i don't want alert. I wold like to Print the message.
Is there any possibility to write code on Text.

Note:- subquery are not allowed in After Parameter Form and Format Triggers. I have subquey..

Please give me suggestion.

Regads,
madhu


[Updated on: Mon, 10 January 2011 06:18]

Report message to a moderator

Re: How to skip the columns with space based on parameters [message #488724 is a reply to message #488648] Mon, 10 January 2011 13:13 Go to previous messageGo to next message
Littlefoot
Messages: 21549
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create a formula column that returns a CHAR (which would be the whole message, i.e. "3 does not exist"). Display it in Layout.
Re: How to skip the columns with space based on parameters [message #488751 is a reply to message #488724] Tue, 11 January 2011 00:00 Go to previous messageGo to next message
madhuarepalli
Messages: 53
Registered: June 2010
Location: Hyderabad
Member
Hi Little,

Where can i insert this query

:num is not in(select number from emp);

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 Go to previous message
Littlefoot
Messages: 21549
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;

Previous Topic: Reports font size
Next Topic: Oracle Report Dynamic Text movement
Goto Forum:
  


Current Time: Tue Apr 07 02:07:15 CDT 2020