PDA

View Full Version : [VB] Stampare un report sensa Crystal Report


race2
08-10-2002, 13:58
VB.NET,

Come posso fare per Stampare un documento con qualche linea orizzontale, vorrei fare un report, ma non con Crystal Report.

race2
09-10-2002, 10:03
Ho trovato questo, come vi sembra ???

Ma se io voglio stampare un "DataSet" di dati ???




Private Sub PrintText(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(read("Nome"), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 50, 100)
ev.Graphics.DrawString(read("Cognome"), New Font("Arial", 8, FontStyle.Regular), Brushes.Black, 150, 100)
ev.HasMorePages = False
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim PrintDoc As New PrintDocument()
AddHandler PrintDoc.PrintPage, AddressOf Me.PrintText
AddHandler PrintDocument1.PrintPage, AddressOf Me.PrintText
PrintDoc.Print()
End Sub