Outlook Email Report Template 7

Introduction

Outlook Email Report for Clarion 5-7 ABC/Legacy. Template allowing you to send Clarion, CPCS, RPM, DAS,  Tintools, and Icetips reports with MS Outlook as universal RTF attachment (which can be opened even with WordPad in all Windows OS starting from 95). Besides you can use template just for saving reports to disc in this universal format and for sending ordinary emails. No email settings are required from end-users.

The picture on the right side gives some idea how template works. Download 'Try before buy' shareware version of template and test it right in your application. You can have a quick look at emails generated by template as well.

 

 
Outlook Email Report sends Clarion reports as Reach Text Format (RTF) attachments.
To generate RTF files you don't need any expensive drivers (like PDF one).
Nor need you any third party programs to read them. If you have MS Office this file
will be opened with Word. Or with Windows WordPad otherwise.
It means all Windows recipients of such emails are just double-click away from
viewing and printing any Clarion report generated by your program.
Outlook Email Report template works in conjunction with MS Outlook.
So if your users prefer Outlook Express
you might want to use another template of ours - EmailReport.
Outlook Email Report directly supports all major report templates: Clarion, CPCS,
RPM, DAS, Tintools, and Icetips.
Potentially it can be used with much wider range of report templates.
That is why we've done free "Try before buy version" of this template for you
to make sure template does what you want.
Sending reports is the main job of Outlook Email Report template.
Nevertheless it can be used for composing and sending ordinary emails with Outlook.
So you can populate email Subject, Body, Addresses and attachments directly from
Clarion fields and send them one-by-one or in batch mode.
 
Advantages of using template:
  • Reports are sent in universal RTF format so you don't need any 3d party
    programs and/or drivers to make  such files
  • When Received, report is immediately available for reading or printing so users should
    just double-click RTF attachment and Windows will do the rest
  • Emails can be sent both one-by-one (with preview) and in a batch process
  • Report can be saved to disc in RTF format. In this mode you will
    see just created RTF in default Windows RTF editor and will be able
    to save it anywhere and with any name you like. Optionally you can do
    it in silent mode.
  • As to technical side, Outlook Email Report as all our templates is a white box template
    (no extra DLLs to ship)
  • Compatible with both Clarion 5 - Clarion 7 ABC/Legacy
  • It does not need or do any changes to either Clarion native
    or 3d party templates. It's taboo!
  • Compatible with all major 3d party report templates: CPCS, RPM, DAS
    previewer, Tintools, and Icetips previewer

  • Multi-dll application ready

  • Network friendly - can be run by many network users simultaneously

New features

  • Landscape report support

  • Direct support for Icetips previewer

  • No need to manually select both template chain
    and basic report template 

  • Option to define email priorities (High, Low, Normal)

  • New internal help

  • Option to email Clarion reports in PDF both with and without
    report preview (c6 only) or use HTML report output to populate
    email body

  • Ability to attach files with wild cards: *.Doc *.Do? etc.

Installation
 
Run the installation wizard. It will guide you through a few simple steps. That is it.
IMPORTANT: If you are using Clarion 5-6, after selecting Clarion5-Clarion6 directory wizard
will offer you to install it into C:\Clarion5-6\Clarion7 or C:\C55\Clarion7 directory respectively.  
So do not forget to get rid of last \Clarion7. But even if you do - it is not a problem.
Just uninstall template and run installation once again.
To start using template you have to manually register it.
Here is instruction: Open Clarion (no application must be open). 
Go to menu Tools (Setup) -> (Edit) Template Registry -> Register
Select new template oemlrpt.tpl and then hit Open button.
You can find it in C:\Program Files\SoftVelocity\Clarion7\accessory\template\win
for Clarion 7 and in C:\Clarion*\Template - for all others.
View animated reminder on how to do that - Registering Template
(built with our JAVA Animated Help Builder).

Using Template

