template settings there. |
IMPORTANT:
If you want to try using this template with any report template |
other than those directly supported (Clarion, CPCS, RPM, DAS,
Tintools, and Icetips), |
we'd strongly recommended that you download
the free shareware version |
of the template to ensure it will work. You'll
need to select Other from the Basic |
report template prompt and use the EmailReport
embed template. You
should do the |
same if you want to use this embed in one of supported
report templates. In the |
template examples you will see how this embed can be
used. You may wish to |
use the template this manner to satisfy some unusual
requirement of your customers. |
For instance to email and print reports at the
same time, or print and |
save reports into RTF. For this scenario
you have the option of using another handy |
feature of the template. If you are going to
employ the EmailReport embed template say |
with CPCS you first select CPCS as the basic
report template and then insert the |
EmailReport embed template. You will find that
all embed prompts are automatically |
populated so you needn't look for those
variables in the report code. |
After this you should change the basic report template
to OTHER to disable the execution |
of the default sequence. Otherwise the
template will
try to email reports twice - first with the |
default template code for CPCS in this case and then with
the embed template code. |
|
Email Tab |
It goes without saying that EmailTo, CC and BCC
use the same format. |
We've employed a special type of template prompt
for these - expression. |
So you
can either hardcode them or build as a combination |
of your fields. You can also populate this prompt from any
other variable. |
Just follow the
simple specification below and standard Clarion syntax.
|
For your convenience
we've put the Example textbox |
(not used by the template) with few standard
EmailTo prototypes. So you can copy |
and paste any of the examples and just replace our
field names with yours. |
Both EmailTo and Subject fields should be
valid Clarion strings or expressions. Use |
lookup buttons to find and append any field from your
Application as you would for formulae. |
As an option you can define images to use for navigation up and down arrows.
|
We ship a number of arrow GIFs with the
template:
|
|
Of course you are free to use
any others.
|
IT'S VERY IMPORTANT
to remember that those images should be available
at runtime.
|
So you'll need to ship them with your application either in the working directory or in a
|
subdirectory of your working directory (where the main EXE is).
|
Though it is still not the end of the World if
you forget to ship them - the
|
template in this case will replace them with a
"No frills" arrows which used to be
|
in all previous versions of EmailReport up to
2.3.
|
You can play audio files in your emails as
well. You have to specify
|
a Sound file and how many times you want it to
be played.
|
Like the arrow image files, those sound files
must be available at runtime.
|
So you'll need to ship them with your application.
|
From our experience not all users appreciate this feature. So it's
advisable
|
to show them such 'talking' emails first :-)
|
Besides this, you can define email priorities.
The template understands only 3 words
|
here: High, Low, and Normal. So you can either
use one of those words
|
with quotes ('High' etc.) or use your STRING primed to either of
those words.
|
If this prompt is not defined or there is a
typo - priority defaults to Normal.
|
|
Report Tab
|
Here you can suspend the global setting to NOT
generate a RTF file. |
You can specify name of a RTF attachment file
either from a variable or |
by hard-coding it from the prompt as well (using say 'ReportCopy'
will create |
attachment ReportCopy.rtf). If you use
a variable just put it's name. |
or find it from lookup button. No exclamation
marks are required! |
You need to bear in mind that RTF uses the
same shrinking factor as the |
image in the email body. |
RTF path prompt allows you to define where in
your system you want the
|
saved report to go (in the silent mode). It
should be a full path:
|
'C:\Temp\Reports'. If this directory doesn't
exist
- the template will try to
|
create it. It will even create nested directories
for you! So if you prime
|
this variable to say 'C:\a\b\c' you will find
this directory structure and
|
saved report in the last \c directory.
|
You can define the image shrinking factor applicable for both body and RTF reports
|
and specify variable names for RTF file name and path for saving reports.
|
The rule of thumb - the more you shrink the image the
worse the
|
quality of the image, so use this option with care. But in some cases
it
|
will help you to print emails more economically or fit wide reports into
the email body.
|
You can try changing report fonts. Bold font always
give a much better
|
performance. And shrinking almost has hardly any influence on
the
|
quality of printed emails.
|
Starting from version 6 you have full control of report sizing (both in Body and RTF).
|
By default the template supports A4 reports. So the only thing you
need to
|
do is to specify if the report has Landscape layout.
|
To define report margins (for RTF) and report width and height
the template generates and
|
uses 4 global variables: GLO:RTFleft, GLO:RTFtop, GLO:RTFwidth, and GLO: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 by 1000. It is important to understand that all
|
this need only be done if you use non-standard report sizing. You will know
|
immediately because improper sizing dramatically decreases report quality.
|
So if you notice this - you'll need 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 a variable or implicitly as a number.
|
So you can use predefined variables. You can
|
define and use your own variables. At last you can just
|
put a margin value right into the corresponding prompt.
So long as you follow
|
standard Clarion syntax you won't have any compile errors.
|
|
Body Note Tab
|
You have the option of defining a heading comment on the Body Note tab. Just follow plain
|
Clarion syntax and build any letter you like.
This option may be especially useful
|
when you send reports as RTF attachment only. So you could explain here what to do
|
with this attachment.
|
Everything you add here goes directly into the
embedded email HTML file.
|
So you can also use HTML tags. (Tag usually starts with something
|
like <font> and ends with </font>. It can be <img> and </img> etc.)
|
If you enjoy doing things the hard way you can consult HTML
|
and MIME documentation. For all others here is a simple tip.
|
Use your Outlook Express for visual design.
Simply use it to create a new
|
message, insert images, text with any font you like etc. and then
|
Save it As a EML file. Done! Now you can open this file with any text editor
|
(say Notepad) and copy and paste HTML tags one by one. Just remember
|
that each tag should occupy one line in the body queue.
|
This restriction comes from the way we build
the message body, not from HTML syntax.
|
To make life easier we've put a 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 the template.
|
And one more thing to bear in mind - the
template
stores this note in EREQ:BodyQue
|
global queue. So for extra flexibility you can
completely ignore the Body Note template Tab
|
and populate this queue directly from the special
embed: EmailReport - After filing queues.
|
So just use the usual queue handling:
|
FREE(EREQ:BodyQue)
ERQ:Line = 'Line No 1'
ADD(EREQ:BodyQue)
ERQ:Line = 'Line No 2'
ADD(EREQ:BodyQue)
ERQ:Line = 'Line No 3'
ADD(EREQ:BodyQue)
|
If you omit FREE() function call,
the template
will append those lines to
|
whatever you have already specified in the
Body Note template prompt.
|
|
Attachments Tab
|
EmailReport takes care of Reports in RTF attachment.
|
So this attachment prompt allows you to specify
a list of any other files
|
to be sent with your emails.
|
Like the email body note, these attachments are stored in
a global queue (EREQ:AttachmentQue)
|
So for all emails you can either use template settings
or else populate this queue directly
|
from the same embed point. You can also combine
these 2 methods.
|
Something like this will do:
|
EAQ:FileName = 'C\Temp\Note.doc'
ADD(EREQ:AttachmentQue)
EAQ:FileName = 'C\Windows\help.doc'
ADD(EREQ:AttachmentQue)
...
|
Equates Tab
|
This is a place where you may copy
predefined equates for pasting them
|
into your code. You can find here examples of
Email address formatting as well.
|
|
We've installed examples into your \ DOWNExamples\EmlRepLg\
|
Or Clarion7(8,9,10...)\Lessons\EmlRepLg in Clarion
7-10.... |
So for various settings you can
investigate the source. |
To compile our demo you need all 3rd party
templates. |
So to go around this, you can find a short
version of the demo |
in respective subdirectories: Examples\EmlRepLg\CPCS
etc. |
IMPORTANT: In email mode reports cannot go without
a 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 make 2 changes to
the template which
|
may affect current users.
|
So firstly to make the template truly
multi-dll we had to redefine those
|
global variables differently:
|
GLO:NoEmail
GLO:NoPreview
GLO:RandNo
GLO:RTFname
GLO:RTFpath
GLO:RTFleft
GLO:RTFtop
|
Now they are true globals visible in all
applications. So you can set the main switch
|
GLO:NoEmail in one application and call reports
from another.
|
In previous versions such things were
impossible. Unfortunately we cannot
|
delete the old variables in the Global data
section. So you'll need to do it yourself.
|
Follow these simple steps to convert the 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 this in other ways too. 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 or Other,
|
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 may cause.
|
We actually made a multi-dll version a while ago
|
and have been giving that template on request
as ver. 2.52
|
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. So we've finally decided
that the time has come
|
to proceed with these changes.
|
|
Users Tips
(you are welcome to send your own tips to this area!)
|
1. Remember to select the Report Template Used (clarion,
cpcs...).
|
2. If you are not using a global switch (as in the example app) reset
|
GLO:NoEmail to 1 at end of report
(GLO:NoEmail = 1) to default to printing.
|
3. To save the RTF file don't forget to
specify the path in GLO:RTFPath
|
and file name GLO:RTFName
(without path and extension)
|
4. You CANNOT use the C-style terminology IF ~GLO:NoEmail
now :-(
|
It must be referred to either by equate or 0,1,2 or 3.
|
5. On a network all drivers should be mapped
|
6. For Fomin
report builder you have to select Clarion from the Basic
|
Report Template combo (see picture below).
|
7. All template prompts follow standard
Clarion syntax. So do not try to put
|
exclamation mark in front
of them! Or leave string without the quotes.
|
Or wrap a variable in quotes
etc.
|
8. With report templates not supported directly always choose Other
|
from the Basic template combo and apply EmailReport Embed template
|
9. To get some quick help you can hit any of
those question-marked buttons
|
(picture below). This is a new type of template help we've
just developed,
|
so please let us know what you think of the new
help
|
10.Latest WinXP issue. If you see the email
preview without a Send button
|
it means you should apply
MS patch for OE. The simplest way to
|
do this is to use the Adobe
version of it: adobeforums.com.
To avoid
|
registration you can log in
as a guest.
|
Alternatively you can
download the original MS patch here: microsoft.com
|
but it's much harder to
use.
|