This sample db demonstrates outputting of selected access report group-wise in
HTML format. For each different value of the group header, portion of report
pertaining to that group value gets saved as a separate html file, in folder named
ReportParts, located in the parent folder housing the sample db. If no such folder
exists, it gets created programmatically.
User selection of report is carried out via list box at left. If desired, copies of
report parts group-wise can also be sent as attachments to eMail. User can select
destination eMail addresses in subform at right, by selecting the check box named
SendMark. If more than one address is selected, eMails with attachments get sent
to all the selected addresses.
Three different reports are included, grouping books in following alternative styles:
(a) Grouped by author
(b) Grouped by publisher
(c) Grouped by topic
Code in report's open event as well as group header's format event is of generic
nature. It uses the preliminary formatting cycle to build an array of group values,
which are later used to filter the report whole sending / saving the group-wise parts,
via subroutine named SendReportPartsByGrpLevel() in general module. This
subroutine takes two arguments (report name and eMail address (optional)). If
second argument is not supplied, no eMail gets sent (though report parts group-
wise are still saved in ReportParts folder, in HTML format).
Name of each saved file as well as report part caption reflect the group value as
per which the report has been filtered. Spaces in group value, if any, are replaced
by underscores, before being concatenated into file name.
Important:
(a) Make sure that a control bound to the grouping field and bearing the same
name is present in the group header section.
(b) A calculated control having [Pages] as part of its expression must be present
in the report. This is required for ensuring complete preliminary round of
formatting, which is used to build up an array of group values.
Version: Access 2K/XP/2K3/2K7 (Access 2000 File Format)
References: DAO 3.6, Microsoft Scripting Runtime Download Access 2K/XP/2K3/2K7: http://www.rogersaccesslibrary.com/forum/uploads/37/Report_SendPartsByGrpLevel.zip -
|