Regions Visible or not
Hello.
I want to know if there is a property that can set automatically the
visible state of a region. I don't want to make some code under the
report because customers will be changing the design or the report.
Or maybe a property that make the region visible = false if there is
nothing printed in the region on the popup menu of the report designer.
Is that possible ?
JFPicard
I want to know if there is a property that can set automatically the
visible state of a region. I don't want to make some code under the
report because customers will be changing the design or the report.
Or maybe a property that make the region visible = false if there is
nothing printed in the region on the popup menu of the report designer.
Is that possible ?
JFPicard
This discussion has been closed.
Comments
There is no built-in feature to do this however it is possible to loop
through each component inside a report and determine whether it is a region
or not. Once a region is found, you can determine whether there are
components inside it and toggle the visibility as you need. Take a look at
the following article on looping through all components in a report.
----------------------------------------------
Tech Tip: Loop Thru All Objects in a Report
---------------------------------------------
A ReportBuilder report is composed of a set
of components. The basic structure is
Reports.Bands[].Objects[]
The bands and objects within the report can
be accessed directly by object name or
via the Bands and Objects array properties.
Below is an example of using the Bands and
Objects array properties to change the font for
all objects on a report.
uses
ppClass;
procedure AssignFontToReport(aFont: TFont; aReport: TppCustomReport);
var
liBand: Integer;
liObject: Integer;
lObject: TppComponent;
begin
for liBand := 0 to aReport.BandCount-1 do
for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do
begin
lObject := aReport.Bands[liBand].Objects[liObject];
if lObject.HasFont then
lObject.Font := aFont;
end;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Builder ? I think that it would be a great feature.
JFPicard
Yes, this will be considered for a later release. Thanks for the feedback.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com