TUDO BEM GALERA !!!!
GOSTARIA DE SABER COMO CONSIGO TRAZER PARA DENTRO DO UMA FORMULA COLUMN O VALOR DO TOTAL DE PÁGINAS DO RELATÓRIO.
RICARDO
TOTAL DE PÁGINAS
- dr_gori
- Moderador
- Mensagens: 5024
- Registrado em: Seg, 03 Mai 2004 3:08 pm
- Localização: Portland, OR USA
- Contato:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Cria um boilerplace e coloca o seguinte texto nele:
Outra forma é você criar um FIELD e escolher no source ele "Total phisical Pages"
Página &<PageNumber> de &<TotalPages>
- dr_gori
- Moderador
- Mensagens: 5024
- Registrado em: Seg, 03 Mai 2004 3:08 pm
- Localização: Portland, OR USA
- Contato:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Dá uma olhada nesse tópico...
http://glufke.net/oracle/viewtopic.php?t=550
O cara fez algo parecido.
http://glufke.net/oracle/viewtopic.php?t=550
O cara fez algo parecido.
-
- Rank: Estagiário Pleno
- Mensagens: 6
- Registrado em: Sex, 07 Jan 2005 9:09 am
- Localização: Assis/SP
ISSO NÃO PODERÁ ME AJUDAR !!!!
COMO O RELATÓRIO É LIVRO FISCAL MICROFILMADO ONDE CADA MICROFILME RECEBE 175 PÁGINAS, NECESSITAREI INFORMAR LOGO NO TERMO DE ABERTURA A QUANTIDADE DE PÁGINAS E A QUANTIDADE DE MICROFILMES = (TOTAL DE PÁGINAS / 175).
RICARDO
COMO O RELATÓRIO É LIVRO FISCAL MICROFILMADO ONDE CADA MICROFILME RECEBE 175 PÁGINAS, NECESSITAREI INFORMAR LOGO NO TERMO DE ABERTURA A QUANTIDADE DE PÁGINAS E A QUANTIDADE DE MICROFILMES = (TOTAL DE PÁGINAS / 175).
RICARDO
- dr_gori
- Moderador
- Mensagens: 5024
- Registrado em: Seg, 03 Mai 2004 3:08 pm
- Localização: Portland, OR USA
- Contato:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Realmente, essa dica acima não te ajuda, pois você precisa recuperar o TOT PAGE NUM.
Eu achei um post no metalink. Eu testei e funcionou!
Eu achei um post no metalink. Eu testei e funcionou!
Doc ID: Note:130432.1
Subject: HOW TO PRINT THE REPORT TOTAL PAGES ONLY AT THE LAST PAGE
Type: BULLETIN
Status: PUBLISHED
Content Type: TEXT/X-HTML
Creation Date: 11-DEC-2000
Last Revision Date: 05-DEC-2001
SCOPE & APPLICATION
-------------------
This document gives a workaround to get the report total pages number
and use it, in the format trigger of a field so that will be printed
ONLY at the last page of the report.
The problem is that you cannot refer to a field with source total_pages
in the format trigger of another field without getting the error 'REP-730
The following bind variable is not defined', and also there is not any build
in function (like srw.get_page_num) to calculate the report total pages.
HOW TO PRINT REPORT TOTAL PAGES AT LAST PAGE
--------------------------------------------
1. Add in the report 2 fields : total_pages with source 'Total Pages' and
page_num with source 'Page Number'.
2. Create in the database a table page_num to store the number of pages of the
report. You can also add in this table another column to store the session id
in order to insert the page numbers with a unique identifier
for this report instance and be able to use this technique for multiple reports.
The description of the table page_num will be:
Name Type
------------------------------- ----
SESSION_ID NUMBER(10)
PAGE_NUM NUMBER(10)
(You can also use a local package variable to store the page number instead of
inserting it in a database table).
In the format trigger of the field total_pages write the following code in order
to get the total pages of the report and insert this number in a table:
function total_pagesFormatTrigger return boolean is
page_num number;
a number(3);
begin
srw.get_page_num (page_num);
a:= page_num;
insert into page_num values(global.session_id,a);
commit;
return (TRUE);
end;
global.session_id comes from a package variable you have previously created in
order to get the session id.
The package specification and body is as follows:
PACKAGE global IS
session_id number(10) ;
END;
PACKAGE BODY global IS
begin
select sid
into session_id
from v$session
where audsid = userenv('sessionid') ;
END;
In the format trigger of the page_num field write the following code in order to
retrieve the total pages from the database, compare it with the current page
and print it if current page is equal to the last page:
function page_numFormatTrigger return boolean is
this_page number;
a number;
b number;
begin
srw.get_page_num(this_page);
a := this_page;
select max(page_num) into b from page_num
where session_id = global.session_id;
if a = b then
return(TRUE);
else
return(FALSE);
end if;
end;
Finally delete the records in the page_num table after the report ends
in the After Report Trigger:
function AfterReport return boolean is
begin
srw.do_sql('delete from page_num where session_id = ' || to_char(global.session_id));
srw.do_sql('commit');
return (TRUE);
end;
- dr_gori
- Moderador
- Mensagens: 5024
- Registrado em: Seg, 03 Mai 2004 3:08 pm
- Localização: Portland, OR USA
- Contato:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Com essa dica acima, você consegue descobrir o número de paginas total, aplicando o
Pra colocar esse valor na pagina inicial, basta você colocar esse código acima dentro de um bloco PL/SQL de um FIELD qualquer E depois faz assim pra mostrar o valor de b no campo:
ou seja, vada vez que o field aparecer na tela, ele vai buscar o MAX e mostrar no campo!
Tenta isso!
select max(page_num) into b from page_num
where session_id = global.session_id;
srw.set_field(0, b);
Tenta isso!
- dr_gori
- Moderador
- Mensagens: 5024
- Registrado em: Seg, 03 Mai 2004 3:08 pm
- Localização: Portland, OR USA
- Contato:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Bom, se não for incomodo, tem como você colocar aí o que você fez?
(tipo, daí fica a dica pra mais alguém)
valeu
(tipo, daí fica a dica pra mais alguém)
valeu
- Toad
- Rank: DBA Pleno
- Mensagens: 253
- Registrado em: Sex, 18 Nov 2005 2:14 pm
- Localização: Seattle, WA
- Contato:
Matheus Gonçalves
matheus.dev
twitter.com/developer__c
matheus.dev
twitter.com/developer__c
Mas dr_gori, apliquei esse exemplo, ele até retorna o valor correto, mas somente na última página. Eu preciso que esse valor seja mostrado em todas as páginas. Só que, quando ele inseriu o último valor na tabela (o da efetiva última página), ele já "criou" a página. Como fazer para que o valor da última página apareça em todas elas? Seria possível? Eu to me matando aqui e não chego a lugar nenhum.
Queria algo assim:
Página 1, exibe: 01/175
Página 2, exibe: 02/175
Página 3, exibe: 03/175
Lembrando que esse valor hipotético 175 eu consigo com alguns cálculos que envolvem o processo anterior ( insert into page_num values(global.session_id,a); ), portanto não posso usar &Total_Logical_Pages simplesmente.
Há algo que possa ser feito?
Queria algo assim:
Página 1, exibe: 01/175
Página 2, exibe: 02/175
Página 3, exibe: 03/175
Lembrando que esse valor hipotético 175 eu consigo com alguns cálculos que envolvem o processo anterior ( insert into page_num values(global.session_id,a); ), portanto não posso usar &Total_Logical_Pages simplesmente.
Há algo que possa ser feito?
- passageiromr
- Rank: Estagiário Pleno
- Mensagens: 7
- Registrado em: Ter, 24 Out 2006 10:15 am
- Localização: Santa Cruz do Rio Pardo
- Contato:
Bom dia, a dica de pegar o número da ultima pagina, só que eu precisava passar esse número por extenso em um livro fiscal que estou fazendo, desde já obrigado.
atenciosamente Eli.
atenciosamente Eli.
-
- Rank: Estagiário Sênior
- Mensagens: 10
- Registrado em: Seg, 09 Fev 2009 3:12 pm
- Localização: Sapiranga
estou com o mesmo problema do ricardo alguém pode me ajudar , com obter o numero total de páginas na primeira página alterando a página inicial?
-
- Rank: Programador Sênior
- Mensagens: 58
- Registrado em: Sex, 30 Out 2009 9:52 am
- Localização: Salvador - BA
- Contato:
Atenciosamente,
João Paulo A. C. do Bomfim
"Deu certo? Deixa! Funcionou? Não mexa!"
João Paulo A. C. do Bomfim
"Deu certo? Deixa! Funcionou? Não mexa!"
Eu simplesmente consegui isso colocando 2 << Field >> em Body.
Dei um duplo-click no primeiro e, na guia Object, em Source > From: eu selecionei a opção << &Logical Page Number >> representando assim a Página Atual.
Já no segundo << Field >> eu fiz o mesmo procedimento, porém a opção selecionada foi << &Total Logical Pages >> representando o Total de Páginas geradas.
Página 1, exibe: 1/5
Página 2, exibe: 2/5
Página 3, exibe: 3/5
SUCESSO!!!
Não foi necessária nenhuma programação e, isso foi feito no Reports 2.5 aqui na empresa.
Dei um duplo-click no primeiro e, na guia Object, em Source > From: eu selecionei a opção << &Logical Page Number >> representando assim a Página Atual.
Já no segundo << Field >> eu fiz o mesmo procedimento, porém a opção selecionada foi << &Total Logical Pages >> representando o Total de Páginas geradas.
Página 1, exibe: 1/5
Página 2, exibe: 2/5
Página 3, exibe: 3/5
SUCESSO!!!
Não foi necessária nenhuma programação e, isso foi feito no Reports 2.5 aqui na empresa.
- dr_gori
- Moderador
- Mensagens: 5024
- Registrado em: Seg, 03 Mai 2004 3:08 pm
- Localização: Portland, OR USA
- Contato:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Sim, mas o workaround citado acima é pra manipular essa informação. Digamos que a primeira página tem que ficar com o número 20, por exemplo. (pra ser anexado em livros fiscais, etc, que tem que ter a numeração conforme o livro anterior)...
-
- Rank: Programador Sênior
- Mensagens: 58
- Registrado em: Sex, 30 Out 2009 9:52 am
- Localização: Salvador - BA
- Contato:
Atenciosamente,
João Paulo A. C. do Bomfim
"Deu certo? Deixa! Funcionou? Não mexa!"
João Paulo A. C. do Bomfim
"Deu certo? Deixa! Funcionou? Não mexa!"
Sem problema.
Acabo de testar aqui.
Dei um duplo click no << field >> da Página Atual e existe um botão titulado << Page Numbering... >>.
Ao dar um click nele abre-se uma nova janela onde tem uma opção << Start at: >> alterei de 1 para 20.
Fiz o mesmo procedimento para o segundo << field >>.
SUCESSO!
Página 1, exibe: 20/25
Página 2, exibe: 21/25
Página 3, exibe: 22/25
lembrando: Reports 2.5
Acabo de testar aqui.
Dei um duplo click no << field >> da Página Atual e existe um botão titulado << Page Numbering... >>.
Ao dar um click nele abre-se uma nova janela onde tem uma opção << Start at: >> alterei de 1 para 20.
Fiz o mesmo procedimento para o segundo << field >>.
SUCESSO!
Página 1, exibe: 20/25
Página 2, exibe: 21/25
Página 3, exibe: 22/25
lembrando: Reports 2.5
-
- Rank: Estagiário Júnior
- Mensagens: 1
- Registrado em: Qui, 17 Dez 2009 12:03 pm
- Localização: LINS - SP
Fabio Erik Goncalves
Ola Pessoal,
Encontrei um codigo enviado pelo dr. Gori como segue abaixo:
<<<<INICIO>>>>>>>>>
porem pelo que estou percebendo a trigger do field page_num esta sendo executado antes da trigger do field total_pages, ou seja quando pego o select max(page_num) obtenho como retorn null, sera que esse problema esta relacionado com hierarquia de execucao? tem como manipular isso, sera que alguém sabe o que estou fazendo errado?
desde já agradeco a atencao.
abraco
Encontrei um codigo enviado pelo dr. Gori como segue abaixo:
<<<<INICIO>>>>>>>>>
<<<<FIM>>>>>>>>>Doc ID: Note:130432.1
Subject: HOW TO PRINT THE REPORT TOTAL PAGES ONLY AT THE LAST PAGE
Type: BULLETIN
Status: PUBLISHED
Content Type: TEXT/X-HTML
Creation Date: 11-DEC-2000
Last Revision Date: 05-DEC-2001
SCOPE & APPLICATION
-------------------
This document gives a workaround to get the report total pages number
and use it, in the format trigger of a field so that will be printed
ONLY at the last page of the report.
The problem is that you cannot refer to a field with source total_pages
in the format trigger of another field without getting the error 'REP-730
The following bind variable is not defined', and also there is not any build
in function (like srw.get_page_num) to calculate the report total pages.
HOW TO PRINT REPORT TOTAL PAGES AT LAST PAGE
--------------------------------------------
1. Add in the report 2 fields : total_pages with source 'Total Pages' and
page_num with source 'Page Number'.
2. Create in the database a table page_num to store the number of pages of the
report. You can also add in this table another column to store the session id
in order to insert the page numbers with a unique identifier
for this report instance and be able to use this technique for multiple reports.
The description of the table page_num will be:
Name Type
------------------------------- ----
SESSION_ID NUMBER(10)
PAGE_NUM NUMBER(10)
(You can also use a local package variable to store the page number instead of
inserting it in a database table).
In the format trigger of the field total_pages write the following code in order
to get the total pages of the report and insert this number in a table:
function total_pagesFormatTrigger return boolean is page_num number; a number(3); begin srw.get_page_num (page_num); a:= page_num; insert into page_num values(global.session_id,a); commit; return (TRUE); end;
global.session_id comes from a package variable you have previously created in
order to get the session id.
The package specification and body is as follows:PACKAGE global IS session_id number(10) ; END; PACKAGE BODY global IS begin select sid into session_id from v$session where audsid = userenv('sessionid') ; END;
In the format trigger of the page_num field write the following code in order to
retrieve the total pages from the database, compare it with the current page
and print it if current page is equal to the last page:
Finally delete the records in the page_num table after the report endsfunction page_numFormatTrigger return boolean is this_page number; a number; b number; begin srw.get_page_num(this_page); a := this_page; select max(page_num) into b from page_num where session_id = global.session_id; if a = b then return(TRUE); else return(FALSE); end if; end;
in the After Report Trigger:function AfterReport return boolean is begin srw.do_sql('delete from page_num where session_id = ' || to_char(global.session_id)); srw.do_sql('commit'); return (TRUE); end;
porem pelo que estou percebendo a trigger do field page_num esta sendo executado antes da trigger do field total_pages, ou seja quando pego o select max(page_num) obtenho como retorn null, sera que esse problema esta relacionado com hierarquia de execucao? tem como manipular isso, sera que alguém sabe o que estou fazendo errado?
desde já agradeco a atencao.
abraco
-
- Informação
-
Quem está online
Usuários navegando neste fórum: Nenhum usuário registrado e 10 visitantes