I finally got to the bottom of getting nicely formatted output sent to my e-mail and thought I'd share it. The disclaimer is this works for my environment here, no promises it will work for yours. I'll bet some of you even have a better way for doing this. If so, please post below. Anyway, I have an Oracle stored procedure in our utility package that collects some database stats that I need to monitor daily. The procedure uses an OUT parameter to pass a refcursor back that points to the formatted output. I can run it manually from Toad and the output is in a proportional font and looks nice, all lined up, etc.
I created a VC job to run this procedure and the STDOUT (found when double-clicking the output of the task in VC) shows the output in a proportional font as well, text all lined up, etc. However, when I send the STDOUT to my Outlook e-mail as text using {TASK(PrevTask|StdOut)}, it displays by default in a non-proportional font and thus is difficult to read. To get it to send in a proportional font, I send it as HTML from VC with the following as the body of the HTML text. In my environment, it is received by Outlook as an HTML e-mail in Courier New with the same formatting as I coded for in the stored procedure.
I understand that whether or not this works may be dependent on your e-mail client settings, etc, but I hope this helps someone out there trying to do the same thing. Let me know if it helped you.
<!--
The <tt> tag means use a proportional font.
The <pre> tag means the text is pre-formatted so don't touch multiple spaces,
line breaks, etc. It should match what the previous task output looks like
in VisualCron without having to specify HTML tags beyond what you see here
unless you need something fancy.
Outlook Should receive this as an HTML e-mail formatted with Courier New font.
-->
<html>
<body>
<tt><pre>{TASK(PrevTask|StdOut)}</pre></tt>
</body>
</html>
Edited by user
2020-02-26T14:27:41Z
|
Reason: Clarification of some details