Enviar email via reports.

Dicas e truques sobre Oracle Reports Builder - modo gráfico ou modo caractere, ascii, arquivo .PRT, etc
Responder
Avatar do usuário
rcruz
Rank: Programador Pleno
Rank: Programador Pleno
Mensagens: 32
Registrado em: Ter, 04 Jan 2005 10:52 am
Localização: Candido Mota

Preciso gerar um report que após concluido envie a saida para o usuario via email. já tentei de varias formas, e descobri que o report envia a saida para o email automaticamnte configurando no system parameters. alguém pode me ajudar a realizar essa configuração e enviar o email.
Desde já agradeço.

Robson :evil: :-o
Avatar do usuário
dr_gori
Moderador
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

fala rcruz

Alguns parametros devem ser setados:

Selecionar tudo

DESTYPE=mail
DESNAME=seu_email@blablabla   (separados por vírgula se for mais que um)
Deve-se ter um serviço de email rodando na máquina.
Quando eu rodei aqui nessa máquina pela primeira vez, ele abriu uma tela para configurar... Tente aí e coloque as dicas pra nós! :-o
Avatar do usuário
rcruz
Rank: Programador Pleno
Rank: Programador Pleno
Mensagens: 32
Registrado em: Ter, 04 Jan 2005 10:52 am
Localização: Candido Mota

Ok Véio. Deu certo mas a extensão que ele coloca é .eps. No meu caso é preciso vir com a extensão .doc ou .pdf. você sabe como faço isso.

Grato :-o :-o
Avatar do usuário
dr_gori
Moderador
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

Achei um paper no metalink que fala sobre isso (vou anexar ele abaixo)

De acordo com o paper, os motivos pra estar acontecendo isso podem ser:
* Tem um cliente de EMAIL rodando, tipo exchange ou Netscape
* Ou, o reports está mandando pra um tipo de "driver" da impressoa...

Pra mudar, você deve fazer assim:

METODO 1:
Mandar direto pro EMAIL da pessoa (sem mandar pra tela), com as seguintes configurações:

Selecionar tudo

DESTYPE: MAIL
DESFORMAT: PDF or HTML
DESNAME: blablabla@email.com
METODO 2:
Regerar o relatório, através de um botão.
Coloca um botão no layout editor chamando "enviar por email"
Daí coloca o código que está la embaixo... (dá uma olhada)
Doc ID: Note:106549.1
Subject: How to send Oracle Reports output via email in specific format other than eps?
Type: BULLETIN
Status: PUBLISHED

Content Type: TEXT/PLAIN
Creation Date: 26-APR-2000
Last Revision Date: 09-DEC-2003

PURPOSE

--------------

You are trying to send an Oracle Report output via email and the output

is in postscript. Instead you would like to send it in PDF or HTML format.

SCOPE & APPLICATION

-------------------------------------

This document describe how to send reports output via email in different

formats other than the default postscript format for instance PDF, HTML ...etc.

The document assumes that email client is already setup on the PC and Reports

could be sent successfully.

How to send Oracle Reports Output Via email in Specific format other than eps?

Why Emailing Reports Output is as Postscript (EPS) Format:

--------------------------------------------------------------------------------

- You have a MAPI email complaint setup. I.e. Netscape Messenger or MS Exchange.

- You have a report running in the previewer and would like to email it

- The Reports Previewer Formats the output in PS, because it is the script that

the printers use to produce bitmap output. So when you email the output using the

previewer directly it is attached to your email as PS document.

- To view the document you need a postscript viewer like Ghost View.

Emailing Report Output in Other Formats:

-------------------------------------------------------

There are two methods to email the Report output in HTML, PDF or RTF format:

Method 1: Directly email the output

-------------

This is done by directing the email output to be directly sent via email without previewing it

in the Report Previewer,

This is achived by setting the following parameters:

DESTYPE: MAIL

DESFORMAT: PDF or HTML

DESNAME: Name of the email id i.e. jaburrub@aí.oracle.com

The result will be an email message with the output attached as the target format.

Method 2: Have a look at the output in the previewer before emailing it

---------------

Since the Reports Previewer formats the output in PS, you need to reformat (re-run)

the report again in the required format. In order to do so follow these steps :

- Add a button in the report layout editor.

- Label the button 'Email the Output'

- In the button PL/SQL use srw.run_report to call the same report again with the

following parameters:

DESTYPE: MAIL

DESFORMAT: PDF or HTML

DESNAME: Name of the email id i.e. jaburrub@aí.oracle.com

BATCH: Yes

SRW.RUN_REPORT examples in the online help of Oracle Reports

