logo's on report print preview differs from print pdf

lcarpay

Registered User.
Local time
Tomorrow, 00:11
Joined
Oct 20, 2017
Messages
11
Hi fellowdevelopers,

I have a multiple business unit report.
I have a page break after the business unit changes in the data
I want to print the correct logo of the actual business unit on each page

My problem is that the print preview is correct (works as designed). However when I want to save the report to a pdf then the last logo is used for every page.

Hints are welcome! :banghead:

Private Sub Report_Load()
Call Report_Page
End Sub

Private Sub Report_Page()
Dim strFullpathLogo As String
Dim lngLogoLeft As Long
Dim lngLogoHeight As Long
Dim lngLogoWidth As Long

strFullpathLogo = DefaultRead(edfHomeDirLogos, edtText) & Me!UnitLogo

Select Case Me!UnitLogo
Case "logoUnit2.png"
lngLogoHeight = CInt(1.72 * conTwips)
lngLogoWidth = CInt(3.56 * conTwips)
lngLogoLeft = CInt(15.85 * conTwips)
Case "logoUnit3.png"
lngLogoHeight = CInt(1.46 * conTwips)
lngLogoWidth = CInt(9.53 * conTwips)
lngLogoLeft = CInt(9.8 * conTwips)
Case Else 'assume ==>> logoUnit1.png
lngLogoHeight = CInt(1.93 * conTwips)
lngLogoWidth = CInt(8.91 * conTwips)
lngLogoLeft = CInt(10.5 * conTwips)
End Select

If FileExists(strFullpathLogo) = True Then
Me!logoPicture.Height = lngLogoHeight
Me!logoPicture.Width = lngLogoWidth
Me!logoPicture.Left = lngLogoLeft
Me!logoPicture.Picture = strFullpathLogo
End If
End Sub
 
Use the OnFormat event, this is the one that is triggered for actual printing.
 
thanks Minty, so easy!
 

Users who are viewing this thread

Back
Top Bottom