Sabtu, 29 Agustus 2009

Print Menggunakan listView VB6.0

membuat tampilan print dengan list view

langsung aja nich kodenya

Sub cetakdata()Dim mno, mhal, mbaris, mbaris1 As IntegerDim i, n As IntegerDim mgrs, mgrss As StringPrinter.Print "";Printer.Print "";Printer.Font = "Verdana"Printer.ForeColor = &H0&Printer.FontSize = 6Printer.FontBold = FalsePrinter.CurrentX = 0Printer.CurrentY = 0mno = 0mhal = 0i = 1m = 1Do While (i <= LV1.ListItems.Count) And (m <= LV2.ListItems.Count) mbaris = 1 mhal = mhal + 1 Printer.Print ; " " Printer.Print ; " " Printer.Print ; " " Printer.Print Tab(4); Printer.FontBold = False Printer.FontSize = 7 Printer.Print Tab(5); "Laporan Rugi Laba" Printer.Print ; " " Printer.Print Tab(5); Combo1.Text; Printer.Print Tab(25); ":"; Text1.Text; Printer.FontBold = False Printer.Print ; " " Printer.Print ; " "mgrs = String$(65, "=")mgrss = String$(100, "-")Printer.Print Tab(5); mgrssPrinter.FontBold = FalsePrinter.Print Tab(5); "Tanggal";Printer.Print Tab(25); "Jumlah Penjualan";Printer.Print Tab(55); "Tanggal";Printer.Print Tab(75); "Jumlah Pembelian";
Printer.FontBold = FalsePrinter.Print Tab(5); mgrssmbaris = 0Do While i <= LV1.ListItems.Count And mbaris < 60 Set itm = LV1.ListItems.Item(i) mno = mno + 1 Printer.Print Tab(5); itm.SubItems(1); Printer.Print Tab(25); itm.SubItems(2); mbaris = mbaris + 1 i = i + 1Loopmbaris1 = 0
Do While m <= LV2.ListItems.Count And mbaris < 60 Set itm1 = LV2.ListItems.Item(m) mno = mno + 1 Printer.Print Tab(55); itm1.SubItems(1); Printer.Print Tab(75); itm1.SubItems(2); mbaris1 = mbaris1 + 1 m = i + 1Loop
Printer.Print Tab(5); mgrss Printer.Print Tab(5); "Total Penjualan"; Printer.Print Tab(25); Text2.Text; Printer.Print Tab(40); "Total Pembelian"; Printer.Print Tab(75); Text3.Text; Printer.Print ; " " Printer.Print Tab(5); ket.Caption; Printer.Print Tab(25); Text4.Text;Printer.Print ; " "Printer.Print Tab(5); "Tanggal Cetak ";Printer.FontBold = FalsePrinter.FontItalic = TruePrinter.Print Tab(25); ":"; Format(Now, "dd/mm/yyyy");If mbaris >= 30 ThenPrinter.NewPageEnd IfLoopPrinter.EndDocEnd Sub

Tidak ada komentar:

Posting Komentar