Batch EmailReport


Batch EmailReport  for Clarion 55-10... ABC. This template sends emails with the Clarion native Document Send Template and allows your customers to send multiple Clarion reports in the most user-friendly way - right in the body of email messages. Compatible with ABC Clarion Report, CPCS, IceTips, RPM, DAS, and Tintools report templates.

The picture on the right  shows how the template works. Please do not touch the arrow!!! Why not download our 'Try before buy' shareware version of the template for testing? You can have a quick look at emails generated  by the template as well.

The batch EmailReport template works in conjunction with the C55-C10... Document Send ABC Template.
This template formerly had a number of problem in C55. It appears that Soft Velocity has
significantly improved it lately. So in Clarion 6-10... it works without any glitches.
Like its older brother - EmailReport template - Batch EmailReport has very much the
same functionality. So you can send reports in the email body, send email as RTF attachment, save
reports as HTML, DOC, or RTF to disc with MS Word or save them in silently. The main difference - 
you can do all this in the batch mode. So with one click of a button you can send either 
the same or individual reports to as many recipients as you like. Additionally, in this template you 
can define up and down navigation arrows with any GIF image including animated ones
so you can make your emails as vivid as you like :-). Plus there is an option to put a note
in the email body as well.
Batch EmailReport is compatible with Clarion, CPCS, IceTips, RPM, DAS, and Tintools.
It also has an embed template doing all emailing/saving functions, which means 
Batch EmailReport can be used with a much wider range of basic report templates.
To ensure that your customers will be able to print/preview the emailed report with
any email program and/or Operating System, the report can be duplicated
as an attachment of RTF type. This file can be opened/printed even
with Windows WordPad program, so no 3rd party program is required.
Download generated by template RTF file for testing.
Advantages of using template:
  • Reports may be sent in batch mode so your customers don't face the
    annoying repetitive work of sending hundreds of similar emails.
  • Once Received, the report is immediately available for reading or printing, so users
    don't have to worry about what, for instance, PDF means.
  • Alternatively, the report can be duplicated in an attached RTF or 
    sent as a RTF attachment only. This format is supported by MS Word.
    If it's not installed, Windows (95-v.7) automatically opens it with WordPad.
  • Before embedding a report into the body of an email you can add a short explanatory note.
  • If required, you can play a sound file when the email is being opened.
  • Reports 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. There is also an option to do this in silent mode.
  • The template gives you direct access to MS Word, so you can save reports
    not only as RTF, but also as DOC, HTML etc. You can even email
    and fax your reports right from Word using your address book.
  • As to the technical side, EmailReport - as is the case with all our templates - is a white box template
    (no extra DLLs to ship)
  • It does not make any changes to either Clarion native or 3rd party templates. 
  • The template is compatible with all major 3rd party report templates: CPCS, IceTips, RPM, DAS
    previewer, Tintools previewer

  • There is no need to manually select basic report template

  • 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 basic report template

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

  • new internal help

  • Last, but not least, you can define navigation arrows with any GIFs,
    even animated:

Run the installation wizard. It will guide you through a few simple steps.  
IMPORTANT: If you are using Clarion 5-6, after selecting Clarion5-Clarion6 directory wizard
will offer to install it into C:\Clarion5(6)\Clarion8 or C:\C55\Clarion8 directory respectively.
So don't forget to remove the last \Clarion8. But even if you do forget - no problem.
Just uninstall template and re-run the installation.
Then register the template. To do this you need to: Open Clarion (no application must be open). 
Go to menu Tools (Setup) -> (Edit) Template Registry -> Register.
batchrpt.tpl and then hit Open button
You can find it in Clarion7(8,9,10...)\accessory\template\win
for Clarion >= 7 and in Clarion*\Template - for all others.

Using Template

Global Extension Template
Follow these few simple steps to enable report emailing/saving.
The first step is to install Global Extensions for both Document Send and 
Batch EmailReport templates:
You have the option to define internal RTF document settings - RTF author, RTF company.
Your customers will never see them. Alternatively, you may choose to leave 
your "signature" here.
By default, the template creates a subdirectory \VH\ under your working directory
to keep temporary template files. On some networks this may cause problems.
So the last prompt is the place where you can override this default behaviour.
The template creates a global variable associated with this prompt MREG:WorkingDir
So you may specify any other directory, for instance: MREG:WorkingDir = 'C:\Temp'
In this case the template will use C:\Temp on each workstation to build all required files. 
Even if this directory doesn't exist, the 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 don't use this variable the template will 
create its own 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
picture sizes. Do not forget to set it to OFF before program release.
If you do forget to do this, however, it will not cause any inconveniences to your end-users.
The only difference is that their working directory will be slightly larger.
Procedure Extension Template
The picture below shows all the settings you need to define in the report extension.
To open a Tab other than the first one just move the cursor over it.
You have to insert Local extensions for both Batch Email report and Document Send 
templates into each report to be emailed.
General Tab
Report behaviour depends on one global variable only - MREG:Mode
You can use either numbers or defined equivalents. We've put them on the last tab
 so you can copy and paste them into your code:
