LARiot
Programmer
- Feb 7, 2007
- 232
Hi. Any help is appreciated.
I'm trying to print a report with some records having images and others not. When no image, there should be no space between records. That is, shrink the detail when no image. I have the following code:
It works when the all images in recordset are null or when anything after the first record has image. However if the first record has an image, then the detail height is set at 4979 twips, even though on debug.print of the detail height it said 2160 for no imaged records.
-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor
I'm trying to print a report with some records having images and others not. When no image, there should be no space between records. That is, shrink the detail when no image. I have the following code:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.ImagePath1) And IsNull(Me.ImagePath2) Then
Me.imgNarrative1.Visible = False
Me.imgNarrative1.Height = 1
Me.imgNarrative1.Width = 1
Me.imgNarrative2.Visible = False
Me.imgNarrative2.Height = 1
Me.imgNarrative2.Width = 1
Me.Detail.Height = 2160
ElseIf Not IsNull(Me.ImagePath1) Or Not IsNull(Me.ImagePath2) Then
'n X 1440 (twips per inch) = height and width used
Me!imgNarrative1.Visible = True
Me!imgNarrative1.Height = 3360
Me!imgNarrative1.Width = 3960
Me!imgNarrative2.Visible = True
Me!imgNarrative2.Height = 3360
Me!imgNarrative2.Width = 3960
Me.Detail.Height = 4979
End If
End Sub
It works when the all images in recordset are null or when anything after the first record has image. However if the first record has an image, then the detail height is set at 4979 twips, even though on debug.print of the detail height it said 2160 for no imaged records.
-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor