Access XP Report Section Does Not Always Shrink Correctly

  • Thread starter Thread starter Velociraptor
  • Start date Start date
V

Velociraptor

In the detail section of a report (Can Shrink, Cannot Grow) I have a
rich-text (ActiveX) component that varies in height according to the amount
of text that has been typed, font size etc. This is always the last item
(vertically) in the detail section. In the OnFormat event for the detail
section I programmatically adjust the size of this component. To avoid (item
is too big for the section) errors when expanding the vertical size of the
control I use a simple trick (recommended by FMS Inc, the suppliers of the
component). At design time I make the section as vertically large as
possible (about 55 inches) and I include an invisible text box that is also
the same height. It has (Can Shrink) true.

This ruse ensures that I can expand/contract the height of the ActiveX
component as much as I like, without error, and the section will contract to
accommodate the control. The end of the section should exactly coincide with
the bottom of the ActiveX component. However, this does not always happen.
Sometimes the shrink is successful but quite often there is whitespace
(between 1 and 10cm) after the end of the ActiveX control. This can give
rise to blank pages being randomly inserted into the report.

Does anybody have any ideas a) why this is happening and b) how to ensure
that the Detail Section of a report is as small as possible? (I have tried
Me.Detail.height = X to no avail).

Kind regards

Paul
 
Velociraptor said:
In the detail section of a report (Can Shrink, Cannot Grow) I have a
rich-text (ActiveX) component that varies in height according to the amount
of text that has been typed, font size etc. This is always the last item
(vertically) in the detail section. In the OnFormat event for the detail
section I programmatically adjust the size of this component. To avoid (item
is too big for the section) errors when expanding the vertical size of the
control I use a simple trick (recommended by FMS Inc, the suppliers of the
component). At design time I make the section as vertically large as
possible (about 55 inches) and I include an invisible text box that is also
the same height. It has (Can Shrink) true.

This ruse ensures that I can expand/contract the height of the ActiveX
component as much as I like, without error, and the section will contract to
accommodate the control. The end of the section should exactly coincide with
the bottom of the ActiveX component. However, this does not always happen.
Sometimes the shrink is successful but quite often there is whitespace
(between 1 and 10cm) after the end of the ActiveX control. This can give
rise to blank pages being randomly inserted into the report.

Does anybody have any ideas a) why this is happening and b) how to ensure
that the Detail Section of a report is as small as possible? (I have tried
Me.Detail.height = X to no avail).

Kind regards

Paul

I'm not sure how your report design looks like. Does the invisible
text box overlap the RTF component? Because the can grow/can shrink
mechanism doesn't work if you have overlapping controls. Thus I would
try to do the following

*
* RTF Control
*
some space
*
* invisible text box
*

Then on formatting the RTF control, I would first resize the height
and top of the text box before resizing the RTF control, so that there
is always some space between the two.

HTH
Matthias Kläy
 
Back
Top