/* Suppose you have the following two reports:

** MGR_RUN, which queries manager names, and invokes a second report named MAIL_IT

** MAIL_IT, which queries employee names for the manager that MGR_RUN passes it,

** and sends the report output to the manager via e-mail.

** The description of MGR_RUN could be as follows:

** Query:

Selecionar tudo

SELECT ENAME, EMPNO FROM EMP WHERE JOB='MANAGER'
** Group Filter:

*/

Selecionar tudo

FUNCTION FOO RETURN BOOLEAN IS

BEGIN

srw.run_report('report=MAIL_IT

desname='||:ename ||' desformat=html batch=yes

mgr_no='|| TO_CHAR(:empno) );

RETURN (TRUE);

EXCEPTION

when srw.run_report_failure then

srw.message(30, 'Error mailing reports.');

raise srw.program_abort;

END;
/* This PL/SQL invokes MAIL_IT, specifies that MAIL_IT's output

** should be sent to the manager via Oracle Mail, and passes the

** manager number, so that the MAIL_IT report can query only the

** manager's employees.

** Note: EMPNO's values must be converted to characters

** (TO_CHAR in the PL/SQL above), because SRW.RUN_REPORT

** requires a character string.

** Layout: None is needed, because this report only fetches data,

** then passes it to a second report.

** The description of MAIL_IT could be as follows:

** Query:

Selecionar tudo

SELECT DEPTNO, ENAME, SAL FROM EMP WHERE MGR=:MGR_NO
** Layout: Master/Detail

*/

/* Suppose that you have three reports that you almost always run together.

** The reports are named SALARY, COMMISS, and TAXES. To run these reports

** with one R30RUN command, you create a driver report named PAYROLL.

** The description of PAYROLL could be as follows:

** Query:

Selecionar tudo

SELECT DEPTNO FROM DEPT
** Before Report Trigger:

*/

Selecionar tudo

FUNCTION FOO RETURN BOOLEAN IS

BEGIN

srw.run_report('batch=yes report=SALARY

destype=file desformat=dflt desname=salary.lis');

srw.run_report('batch=yes report=COMMISS

destype=file desformat=dflt desname=comiss.lis');

srw.run_report ('batch=yes report=TAXES

destype=file desformat=dflt desname=comiss.lis');

RETURN (TRUE);

END;
/* Layout: Tabular

** When you run PAYROLL from the designer or R30RUN, the other three

** reports will all be run. (Note that, in this case, the query and

** the layout for Payroll could be anything. They are only used here

** in order to make it possible to run PAYROLL.)

*/

-- Simple Example

Selecionar tudo

procedure U_1ButtonAction is

begin

srw.run_report('report=emp.rdf destype=mail desname=jaburrub@aí.oracle.com desformat=PDF

batch=yes');

end;
Summry:

--------------

In order to email the report in a desired format other than the default PS format,

re-run the report in batch mode to generate the output in the desired format.

RELATED DOCUMENTS

---------------------------------------

Oracle Reports on-line help

References:

------------

Bug 1273155 : Changing the name of the attachment which is send (Enhancement Request)

Bug 583949 : Possibility to send a subject line (Enhancement Request)
Avatar do usuário
rcruz
Rank: Programador Pleno
Rank: Programador Pleno
Mensagens: 32
Registrado em: Ter, 04 Jan 2005 10:52 am
Localização: Candido Mota

Deu certo como PDF. Mas tem um probema. Via application não funciona. Há uma maneira de fazer isso funcionar no application???
:-o Robson :-o
tchuck
Rank: Analista Júnior
Rank: Analista Júnior
Mensagens: 70
Registrado em: Seg, 04 Dez 2006 9:22 am
Localização: Maringá

Para envio de mais de uma pessoa não tem como fazer separados por virgula ate agora não achei modo de fazer isso. já testei com virgula, com ponto e virgula, espacos, de varios modos.. não tive outra opcao a não ser fazer um loop e pegar um email de cada vez.
Abraços
roots17
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Mensagens: 2
Registrado em: Ter, 11 Jul 2006 10:56 am
Localização: rj
Att,
Roots17

Bom dia.

alguém já conseguiu fazer o Report enviar o PDF atachado em e-mail, de forma automática, no Application?

Grande abraco
eng.nunoneves
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Mensagens: 2
Registrado em: Qui, 25 Fev 2010 8:47 am
Localização: Porto

Bom dia,

alguém sabe como se altera o nome do ficheiro em anexo?
Agradeço desde já a ajuda, obrigado!

Cumprimentos,
Nuno Neves.
eng.nunoneves
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Mensagens: 2
Registrado em: Qui, 25 Fev 2010 8:47 am
Localização: Porto

Alterar o nome do ficheiro em anexo quando o envio é via Reports Server.
Obrigado!
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 10 visitantes