Home » Developer & Programmer » Reports & Discoverer » Order By Clause use with formula column (Report 6i)
Order By Clause use with formula column [message #445100] Thu, 25 February 2010 22:22 Go to next message
allianz2010
Messages: 101
Registered: October 2009
Location: Pakistan
Senior Member

I create i simple tabular type report.
i want to use order by clause in this report.
but i use order by clause with formula column.
i also attache the picture.

  • Attachment: Report.jpg
    (Size: 118.33KB, Downloaded 943 times)
Re: Order By Clause use with formula column [message #445114 is a reply to message #445100] Thu, 25 February 2010 23:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"order by 2"?

Regards
Michel
Re: Order By Clause use with formula column [message #445115 is a reply to message #445114] Thu, 25 February 2010 23:17 Go to previous messageGo to next message
allianz2010
Messages: 101
Registered: October 2009
Location: Pakistan
Senior Member

Quote:
"order by 2"?


Thanks for your reply..
i do that but its not work on formula column.....
Re: Order By Clause use with formula column [message #445124 is a reply to message #445115] Fri, 26 February 2010 01:00 Go to previous messageGo to next message
ramoradba
Messages: 2456
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
formula column ?

where it is?
is it slno ?
whats hurting you to do(use) the order by clause?

Please provide proper information.

sriram Smile
Re: Order By Clause use with formula column [message #445132 is a reply to message #445115] Fri, 26 February 2010 02:15 Go to previous message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Here's one way to do that (based on Scott's schema).

Create an ordinary report; query fetches some information about employees:
select empno, job, sal
from emp

Formula column will display employees' names. So, let's create a formula WITHIN the default group:
function CF_enameFormula return Char is
  retval varchar2(20);
begin
  select ename
    into retval
    from emp
    where empno = :empno;
  return (retval);
end;

Now drag formula column out, so that it will have its own break group. Make its Break Order property "Ascending". This is how data model is supposed to look like:

/forum/fa/7507/0/[img]/forum/fa/7506/0/[/img]

Go to Paper layout editor, remove existing layout and run Report Wizard. Choose Group Left style. Group field is our formula column:

/forum/fa/7508/0/

Layout looks like this:

/forum/fa/7509/0/

Finally, the result, ordered by ENAME (i.e. formula column):

/forum/fa/7510/0/

I guess that's all.
Previous Topic: how to use union
Next Topic: how to show images in report
Goto Forum:
  


Current Time: Fri Apr 26 00:34:59 CDT 2024