Consultor Eletrônico



Kbase 17031: Actuate API AcReqSetEUDTPath to view .roi in Viewer example
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Actuate API AcReqSetEUDTPath to view .roi in Viewer example

/* The following shows an example of how to use the Actuate API to */
/* view an existing .roi file in the Actuate Viewer. It uses */
/* AcReqSetEUDTPath to point directly to viewer.exe rather than */
/* using the default runview.exe which is the End User Desktop */


/* setEUDTPath.p */

/* ------------------------------------------------------------- */
/* --- LOCAL VARIABLE DECLARATION --- */
/* ------------------------------------------------------------- */

DEFINE VAR v-options AS INTEGER INITIAL 0.
DEFINE VAR ari_return AS INTEGER.
DEFINE VAR aru_return AS INTEGER Initial 0.
DEFINE VAR arvr_return AS INTEGER.
DEFINE var ACT_REPORT AS CHARACTER NO-UNDO.
DEFINE var ACT_DESTINATION AS CHARACTER NO-UNDO.

/*--------------- Interacting with the EUDT ---------------*/

DEFINE VAR AC_REQ_LAUNCH_ALWAYS AS INTEGER Initial 1.
DEFINE VAR AC_REQ_VIEW As INTEGER INITIAL 4. /* Views report */
DEFINE VAR AC_REQ_PRINT As INTEGER INITIAL 8. /* Prints report */

/* -----------------------------------------------------------------*/
/* Name of the report to be run and the destination (VIEW or PRINT) */
/* !!You must insert the path and name of a valid .roi file below!! */
/* -----------------------------------------------------------------*/

assign ACT_REPORT = "c:\actuate\Design1.roi"
ACT_DESTINATION = "VIEW".

/* ------------------------------------------------------------- */
/* --- INITIALIZE THE API --- */
/* ------------------------------------------------------------- */

RUN AcReqInitialize (OUTPUT ari_return).

/* ------------------------------------------------------------- */
/* --- DETERMINE IF THE REPORT IS VIEWED OR PRINTED --- */
/* --- AND PASS THIS TO AcRegGenerateReport --- */
/* ------------------------------------------------------------- */

CASE ACT_DESTINATION:
WHEN "VIEW" THEN v-options = v-options .
WHEN "PRINT" THEN v-options = v-options + AC_REQ_PRINT.
OTHERWISE DO:
MESSAGE "Invalid Print Destination" VIEW-AS ALERT-BOX.
RETURN.
END.
END CASE.

/* ------------------------------------------------------------- */
/* --- Run the report, and remove the .dll from memory --- */
/* ------------------------------------------------------------- */
Run AcReqSetEUDTPath("c:\actuate\devwb\bin\viewer.exe").
RUN AcReqViewReport(ACT_REPORT, v-options, OUTPUT arvr_return).
RUN AcReqUnInitialize (ari_return, OUTPUT aru_return).

/* ------------------------------------------------------------- */
/* --- EXTERNAL PROCEDURE DEFINITIONS TO THE reqst32.DLL --- */
/* ------------------------------------------------------------- */

PROCEDURE AcReqInitialize EXTERNAL
"c:\actuate\devwb\bin\reqst32.DLL" PERSISTENT:
DEFINE RETURN PARAMETER ari_return AS LONG.
END PROCEDURE.

PROCEDURE AcReqSetEUDTPath EXTERNAL
"c:\actuate\devwb\bin\reqst32.DLL":
DEFINE INPUT PARAMETER viewpath AS CHARACTER.
END PROCEDURE.

PROCEDURE AcReqViewReport EXTERNAL "c:\actuate\devwb\bin\reqst32.DLL":
DEFINE INPUT PARAMETER filename AS CHARACTER.
DEFINE INPUT PARAMETER options AS LONG.
DEFINE RETURN PARAMETER arvr_return AS LONG.
END PROCEDURE.

PROCEDURE AcReqUnInitialize EXTERNAL
"c:\actuate\devwb\bin\reqst32.DLL":
DEFINE INPUT PARAMETER ari_return AS LONG.
DEFINE RETURN PARAMETER aru_return AS SHORT.
END PROCEDURE.

Progress Software Technical Support Note # 17031