CanShrink CanGrow with graphics control
am 04.11.2007 22:36:04 von MLH
Say I've got a graphic on a report's detail section. Say it's
a bound object frame linked to an image spec in a bound
table field named [Pic].
How might it be possible to approximate the CanShrink /
CanGrow processes associated with text boxes? In other
words. For instance, supposing the [Pic] field vale was
Null in some records. As I was reading through the report,
it would be nice if the space reclaimed by what might other-
wise be a fixed size graphic allowed my output document
to look somewhat better.
Hopefully I haven't botched the job of explaining just what
it is that I'm looking for here.
Re: CanShrink CanGrow with graphics control
am 04.11.2007 23:13:36 von MLH
The reason I'm asking is because the following did not work for me...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me!Pic) Then Me!Pic.Properties("Height") = 0 Else
Me!Pic.Properties("Height") = 4 * 1440
End Sub
Once the first record with a graphic in the [Pic] field is encountered
the spaces between records are all 4" high from that point until the
end of the document.
Re: CanShrink CanGrow with graphics control
am 05.11.2007 19:21:51 von deluxeinformation
On Nov 4, 4:13 pm, MLH wrote:
> The reason I'm asking is because the following did not work for me...
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> If IsNull(Me!Pic) Then Me!Pic.Properties("Height") = 0 Else
> Me!Pic.Properties("Height") = 4 * 1440
> End Sub
>
> Once the first record with a graphic in the [Pic] field is encountered
> the spaces between records are all 4" high from that point until the
> end of the document.
You'll need to resize the section as well as the control because the
CanGrow and CanShrink functionality of the section will ignore the
fact that you've resized the control in code. To expand on your code
you'll need something like
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me!Pic) Then
Me!Pic.Properties("Height") = 0
Me.Section(acDetail).Height =
Else
Me!Pic.Properties("Height") = 4 * 1440
Me.Section(acDetail).Height =
End If
End Sub
Bruce