This content has been marked as final. Show 7 replies
Since every report is run separately, it will create separate emails when using standard Reports mail functionality. So, you need to run the two reports, save them, and kick off some other process after the two reports are finished.
That process can be anything. I have used database package APEX_MAIL to make emails with multiple attachment. Since every database has Apex installed, you can easily use this package. It has a procedure called apex_mail.add_attachment that you call multiple times.
Another option might be to use some command line mail tool that you call after running the reports.
Isn't there any kind of examples ?
With loop cycles mby it could be done ?
If you need more help, you have to give more details, like:
- What Forms version are you using?
- What is the code you have so far?
Code sample i will give tomorow, because now i am at home...
I am using Oracle Forms 6i and Oracle Report 6.
Here is code which generates report:
GENERATE(report1, --1st report name report2, --2nd report name '4', --MAIL 'PDF', NULL, NULL, 1);
Edited by: Raivis on 2013.3.5 00:34
PROCEDURE GENERATE(p_filename IN VARCHAR2, p_filename3 IN VARCHAR2, p_destype IN VARCHAR2, p_desformat IN VARCHAR2, p_desname IN VARCHAR2, p_desname3 IN VARCHAR2, p_execution_mode IN VARCHAR2) IS list_id ParamList; rep_id Report_Object; grp_id RecordGroup; dbs VARCHAR2(80); destype VARCHAR2(20); desformat VARCHAR2(20); desname VARCHAR2(100); background VARCHAR2(20); v_rep VARCHAR2(100); other_par VARCHAR2(100); report_mode VARCHAR2(100); cmd VARCHAR2(2048); cmd2 VARCHAR2(2048); alert_id Alert; alert_but NUMBER; BEGIN other_par := 'PARAMFORM=NO'; IF p_destype = '4' THEN Set_Report_Object_Property(rep_id,REPORT_DESTYPE,MAIL); Set_Report_Object_Property(rep_id,REPORT_DESFORMAT,p_desformat); END IF; list_id := Get_Parameter_List('report_params'); IF Id_Null(list_id) THEN list_id := Create_Parameter_List('report_params'); END IF; grp_id := Find_Group('report_params'); IF NOT Id_Null(grp_id) THEN Group_To_Parameter(grp_id,list_id); END IF; Add_Parameter(-----); --adding parametrs but that isn't necessary to show it i think IF p_desname IS NOT NULL THEN Set_Report_Object_Property(rep_id,REPORT_DESNAME,p_desname); ELSE Set_Report_Object_Property(rep_id,REPORT_DESNAME,''); END IF; IF p_filename IS NOT NULL THEN v_rep := Run_Report_Object(rep_id,list_id); END IF; IF p_filename3 IS NOT NULL THEN Set_Report_Object_Property(rep_id,REPORT_FILENAME,p_filename3); Set_Report_Object_Property(rep_id,REPORT_DESNAME,p_desname3); v_rep := Run_Report_Object(rep_id,list_id); END IF; Destroy_Parameter_List(list_id); EXCEPTION WHEN OTHERS THEN RAISE; END;
Edited by: Raivis on 2013.3.5 01:20
Have someone idea ?
Do not use destype=MAIL, but FILE. You create two files and later put them in one email. Using APEX_MAIL is just an option. APEX_MAIL is a simple wrapper around more complicated UTL_SMTP:1 person found this helpful
Create the two output files in a directory that is accessible from the database. That way you can create an external table to get the files in a BLOB:
If all this gets too complicated, the easiest option might be to merge the two reports into just one report.