Последнее обновление 11/24/02.
| |
Простенький пример
печати бланка отчета без применения Crystal
Report. Такой способ вывода на печать более
трудоемок, но зато результат в меньшей
степени зависит от марки принтера. Mожно
использовать даже Epson FX-1000, который
обычно не справляется с текстами Word 97,
если применены таблицы или иные
графические элементы. |
Private Sub mnuPrint_Click()
'---------------------------------------------------
'Пример печати бланка
платежного поручения
'без применения Crystal Report, с
которым никак не
'удавалось один к одному
выдержать заданные
'размеры
'---------------------------------------------------
Printer.CurrentX = 1200
Printer.CurrentY = 120
Printer.FontBold = True
Printer.Print "ПЛАТЕЖНОЕ
ПОРУЧЕНИЕ №"
Printer.Line (10260, 60)-(11175, 375), , B
Printer.CurrentX = 10320
Printer.CurrentY = 120
Printer.FontBold = False
Printer.Print "0401060"
Printer.CurrentX = 6660
Printer.CurrentY = 420
Printer.Print "Дата"
Printer.CurrentX = 8700
Printer.CurrentY = 420
Printer.Print "Вид платежа"
Printer.CurrentX = 1200
Printer.CurrentY = 840
Printer.Print "Сумма"
Printer.CurrentX = 1200
Printer.CurrentY = 1120
Printer.Print "прописью"
Printer.Line (2340, 840)-(2340, 1695)
Printer.CurrentX = 1200
Printer.CurrentY = 1740
Printer.Print "ИНН"
Printer.Line (6720, 1680)-(6720, 6795)
Printer.Line (7560, 1680)-(7560, 6795)
Printer.CurrentX = 6840
Printer.CurrentY = 1980
Printer.Print "Сумма"
Printer.Line (6720, 2520)-(11235, 2520)
Printer.CurrentX = 6840
Printer.CurrentY = 2880
Printer.Print "Сч.№"
Printer.Line (1200, 3360)-(7575, 3360)
Printer.CurrentX = 1200
Printer.CurrentY = 3120
Printer.Print "Плательщик"
Printer.CurrentX = 6840
Printer.CurrentY = 3600
Printer.Print "БИК"
Printer.CurrentX = 6840
Printer.CurrentY = 3900
Printer.Print "Сч.№"
Printer.CurrentX = 1200
Printer.CurrentY = 3960
Printer.Print "Банк плательщика"
Printer.Line (1200, 4200)-(11235, 4200)
Printer.Line (6000, 360)-(7935, 360)
Printer.Line (8220, 360)-(10095, 360)
Printer.Line (1200, 1680)-(11235, 1680)
Printer.CurrentX = 1200
Printer.CurrentY = 4800
Printer.Print "Банк получателя"
Printer.CurrentX = 6840
Printer.CurrentY = 4440
Printer.Print "БИК"
Printer.CurrentX = 6840
Printer.CurrentY = 4740
Printer.Print "Сч.№"
Printer.Line (1200, 5040)-(7575, 5040)
Printer.CurrentX = 1200
Printer.CurrentY = 5100
Printer.Print "ИНН"
Printer.CurrentX = 6840
Printer.CurrentY = 5340
Printer.Print "Сч.№"
Printer.Line (6720, 5880)-(11235, 5880)
Printer.CurrentX = 6780
Printer.CurrentY = 5940
Printer.Print "Вид.оп."
Printer.CurrentX = 6780
Printer.CurrentY = 6240
Printer.Print "Наз.пл."
Printer.CurrentX = 6780
Printer.CurrentY = 6540
Printer.Print "Код"
Printer.CurrentX = 8760
Printer.CurrentY = 5940
Printer.Print "Срок плат."
Printer.CurrentX = 8760
Printer.CurrentY = 6240
Printer.Print "Очер.плат."
Printer.CurrentX = 8760
Printer.CurrentY = 6540
Printer.Print "Рез. поле"
Printer.Line (6720, 6180)-(7575, 6180)
Printer.Line (6720, 6480)-(7575, 6480)
Printer.Line (8700, 6180)-(9855, 6180)
Printer.Line (8700, 6480)-(9855, 6480)
Printer.Line (1200, 6780)-(11235, 6780)
Printer.Line (8700, 5880)-(8700, 6795)
Printer.Line (9840, 5880)-(9840, 6795)
Printer.CurrentX = 1200
Printer.CurrentY = 6540
Printer.Print "Получатель"
Printer.CurrentX = 1200
Printer.CurrentY = 6840
Printer.Print "Назначение платежа,
наименование товара, выполненных работ,
оказанных услуг, №№ и даты товарных"
Printer.CurrentX = 1200
Printer.CurrentY = 7080
Printer.Print "документов,
договоров, НДС"
Printer.FontName = "Arial"
Printer.FontSize = 10
Printer.CurrentX = 4320
Printer.CurrentY = 120
Printer.Print Text1.Text
Printer.CurrentX = 6000
Printer.CurrentY = 120
Printer.Print Text2.Text
Printer.CurrentX = 8220
Printer.CurrentY = 120
Printer.Print Combo1.Text
Printer.CurrentX = 7680
Printer.CurrentY = 1980
Printer.Print Text7.Text
Printer.CurrentX = 2460
Printer.CurrentY = 1320
Printer.Print Text4.Text
Printer.CurrentX = 1200
Printer.CurrentY = 2220
Printer.Print Text3.Text
Printer.CurrentX = 1200
Printer.CurrentY = 2700
Printer.Print DBCombo1.Text
Printer.CurrentX = 1200
Printer.CurrentY = 3600
Printer.Print Text9.Text
Printer.CurrentX = 7680
Printer.CurrentY = 2820
Printer.Print Text8.Text
Printer.CurrentX = 7680
Printer.CurrentY = 3540
Printer.Print Text10.Text
Printer.CurrentX = 7680
Printer.CurrentY = 3900
Printer.Print Text11.Text
Printer.CurrentX = 1200
Printer.CurrentY = 4400
Printer.Print Text12.Text
Printer.CurrentX = 7680
Printer.CurrentY = 4380
Printer.Print Text13.Text
Printer.CurrentX = 7680
Printer.CurrentY = 4740
Printer.Print Text14.Text
Printer.CurrentX = 7680
Printer.CurrentY = 5280
Printer.Print Text17.Text
Printer.CurrentX = 1200
Printer.CurrentY = 5580
Printer.Print Text15.Text
Printer.CurrentX = 1200
Printer.CurrentY = 6060
Printer.Print DBCombo2.Text
Printer.CurrentX = 9960
Printer.CurrentY = 5940
Printer.Print Text18.Text
Printer.CurrentX = 9960
Printer.CurrentY = 6240
Printer.Print Text19.Text
If Check2.Value = 1 Then GoTo 20
Printer.CurrentX = 1200
Printer.CurrentY = 7500
Printer.Print Text20.Text
Printer.CurrentX = 1200
Printer.CurrentY = 8060
Printer.Print Text23.Text
Printer.FontName = "MS Sans Serif"
Printer.FontSize = 8
Printer.Line (1200, 8460)-(11235, 8460)
Printer.CurrentX = 6270
Printer.CurrentY = 8520
Printer.Print "Подписи"
Printer.CurrentX = 9255
Printer.CurrentY = 8520
Printer.Print "Отметки банка"
Printer.CurrentX = 2880
Printer.CurrentY = 9460
Printer.Print "М.П."
Printer.Line (5115, 9460)-(8475, 9460)
If Check1.Value = 0 Then
Printer.Line (5115,
10260)-(8475, 10260)
GoTo 10
End If
Printer.CurrentX = 1200
Printer.CurrentY = 8520
Printer.Print "Вторая подпись не
предусмотрена"
GoTo 10
20 Printer.CurrentX = 1200
Printer.CurrentY = 7260
Printer.Print Text20.Text
Printer.CurrentX = 1200
Printer.CurrentY = 7500
Printer.Print Text23.Text
Printer.FontName = "MS Sans Serif"
Printer.FontSize = 8
Printer.FontBold = True
Printer.CurrentX = 2555
Printer.CurrentY = 7900
Printer.Print "раздел"
Printer.CurrentX = 5215
Printer.CurrentY = 7900
Printer.Print "параграф"
Printer.CurrentX = 7875
Printer.CurrentY = 7900
Printer.Print "код операции"
Printer.CurrentX = 2555
Printer.CurrentY = 8200
Printer.Print "налог:"
Printer.CurrentX = 2555
Printer.CurrentY = 8500
Printer.Print "пеня:"
Printer.CurrentX = 2555
Printer.CurrentY = 8800
Printer.Print "штраф:"
Printer.FontBold = False
Printer.FontName = "Arial"
Printer.FontSize = 10
Printer.CurrentX = 3675
Printer.CurrentY = 7900
Printer.Print Text5.Text
Printer.CurrentX = 6335
Printer.CurrentY = 7900
Printer.Print Text6.Text
Printer.CurrentX = 3675
Printer.CurrentY = 8200
Printer.Print Text16.Text
Printer.CurrentX = 3675
Printer.CurrentY = 8500
Printer.Print Text21.Text
Printer.CurrentX = 3675
Printer.CurrentY = 8800
Printer.Print Text22.Text
Printer.FontName = "MS Sans Serif"
Printer.FontSize = 8
Printer.Line (1200, 9070)-(11235, 9070)
Printer.CurrentX = 6270
Printer.CurrentY = 9130
Printer.Print "Подписи"
Printer.CurrentX = 9255
Printer.CurrentY = 9130
Printer.Print "Отметки банка"
Printer.CurrentX = 2880
Printer.CurrentY = 10070
Printer.Print "М.П."
Printer.Line (5115, 10070)-(8475, 10070)
If Check1.Value = 0 Then
Printer.Line (5115,
10870)-(8475, 10870)
GoTo 10
End If
Printer.CurrentX = 1200
Printer.CurrentY = 9130
Printer.Print "Вторая подпись не
предусмотрена"
10 Printer.EndDoc
End Sub |
| |
|