Inserisci nel modulo del DataReport:
codice:
Public Sub StampaDRProva_Load()
On Error GoTo ErrHandler
DRProva.WindowState = vbMaximized
'Imposta i margini del Report:
With Me
.Orientation = rptOrientLandscape
.TopMargin = 100
.BottomMargin = 100
.LeftMargin = 100
.RightMargin = 100
.ReportWidth = 15390
'Centra la visualizzazione del Report:
If Me.WindowState = vbNormal Then
.Width = Screen.Width
.Height = Screen.Height
.Left = (Screen.Width - .Width) / 2
.Top = (Screen.Height - .Height) / 2
End If
End With
DRProva.Refresh
ErrHandler:
If Err.Number <> 0 Then
MsgBox Err.Description & Chr(13) _
& "Si è verificato un errore nella procedura di stampa." & Chr(13) _
& "Ripetere l'operazione.", vbInformation, "Stampa ...."
Err.Clear
Exit Sub
End If
In questo modo posiziona orizzontalmente e definisce i margini (provato per un foglio A4).