1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| DECLARE
report_id REPORT_OBJECT;
report_job_id VARCHAR2(200);
rep_status VARCHAR2(200);
JOB_NUMBER number;
server_name VARCHAR2(200);
resultat VARCHAR2(10);
BEGIN
/** Le nom du serveur d'état **/
server_name := 'credits';
/** La liste des paramètres de l'état **/
IF get_application_property(user_interface) = 'WEB' THEN
report_id:= FIND_REPORT_OBJECT('ETAT');
/* Set Report parameters given WEB deployment */
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER , server_name);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
/* Formats supporté HTML, HTMLCSS, RTF,XML ou PDF */
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'DELIMITED');
/* Executer l'état */
report_job_id := RUN_REPORT_OBJECT(report_id);
/* Vérifier le statut de l'état */
rep_status:=REPORT_OBJECT_STATUS(report_job_id);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(report_job_id);
END LOOP;
IF rep_status='FINISHED' THEN
message('---- Etat executée avec succée ----');
resultat := 'OK';
/* Afficher l'état dans le navigateur du client */
JOB_NUMBER := length(server_name) + 2;
WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'||substr(report_job_id,JOB_NUMBER)||'?server=' || server_name ||'&mimetype=application/vnd.ms-excel','_BLANK');
/* If report has failed display message to user */
ELSE
message('Erreur d execution: '||rep_status);
resultat := 'NO';
END IF;
ELSE
/* Else if forms application is Client-Server deployed */
/* Set Report parameters given Client-Server deployment */
report_id:= FIND_REPORT_OBJECT('ETAT');
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER ,'');
/* Report to be executed via Reports Background Engine, not the 'new' Reports Multi-Tier Server */
/* Destype SCREEN or PREVIEW can be used here */
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,SCREEN);
/* Run the report */
report_job_id := RUN_REPORT_OBJECT(report_id);
resultat := 'OK';
END IF;
END; |
Partager