Question

Documentation for the parameters in the PDF_REPORT_CREATED event

  • 10 June 2021
  • 6 replies
  • 87 views

Userlevel 5
Badge +13

Hi all,

I am trying to activate an event action that send the report “Customer Statement of Account” to the customers email address. But I am having a hard time getting it to work. All the parameters starting with pdf_ are blank.

 

Is there any documentation for the parameters?


6 replies

Userlevel 6
Badge +9

Hello @Hans Andersen ,

Have you checked the F1documentation page which I have attached below as a document?

 

Cheers!

Userlevel 5
Badge +13

@Imal Thiunuwan ,

Yes I have. 

To my understanding, the pdf parameters are set through application code (most be IEE in this case). I therefore presumed that some of them had values. They are all empty.

I probably overlooksomething obvious.

Userlevel 6
Badge +9

Hello @Hans Andersen ,

 

Yes, the pdf_parameters are set by the code.  The thing is that you will have to create separate event actions for each report that you want to send emails. You can change the values for the conditions by using the “Conditions for performing this action” option. Also, the parameter values can be assigned as mentioned in the F1Doc like below.

Defining default values for event parameters of the above PDF_REPORT_CREATED event can be done in Report Definition file (.rdf) of each report. Default values for PDF_PARAMETER_1 to PDF_PARAMETER_10 can be defined this way using interface in PdfReportEventParam logical unit.

You can set values as per your choice by using the above mentioned method or add conditions as mentioned in the f1 documentation.

Hope this helps.

Cheers!

Userlevel 5
Badge +13

@Imal Thiunuwan, Thanks for your replay.

I did look at this. I can do this:

pdf_report_event_param_api.New_Parameter('CUST_STMT_ACCT_REP', 'PDF_PARAMETER_1', 'STRING', 'mail@company.dk');

But that is default value. For each customer, I need a different email. 

 

Userlevel 6
Badge +9

Hello @Hans Andersen ,

Thank you for the information. Could you please check below community post? Not sure if it answers your question. But worth to check it.

Also you can use a cursor with custom logic like below to get the emails and use PDF_REPORT_CREATED event to send out the pdf file.

DECLARE

  email_ VARCHAR2(200);

  CURSOR get_email IS
    SELECT email 
    FROM <...> 
    WHERE <...>;

BEGIN
  
IF <validation to run for the desired report>
  OPEN get_email;
  FETCH get_email
    INTO email_;
  CLOSE get_email;

  command_sys.mail(<from_user>,
                   email_,
                   <subject>,
                   <text>,
                   attach_ => '&PDF_FILE');
                   
END IF;
END;

=========================================================================

Also, Following is a code sample how to set event params in PDF_REPORT_CREATED event

DECLARE
send_pdf_info_ VARCHAR2(4000);
BEGIN

send_pdf_info_ := Message_SYS.Construct('PDF');
Message_SYS.Add_Attribute(send_pdf_info_, 'PDF_EVENT_PARAM_1',CUSTOMER_EMAIL);
...
Client_SYS.Add_To_Attr('SETTINGS', send_pdf_info_, print_job_attr_);
Print_Job_API.New(print_job_id_, print_job_attr_);

END;

 

Now you should be able to access the email from PDF_PARAMETER_1 of the event.

Cheers!

Userlevel 5
Badge +13

@Imal Thiunuwan

Thanks for the link. Unfortunate, this is when there IS data in a pdf_parameter. In our case they are all empty.

We might have to do some coding as you suggest. It just puzzles me that it should be necessary. I have a feeling that something is wrong in our setup.

Reply