1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| Private Sub cmdPrint_Click()
Dim leftTab As Integer
Dim indice As Integer
Protocol.WaitEndSend 'Wait for end of transaction before opening cmdDialog
MDIWin50.CommonDialog.CancelError = True
MDIWin50.CommonDialog.Flags = cdlPDPrintSetup
On Error GoTo ErrHandler
MDIWin50.CommonDialog.DialogTitle = LoadPrgString(MSG_PRINT_HISTOFILE)
MDIWin50.CommonDialog.ShowPrinter
leftTab = 500
If flxGridHistory.Rows <> 0 Then
Printer.Print ("********************************************************")
Printer.Print ("" & lblEditFrom.caption & " " & txtEdited.caption & " " & Now)
Printer.Print ("********************************************************")
Printer.Print ""
Printer.Print ""
Printer.Print (flxGridHistory.Rows - 1 & " alarms")
Printer.Print ""
Printer.Font.Bold = True
For indice = 0 To flxGridHistory.Rows - 1
If indice > 0 Then
Printer.Font.Bold = False
End If
Printer.CurrentX = leftTab + 200
Printer.Print flxGridHistory.TextMatrix(indice, 1);
Printer.CurrentX = leftTab + 2000
Printer.Print flxGridHistory.TextMatrix(indice, 2);
Printer.CurrentX = leftTab + 3500
Printer.Print flxGridHistory.TextMatrix(indice, 3);
Printer.CurrentX = leftTab + 6000
Printer.Print flxGridHistory.TextMatrix(indice, 5);
Printer.Print ""
Next
End If
Printer.EndDoc
Exit Sub
ErrHandler:
Exit Sub
End Sub |
Partager