Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matrix report with computed columns

Status
Not open for further replies.

Bracha

Programmer
Apr 17, 2006
10
US
Hi all,

Using matrix report, how can I:
1. hide some of the columns
- let's say that there are 4 different codes: A,B,C and D (those codes will be rendered as columns), I want to show columns C,B,D in that order.
2. add computed column which is based on some other columns (A+B/c)

Thanks.
 
To suppress columns use format trigger of the column repeating frame, something like
Code:
begin
  return :column_name not in {'A');
end;
To ssort columns differently, you need to create in the SQL some kind of sort field, which you will use in the matrix column group to set a break order on it. SQL example:
Code:
select
 cn column_name
[b], decode(cn, 'C', 1, 'B', 2, 'D', 3, 4) column sort[/b]
,rn row_name
,v value
from
...
To get extra column, bring this column in the SQL usin UNION. Continuing the above example:
Code:
...
...
UNION
select
'A+B' column_name
, 5 column_sort
, rn row_name
, decode(cn, 'A', v, 'B', v, 0) column_value
from
...
 
Thanks nagornyi!

Does it mean that most of the work should be done in data model and not in layout?
Comparing to some other tools (brio, sqr, crystal...) - the select is very simple (and can be used for several reports) and computed fields / filter / sort etc. are supported in the tool.

Thanks again,
-Bracha
 
You are right, in this particular case Oracle Reports is less powerful, then other tools.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top