Global Extension Template
First of all you have to install global Outlook Email Report extension template into your
application containing report(s) you want to email (no matter DLL it is or EXE)
Template chain prompt is now deprecated so it is always disabled.
(Outlook Email Report Template does it automatically now).
Optionally you can define email background colour here one for all reports.
Later you can override it for any report you like (see picture below).
Outlook Email Report supports global image shrinking. But you can
override it locally for each report as well.
Shrink reports prompts allows you to define one shrinking factor for all
reports in this application. You can use either numbers or your variable here.
But you have an option to override it locally for each report.
We added this shrinking feature for developers who are kin
on printing emails or eager to send landscape reports. 
In multi-dll application you have to include this extension not only into application
containing reports, but also in the main definition dll (where all files and ABC
definitions are).
The next 2 prompts are optional. These are internal RTF document property.
So your customers will never see them. Nevertheless you can leave here
your "signature" if you want to.
By default template creates subdirectory \VH\ under your working directory
to keep temporary template files. On some networks it can cause problems.
So the last prompt is the place where you can override this default behaviour.
Template creates global variable associated with this prompt GLO:WorkingDir
So you can specify any other directory like that: GLO:WorkingDir = 'C:\Temp'
In this case template will use C:\Temp on each workstation to build all required files. 
Even if this directory does not exist, template will create it.
It will even create nested directories for you! So if you prime this
variable to say C:\Temp\A\B\C you will find that directory structure.
And if you do not use this variable template will work as always, that is
it will create working directory \VH\ on the server under your working directory 
and use that. 
Normally Keep report pages checkbox should be OFF. When ticked, 
it will save all temporary WMF report pages in the working directory.
You might need it when using non-standard reports to estimate
those picture sizes. Do not forget to sent it OFF before program release.
Though even if you do, it will not cause any inconveniences to your end-users.
The only difference it makes - their working directory will be a little bit larger.
Procedure Extension Template
Picture below shows all settings you have to define in report extension.
To open a Tab other than first just move the cursor on top of it.
General Tab
First of all you have to select your Basic Report template from the combo.
You can find it - on the bottom of the first tab - General.
(see combo below):
 

It defaults to whatever report template it can see in current report procedure.
It is important to stress that this is just a suggestion. So if you want,
you can reselect any other report template. You might want to do it only in exceptional 
situations. For instance when you want to apply embed template to solve some unusual
requests of end-users (email and print at the same time etc.). Or you have some uncommon
hybrid say CPCS + RPM. We provide examples for each of those directly supported templates
in Clarion*\Examples\OutlkEr directory so you can investigate recommended
template settings there. If you do not have all those report templates
you can find a short application version in respective subdirectory to suit you.
And in C6 subdirectory you can find C6 specific example which will give 
you some ideas how with minimal efforts you can use Outlook EmailReport 
to email Clarion reports as PDF attachment (both with and without report preview) 
or populate email body with HTML generated by C6 report. 
Have a quick look at email examples.
IMPORTANT: If you want to try to use this template with any report template
other than directly supported (Clarion, CPCS, RPM, DAS, Tintools, and Icetips),
we would strongly recommended you to download free shareware version
of template to make sure it will work. You have to selects Other from the Basic
report template prompt and use new embed. You should do the same if you
want to use this embed in one of supported report templates. In template
examples you can find how this embed can be used.
The last choice from the drop down combo is None. You should apply this one
only if you want to send ordinary emails (without any report attached). 
See examples for details.
Report behaviour completely depends on one global variable - OREG:Mode
You can use either numbers or equates defined. We put them on the last tab
so you can copy and paste them in your code:

0 - OREQ:Print
1 - OERQ:EmailPreview
2 - OERQ:SilentEmail
3 - OERQ:Save
4 - OERQ:SilentSave

