Help! Set Break Order Property

Dicas e truques sobre Oracle Reports Builder - modo gráfico ou modo caractere, ascii, arquivo .PRT, etc
Post Reply
diegorp
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 49
Joined: Mon, 23 Mar 2009 10:44 am
Location: Sapiranga - RS

Good afternoon, I need to change the ordering of the report before running, all the ways I tried did not have effects ... in my matrix report has the field id_product and description, at the time of turning the report I want to choose by which field I want to order, so if I leave the 2 courses with the Break property Order = Ascending, it only obeys a field ... I want to set this property before printing.
priajf
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 297
Joined: Tue, 21 Dec 2010 8:45 am
Location: Florianopolis

If you put an order by them. does not work?
tiago.steil
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 17
Joined: Thu, 01 Jul 2010 3:22 pm
Location: RS
Oracle Developer

You have to put the order by the query of the report not the field in the field you leave the name option.

And a way to do is put on Query with a parameter, ex:

Select all

select codigo 
,        descricao 
from tabela 
where parametro = '1' 
order by codigo 
union 
select codigo 
,        descricao 
from tabela 
where parametro = '2' 
order by descricao
gfkauer
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 389
Joined: Tue, 27 Jul 2010 1:34 pm
Location: Sapiranga - RS
Contact:
Quem falou que programar era fácil??

Quanto mais dificil for a implementação mais valorizado seu trabalho será!

Acessem: www.gfkauer.com.br

Take care, a Union can break the performance of the report.

The idea of ??parameterizing is excellent. But try something like this:



reminding that 1 and 2 in ordering refers to the order of the columns.
diegorp
Rank: Programador Sênior
Rank: Programador Sênior
Posts: 49
Joined: Mon, 23 Mar 2009 10:44 am
Location: Sapiranga - RS

So ... I have a screen in the form that calls this report on this screen has a list where I have the option to choose the ordering of the report, sort for ID or description .... in the main block of the report I have three fields ID_NCM, ID_Product and Description, Report needs to have at least one of these fields with set Break set, if I leave the ID field and the field described with this set property ... Order by Query does not obey because I'm passing him The following:

Sort by ID:

Select all

:P_ORDEM := order by se.id_produto asc
And then I play this on the Query of the report like this:

Select all

 WHERE se.id_produto = pr.id_produto 
   AND se.id_local_estoque IN 
       (SELECT l.id_local_estoque 
          FROM local_estoque l 
         WHERE l.id_local_estoque_pai = :p_id_local_estoque_pai 
           AND l.id_local_estoque = 
               nvl(:p_id_local_estoque, l.id_local_estoque)) 
   AND trunc(se.dt_saldo) = 
       (SELECT trunc(MAX(se1.dt_saldo)) 
          FROM saldo_estoque se1 
         WHERE se.id_produto = se1.id_produto 
           AND se.id_local_estoque = se1.id_local_estoque) &p_ordem

99] If the ordering is by description, then the parameter :p_ordem := order by pr.descricao asc and then plays at Query and runs the report, it always worked, but I think this time this time is giving problem because the report is a matrix, I think. ... if someone understood ... and can help me .... the report has the command set break order property, if someone used it and can help me .... feel free ... thanks!
aschnell
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 1
Joined: Tue, 17 Apr 2012 10:01 am

Good morning,
I had a similar problem and I decided as follows:
- I put a decode in the select, example:

Select all

select decode(:p_ordem , 'A', codigo, 'B', descricao) ordem, 
         codigo, 
        descricao 
from tabela 
order by ordem;
: p_ordem is The parameter of the report if it is equal to "a" orders by the code, if equal to "B" orders by the description.

Important Detail: It has to be the first field of Query in the report marked with "Break Order" ascend.

does so it will work right!

embrace,

Alex Schnell
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests