From efe97411bc76f895b65d38645e033e2926841f0b Mon Sep 17 00:00:00 2001
From: Andrew McMillan
". +/* OUTPUT TO VALUE(txtrep-print-file) KEEP-MESSAGES APPEND PAGE-SIZE 0. */ +PUT CONTROL "~n~n". OUTPUT CLOSE. /* MESSAGE '"' + htmlrep-browser + '" ' + txtrep-print-file . */ -OS-COMMAND SILENT VALUE( 'START "' + htmlrep-browser + '" ' + txtrep-print-file ). - -PAUSE 10 NO-MESSAGE. +IF apms-spool EQ ? OR apms-spool EQ "" THEN DO: + OS-COMMAND VALUE( htmlrep-browser + '" ' + txtrep-print-file ). +END. DEF VAR dir-name AS CHAR NO-UNDO. dir-name = SUBSTRING( txtrep-print-file, 1, R-INDEX(txtrep-print-file, txtrep-delim) ). /* Save the file so we can see it later */ +OS-DELETE VALUE( dir-name + 'lastrep.html' ) NO-ERROR. OS-COMMAND SILENT VALUE( 'COPY "' + txtrep-print-file + '" "' + dir-name + 'lastrep.html"~n'). OS-DELETE VALUE( txtrep-control-file ) NO-ERROR. +/* OS-DELETE VALUE( txtrep-print-file ) NO-ERROR. +*/ END PROCEDURE. @@ -340,9 +354,9 @@ PROCEDURE htmlrep-start : ------------------------------------------------------------------------------*/ DEF INPUT PARAMETER page-title AS CHAR NO-UNDO. - - -PUT CONTROL "~n
~n
~n". +PUT CONTROL '~n' + + '~n
~n
~n" + + '~n'. txtrep-output-mode = "htmlrep". pclrep-preview-mode = TRUE. @@ -998,6 +1012,32 @@ END PROCEDURE. &ENDIF +&IF DEFINED(EXCLUDE-txtrep-do-email) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE txtrep-do-email Method-Library +PROCEDURE txtrep-do-email : +/*------------------------------------------------------------------------------ + Purpose: +------------------------------------------------------------------------------*/ +DEF INPUT PARAMETER email-string AS CHAR NO-UNDO. +DEF INPUT PARAMETER email-subject AS CHAR NO-UNDO. +DEF INPUT PARAMETER email-template AS CHAR NO-UNDO. + +IF email-string <> "" AND email-template <> "" THEN DO: + IF txtrep-output-mode = "pdf" THEN + PUT CONTROL "[-pdf-]>EMAIL:" + email-string + "|" + email-subject + "|" + email-template + "[-pdf-]". +END. +ELSE + MESSAGE "Email and email template parameters required" + VIEW-AS ALERT-BOX ERROR TITLE "Email or template blank". + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + &IF DEFINED(EXCLUDE-txtrep-initialise) = 0 &THEN &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE txtrep-initialise Method-Library @@ -1007,7 +1047,9 @@ PROCEDURE txtrep-initialise : ------------------------------------------------------------------------------*/ DEF VAR temp-dir AS CHAR NO-UNDO. - temp-dir = OS-GETENV("TEMP":U). + temp-dir = OS-GETENV("APMSTEMP":U). + IF temp-dir = ? OR temp-dir = "" THEN temp-dir = OS-GETENV("TMP":U). + IF temp-dir = ? OR temp-dir = "" THEN temp-dir = OS-GETENV("TEMP":U). IF temp-dir = ? OR temp-dir = "" THEN temp-dir = SESSION:TEMP-DIRECTORY . temp-dir = temp-dir + txtrep-delim. @@ -1051,32 +1093,6 @@ END PROCEDURE. &ENDIF -&IF DEFINED(EXCLUDE-txtrep-do-email) = 0 &THEN - -&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE txtrep-do-email Method-Library -PROCEDURE txtrep-do-email : -/*------------------------------------------------------------------------------ - Purpose: -------------------------------------------------------------------------------*/ -DEF INPUT PARAMETER email-string AS CHAR NO-UNDO. -DEF INPUT PARAMETER email-subject AS CHAR NO-UNDO. -DEF INPUT PARAMETER email-template AS CHAR NO-UNDO. - -IF email-string <> "" AND email-template <> "" THEN DO: - IF txtrep-output-mode = "pdf" THEN - PUT CONTROL "[-pdf-]>EMAIL:" + email-string + "|" + email-subject + "|" + email-template + "[-pdf-]". -END. -ELSE - MESSAGE "Email and email template parameters required" - VIEW-AS ALERT-BOX ERROR TITLE "Email or template blank". - -END PROCEDURE. - -/* _UIB-CODE-BLOCK-END */ -&ANALYZE-RESUME - -&ENDIF - &IF DEFINED(EXCLUDE-txtrep-pdf-filename) = 0 &THEN &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE txtrep-pdf-filename Method-Library @@ -1215,3 +1231,24 @@ END FUNCTION. &ENDIF +&IF DEFINED(EXCLUDE-tag) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION tag Method-Library +FUNCTION tag RETURNS CHARACTER + ( INPUT tagtype AS CHAR, INPUT tagtext AS CHAR, INPUT attributes AS CHAR ) : +/*------------------------------------------------------------------------------ + Purpose: Enclose the tagtext value in quotes + Notes: +------------------------------------------------------------------------------*/ + + RETURN "<" + tagtype + " " + attributes + ">" + + tagtext + + "" + tagtype + ">". + +END FUNCTION. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + -- 2.11.4.GIT