git-svn-id: svn://localhost/gambas/trunk@4289 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
081678b47e
commit
c66ec7e0fd
44
comp/src/gb.report/.src/Preview/CPrint.class
Normal file
44
comp/src/gb.report/.src/Preview/CPrint.class
Normal file
@ -0,0 +1,44 @@
|
||||
' Gambas class file
|
||||
|
||||
Create Static
|
||||
Private hPrinter As New Printer As "Printer"
|
||||
Private $hPrint As Report
|
||||
|
||||
Public Sub PrintReport(hReport As Report)
|
||||
|
||||
Dim hSizeParse As TSizeParse
|
||||
|
||||
$hPrint = hReport.Clone()
|
||||
hPrinter.Paper = $hPrint.Paper
|
||||
hPrinter.Orientation = $hPrint.Orientation
|
||||
If $hPrint.Paper = Printer.Custom Then
|
||||
hSizeParse = New TSizeParse($hPrint.Width)
|
||||
hPrinter.PaperWidth = hSizeParse.ToCm() / 10
|
||||
hSizeParse = New TSizeParse($hPrint.Height)
|
||||
hPrinter.PaperHeight = hSizeParse.ToCm() / 10
|
||||
Endif
|
||||
If Not hPrinter.Configure() Then
|
||||
hPrinter.Print
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Sub Printer_Draw()
|
||||
|
||||
$hPrint.Paint(hPrinter.Page)
|
||||
|
||||
End
|
||||
|
||||
Public Sub Printer_Begin()
|
||||
|
||||
'Debug Object.Type($hReport)
|
||||
$hPrint.Layout
|
||||
hPrinter.Count = $hPrint.PageCount
|
||||
|
||||
End
|
||||
|
||||
Public Sub Printer_End()
|
||||
|
||||
$hPrint = Null
|
||||
|
||||
End
|
Loading…
x
Reference in New Issue
Block a user