It goes without saying that if this value equal 0 - report will be printed,
1 - emailed with Outlook preview, 2 - emailed silently  etc.
IMPORTANT: If you have MS Word installed you can significantly improve
performance in the Save mode by Opening Windows explorer/Folder Options/File 
Types and settings RTF type to NOT use DDE for opening.
Report Tab
Here you can specify name of RTF attachment file either from a variable or
by hard-coding it from the prompt (using say 'ReportCopy' will create
attachment ReportCopy.rtf). If you use variable just put it's name.
or find it from lookup button. No exclamation marks are required!
You can define image shrinking factor for RTF reports
and specify variable names for RTF file name and path for saving reports.
Normally you should not change this setting. Do it only if you
have to send non-standard report.
Starting from version 6 you have full control of report sizing (both in Body and RTF).
By default template supports A4 reports. So the only thing you have to
do to them is to specify if report has Landscape layout.
To define report margins (for RTF) and report width and height template generates and 
uses 4 global variables: OERG:RTFleft, OERG:RTFtop, OERG:RTFwidth, and OERG:RTFheight.
Those values should be specified in 1/1000th of an Inch (Clarion default units).
The simplest way to estimate your report sizes is to collect WMFs by setting
global Keep report pages checkbox ON. Then open any of WMFs with Windows
MS Paint and from Image -> Attributes menu find out the sizes in Inches.
Do not forget to multiply it by 1000. It is important to understand that all
that should be done only if you use non-standard report sizing. You will know it 
immediately because improper sizing dramatically decrease report quality.
So if you see something like that - time has come to check report sizes:
Otherwise you can completely ignore Position Group.
The type of prompt used for all 4 size variables
lets you define them either with variable or implicitly as a number.
So you can use predefined variables. You can 
define and use your own variables for that. At last you can just
put a margin value right into corresponding prompt. As long as you follow
standard Clarion syntax you won't have any compile errors.
Email Tab
Here you can  define all email addresses - EmailTo, CC and BCC. 
We employed special type of template prompt for them - expression.
So you can either hardcode them or build as a combination
of your fields. You can populate this prompt from any variable as well. 
Just follow that simple specification below and
standard Clarion syntax. For your convenience we put the Example textbox
(not used by template) with few standard EmailTo prototypes. So you can copy
and paste any of examples and just replace our field names with yours.
Both EmailTo and Subject fields should be valid Clarion strings. Use lookup
buttons to find and append any filed from your Application like you do for formulas.
Like email addresses you can either hardcode email Subject or
define it from a variable.
Body Tab
You can populate email body with your Clarion fields line-by-line. Just follow plain
Clarion syntax and build any letter you like. 
Everything you add here goes directly into embedded email HTML file.
So you can use HTML tags as well. (Tag usually starts with something
like <font> and ends with </font>. It can be <img> and </img> etc.)
Just remember that each tag should occupy
one line in the body queue. This restriction comes
from the way we build message body, rather than from HTML syntax.
To make life easier we put new-line tag after each line of HTML
So if you try to split a tag on more than one line - this tag will get broken.
by the new-line tag inserted by template
If you are a hard-coder, you might want to directly populate
body queue from embed. Template stores that note in OERQ:BodyQue
global queue. So for extra flexibility you can completely ignore Body Note template Tab
and populate this queue directly from special embed: EmailReport - After filing queues.
So just use usual queue handling:

FREE(OERQ:BodyQue)
OBQ:Line = 'Line No 1'
ADD(OERQ:BodyQue)
OBQ:Line = 'Line No 2'
ADD(OERQ:BodyQue)
OBQ:Line = 'Line No 3'
ADD(OERQ:BodyQue)

