أعزائي ما زلت أقدم لكم سلسلة دروس VB2005
ودرسنا اليوم هو الطباعة من خلال الفيجوال بدون كريستال ريبورت
المثال المرفق خير دليل
Public Class Form1
Dim I As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
With My.Computer.Printers.DefaultPrinter
.Units = 0
.CurrentY = 2
.HorizontalAlignment = HorizontalAlignment.Center
.FontName = "Simplified Arabic"
.FontSize = 14
.FontStyle = FontStyle.Bold
.ForeColor = Color.Black
.DrawFilledRectangle(1, 1, 18, 2.5)
.ForeColor = Color.Red
.WriteLine("فاتورة ضريبية")
For I = 1 To 5
.HorizontalAlignment = HorizontalAlignment.Right
.CurrentY = 4 + I
.FontSize = 12
.FontStyle = FontStyle.Regular
.ForeColor = Color.Black
.WriteLine(Me.TextBox1.Text)
.DrawLine(1, 5 + I, 19, 5 + I)
Next I
.PrintPreview()
End With
End Sub
End Class