The Email Report Query Library is designed to enable HTML reports generated from a
grid to be emailed as attachments to a set of recipients at pre-defined intervals. This is
managed very easily by adding a map segment to your map and passing the Folder to it
on the Deadline. The library has recently been enhanced to allow complete use without
even specifying the grid – as long as there is only one ‘dependent’ grid in the map, it will
find it. If there is more than one grid you may have to specify the form and field names.
Using a simple '10 Step' guide, users require no knowledge of how the library works.
The Email Query Report can generate the following reports:-
Dynamic Report
|
Sets up a dynamic report to be sent to a
nominated recipient every day/week/month as
required.
For example, an ‘Exceptions Report’ is required
by a Project Manager every Monday by 09:00
hrs. The Email Query Report can be used to
define the query and recipient(s), and the
date/time to send the report.
|
Grid from Folder
Report
|
Sets up a report from a specific grid from a
Folder. We have, for example, a ‘Component’
Folder in our Development Procedure. One of
the grids of this Folder is the outstanding
Faults and Features, along with priority and
status. We have set up a report that is mailed
to the Team Leader every week that can be
printed and subsequently presented in the
Project Meeting.
Now there is no excuse not to have your documentation
ready!
|
Get Folders with
Missing Records Report
|
We had a particular problem in one mission
critical system where an SQL statement that
copied some records for a Folder failed.
We found the source of the problem, but we
could not guarantee 100% that this would not
happen again for a different reason.
We created a Conditional Action from a Stage
to the ‘Email Report Query’ Map Segment (you
do not have to use the Timed Action) if the
records had not been copied, and the
Administrator is emailed a report of any Folders
with missing records.
As a result, although we cannot guarantee
perfect execution, we can guarantee
notification of a failure, which is just as good in
this case.
|
|
|
You can use the “Demo Query Mailing” procedure as an example, or use an existing
procedure which employs a grid for dynamic or static reporting. The following
example describes each step in detail by creating a procedure from scratch.
-
Create a new
procedure.
-
Select the Procedure
Properties dialog and
associate the ‘Email
Query Report’ and Process Mapping
Common Libraries.
|
|
-
Create a text field and
assign the system
variable %Subject to
this field.
|
|
-
Select the blank form
and place a grid on it.
-
From the Grid
Properties dialog Table(s) field, select
the eEvent table and
add the following columns:-
eEvent.eMapName
eEvent.eActionName
eEvent.eToStage
eEvent.eEventTime
eEvent.eUserName
|
|
6. From the Grid
Properties dialog, Copy/Paste the
following SQL into the
Row(s) field:-
eEventTime > {ts
'%FormatTime(%MakeDate(1,days,before,%System.Time),yyyy- mm-dd
hh:nn:ss)'}
|
|
7. On the grid properties
‘Do this’ tab, set the
following properties as
illustrated:-
|
|
8. On the form properties ‘When user saves form’, set the following
variable assignments:-
%qFormName:="" %qGridName:=""
|
9. Select the procedure
map, and add the following map
elements:-
|
|
10. Select the Map
Segment “Email
Report” and add the
‘Email Query Report’
map segment.
|
|
11. On the
‘Edit’ action
set the folder deadline
to:-
%Deadline:=%Never()
|
|
12. Set the timed action
‘Email Report’
properties to:-
0 Minutes after %Deadline
|
|
13. Add an action to edit
the report frequency
and recipients.
14. Set the Email
Addresses action form
properties to the ‘Email
Query Report. Query
Mailing Details’ form segment from the
Library.
|
|
15. Select the ‘Email
Query Report.Report
Details’ form for the
Stage ‘Current’
:-
|
|
16. Publish the procedure.
|
|
|
|
-
Run the ‘Demo
Query Mailing’ query from the
Blank Forms list.
-
Submit the
form.
|
|
-
Set up the
mailing details options with
the ‘Email
Addresses’
action.
|
|
-
Select the
folder from the
To Do List.
-
Click the Edit
button.
|
|
-
Select the
Report Details
tab to view the
report details.
|
|
-
At the specified
interval, the report is mailed
as an attachment.
|
|
-
The latest
report may be viewed from the
clip at the top
of the Report
Details form.
|
|
-
Each time the
report is run, the actual SQL
used in the grid selection
criteria is stored and can
be viewed from the ‘History’
form tab.
|
|
-
The Report (as
mailed) is also attached to the
folder for future
reference.
|
|
|
|
|
|