If you omit FREE() function call, template will append those lines to
whatever you have already specified in the Body Note template prompt.
Investigate example provided with this template for details.
Another option - use any HTML file as email body. So you can ship some
standard HTML files with your program or build them on-the-fly.
One thing to keep in mind - if you are using any HTML file to build
email body you automatically override all settings above (se the picture)
So everything including background colour should be defined within
this HTML
IMPORTANT: When populating whole body from an HTML file
please bear in mind that Outlook is very unreliable when it comes to sending
embedded images. So you should either avoid images in HTML files or
reference images have been preliminary published on the net.
So <IMG src="http://www.vividhelp.com/images/small.gif"> will work fine.
and <IMG src="C:/images/small.gif"> will not :-(
Attachments Tab
Template automatically attaches the report RTF file. So you have to
use this tab only if you need to email some other files. Like email body
you can either use this template prompt to define
list of attachments to be emailed or directly populate attachment queue
from embed.
Like email body note, these attachments are stored in global queue (OERQ:AttachmentQue)
So for all emails you can use either template settings or populate this queue directly
from the same embed point. You can combine those 2 methods as well.
Something like this will do:

OAQ:FileName = 'C\Temp\Note.doc'
ADD(OERQ:AttachmentQue)
OAQ:FileName = 'C\Windows\help.doc'
ADD(OERQ:AttachmentQue)
...

Equates Tab
It's just a place where you can copy predefined equates for pasting them 
into your code. You can find here examples of Email address formatting as well.
The prompt is ignored by template, so you can store here any information you like.
We installed example into your Clarion*/Examples/OutlkEr
Or C:\Program Files\SoftVelocity\Clarion7\Lessons\OutlkEr in C7.
So for various settings you can investigate the source.
If you have installed C55 only you have to recompile Demo to run :-(
IMPORTANT: In email mode report cannot go without preview, so
you should always keep the Print Preview checkbox ON no matter which
basic report template you are using. 
Conversion from previous versions
In order to proceed we had to do 2 changes to template which
might affect current users.
So firstly to make template truly multi-dll we had to redefine those 
global variables differently:

OERG:Mode 
OERG:RandNo 
OERG:RTFname 
OERG:RTFpath 
OERG:RTFleft 
OERG:RTFtop 

It happened when we moved from version 1.0 to 1.1. So if you already
use version 1.1 you can skip this first bit.
Now they are true globals visible in all applications. So you can set main switch
OERG:Mode in one application and call report from another. It will work properly.
In previous versions such things were impossible. Unfortunately we cannot
delete the old variables in the Global data section. So you have to do it yourself.
So you should follow those steps to convert application:
1. Backup application
2. Open it and delete those 7 variables from Global data section.
3. If Clarion does not issue any messages that is it.
4. If you see message like: "?GLO:NoEmail control deleted from Main procedure"
    it means you have used that variable on the Main window.
5. Write down names of all such procedures
6. Restore original application and save all those window definitions in
    the Notepad (you can find it from procedure properties -> 3-dot
    button next to Window ...).
7. Repeat step 2 and then replace changed by Clarion window definitions
     with those just saved in Notepad
These steps will help Clarion to find those differently defined globals.
You can do it any other way. For instance text-export your procedures
and then import them back after deleting those global variables.
Secondly only if you use CPCS basic report template Other or None,
you have to reselect it from the basic report template combo on
the General Tab: newcomer - Icetips template - needs space.
We apologize for any inconvenience these changes might cause.
C6 is a huge mile-stone for all Clarion developers. And it looks like
everybody will have to do some sort of conversion to migrate into
that environment anyway. 
TIPS (you are welcome to send your tips to this area!)
1. To get some quick help you can hit any of those question-marked buttons
    (picture below). It's new type of template help we've just developed,
    so would you tell us please what you think of the new help
2. MS Security Warning Message. There is a simple way to get rig of
    this annoying warning [Outlook >= 2002]. You can use this FREE
    tiny program: www.express-soft.com/mailmate/clickyes.html
    which runs as a service and hits this OK button for your clients.
    It uses just few API calls so seems to be pretty harmless.
Move cursor on top of a Tab to open!

Copyright (C) 2007 Vivid Help Systems Pty Ltd

sitemap