0 - MREQ:Print
1 - MREQ:InBodyRTF
2 - MREQ:InBody
4 - MREQ:Save
5 - MREQ:SilentSave
Hence, if  this value equals 0 - report will be printed, 
1 - emailed in body & RTF etc.
So it is a kind of Batch EmailReport Global Request. In other words, if you say:
MREG:Mode = MREQ:EmailInBody; YourReport() - report will be emailed
in email body etc.
You have to select the basic report template from the 
Batch EmailReport Local extension combo (see picture below):

It defaults to whatever report template it can see in the current report procedure.
It is important to stress that this is merely a suggestion. So if choose to
you can reselect any other report template. You may wish to do this only in exceptional 
situations. For instance when you want to apply an 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\BatchRep directory.
Or Clarion7(8,9,10...)\Lessons\Conduct\Demo in Clarion 7-10....
So you can investigate recommended template settings there.
IMPORTANT: If you want to try to use this template with any report template
other than directly supported (Clarion, CPCS, IceTips, RPM, DAS, and Tintools),
we would strongly recommended that you download a free shareware version
of the template to make sure it will work. You need to select Other from the Basic
report template prompt and use the embed template. You should do the same if you
want to use it in one of the supported report templates. In template
examples you can see how this embed can be used.
As to Document Object name, it is already primed to Document send default
object name, so you don't need to touch it unless you have this ABC object renamed.
Have a look at Local extension template settings (picture on the bottom of this page).
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
You can specify the 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 insert its name.
or find it from the lookup button. No exclamation marks are required!
You have to bear in mind that RTF uses the same shrinking factor as does the
image in the email body.
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.
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 whether the report has Landscape layout.
For non-standard report sizing, you need to make note of the following:
To define report margins (for RTF) and the report width and height the template generates and uses 4 global variables: 
MREG:RTFleft, MREG:RTFtop, MREG:RTFwidth, and MREG:RTFheight. 
These 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 the 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.
Don't forget to multiply it by 1000. 
To repeat: It is only necessary to follow these procedures if you use non-standard report sizing. 
You will detect immediately whether or not the report is standard size because improper sizing dramatically decreases report quality.
So if you notice this problem you may 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 variable or implicitly as a number.
So you can use predefined variables. You can define and use your own variables for this. 
At last you can simply put a margin value right into the corresponding prompt. As long as you follow
standard Clarion syntax you won't have any compile errors.
You can define GIF images to use for navigation up and down arrows.
With the template we ship a number of arrow GIFs, but you are free to use any other.
IT'S VERY IMPORTANT to remember that those images should be available at runtime.
So you should ship them with your application either in the working directory or in a 
subdirectory of your working directory (where the main EXE is).
Note Tab
There is the option to define 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 a report as a RTF attachment only. So you are able to explain here what to do
with the attachment.
Everything you add here goes directly into the 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.)
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. Just create a new
message with it, 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 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 template.
Sound Tab
You can play audio files when an email is being opened. You have to specify
a Sound file and how many times you want it to be played from its respective tab.
Like the arrow image files those sound files must be available at runtime. So you
have to ship them with your application.
From our experience not all users appreciate this feature. So it's better
to show them such 'talking' emails first :-)
Equates Tab
It's just a place where you can copy predefined equates for pasting them into your code. 
It's not used by the template at all. So you can store anything you like here.
Document Send Template
We did our best to apply as little restriction to this template as possible.
So use it as if there is no Batch EmailReport template around.
For instance, you can use it to send attachment files (other than report in 
RTF; Batch EmailReport takes care of that).
You can use both global and static addressing. There is only one restriction -
on the Send Message Settings window (below) you should use these settings pictured.
Maybe you could find other working combinations, but these, we know for sure, definitely work!
IMPORTANT: All C55 versions up to current H have an obvious communication bug.
We've already reported it to Soft Velocity. Until this bug is fixed you need 
to apply another product of ours - C55 Document Send Template Patch - to eliminate it.
You receive the product as a free bonus with Batch EmailReport template.
So just follow this link and install it. Out of curiosity you can try to go without
it and see what happens... ;-) In Clarion 6 this bug is fixed, so there is no need
to apply a patch!
We have installed fully functional examples for each report template into your 
Clarion*\Examples\BatchRep directory so for various settings you can investigate them.
TIPS (you are welcome to send your tips to this area!)
1. Remember to select the Basic Report Template Used (clarion, CPCS...).
2. Don't forget to check 2 checkboxes in Document Send settings
3. To save the rtf file do not forget to specify path in MREG:RTFpath
    and file name MREG:RTFname (without path and extension)
4. In batch mode provide unique RTF file names not to override 
    just saved reports
5. On network all drivers should be mapped
6. 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.
7. With report templates not supported directly always choose Other
    from the Basic template combo and apply Embed template
8. If after conversion into C61 your application goes to GPFs on start up,
    it has nothing to do with Batch EmailReport template!
    It is usually caused by Global embed inherited from Document Send demo 
     Fuzzy Matcher Init. You have to move it into Program Setup embed [1000-2000]
Move cursor on top of a Tab to open!

Copyright (C) 2015 Vivid Help Systems Pty Ltd