Sometimes
it may be not enough
of the XL Report
Builder possibilities
to create a report.
In such cases you
can use advantages
of the VBA. This
office-programming
tool is probably
the most powerful
among such systems.
Using VBA in the
reports, the user
gets all the power
of the Microsoft
Excel.
To
use VBA macros at
the report creation
in the XL Report
Builder it’s
necessary to use
the properties Macro
Before Build
and Macro
After Build
of the object Report.
These properties
are for calling
of the published
VBA procedures.
Their string values
must contain full
names of the published
VBA procedures,
which are saved
together with the
workbook-template.
At
creation of the
workbook-template
it is necessary
to add a new module
into it and then
to write a public-procedure
into this module.
Then, in one of
the properties Macro
Before Build
or Macro
After Build
you need to enter
name of this module,
put a dot and write
the name of this
procedure (for example:
"Module1.Procedure1").
The
procedure, specified
in the property
Macro Before
Build will
be started immediately
BEFORE the report
execution. It can
contain a code,
which performs some
actions of creating
or editing of the
template. There
can also be a dialog
with the user, where
some details of
the report can be
specified.
Procedure, specified in the property Macro After
Build will
be automatically
started immediately
AFTER the report
building. It can
be very useful if
there is a necessity
of the additional
work with the information
(after it had been
extracted from the
database), for example
to filter it, to
build a chart, to
mark some values
with the color and
so on. An these
are not all situations,
when you can use
macros. It is possible
to do everything
you wish using macros
(namely, everything,
VBA and Excel are
capable of). And
they can do a lot
of things.
[
Back
to Table of Contents
]
|