Save a report 6i PDF file onto the database server
758537Mar 22 2010 — edited Mar 23 2010Hello Experts,
I have a requirement, whereby I need to generate a PDF report and then send that report via Email. The problem I have is my email procedure is looking for the file which is in the directory on the server where the database is stored, While the PDF is generated on the local machine. Im using reports 6i.
I know in reports 10g the file is generated on the report server itself but Im afraid same is not the case with reports 6i.
The other problem is the local machine does not have the access to the directories on the server. I tried to change the directory path in the database to look at the C:\ but it doesn't work, it says invalid directory, I think the PDF report file needs to be on the server where the database is installed. Is there a way I can pick the PDF file from the local machine instead of the server where the database is installed?
Im not too sure what is the way forward, All I need is to generate a PDF file and mail it.
The procedure that I'm using to send the email attachment is :-
CREATE OR REPLACE PROCEDURE email_attachment(
xfilename VARCHAR2,
xloc VARCHAR2) IS
conn utl_smtp.connection;
BEGIN
conn := Send_Mail.begin_mail(
sender => 'xyz@example.com',
recipients => 'xyz@example.com',
subject => 'Attachment Test',
mime_type => Send_Mail.MULTIPART_MIME_TYPE);
Send_Mail.attach_text(
conn => conn,
DATA => '<b>This is a test Email.<b>',
mime_type => 'text/html');
send_mail.attach_base64_fromfile(
conn => conn,
filename => xfilename,--'test.pdf',
floc => xloc,--'File directory',
mime_type => 'application/octet',
inline => TRUE);
Send_Mail.end_attachment( conn => conn );
Send_Mail.end_mail( conn => conn );
Thanks any help would be appreciated.