Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,028

HOME > .NET Framework > Forum > ถามเรื่อง Printdocument ของ vb ครับ ผมอยากให้พิมพ์ข้อมูล แค่ 13 ราย ถ้าเกิน 13 ราย ให้เพิ่มหน้าใหม่ ครับ



 

ถามเรื่อง Printdocument ของ vb ครับ ผมอยากให้พิมพ์ข้อมูล แค่ 13 ราย ถ้าเกิน 13 ราย ให้เพิ่มหน้าใหม่ ครับ

 



Topic : 133074



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



ถามเรื่อง Printdocument ของ vb ครับ ผมอยากให้พิมพ์ข้อมูล แค่ 13 ราย ถ้าเกิน 13 ราย ให้เพิ่มหน้าใหม่ ครับ
รบกวนท่านอาจารย์ทั้งหลายหน่อยครับ

Code (VB.NET)
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click   ปุ่มสั่งพิมพ์คับ
        PrintPreviewDialog1.ShowDialog()
    End Sub

Private Sub PrintDocument1_PrintPage(sender As Object, e As PrintPageEventArgs) Handles PrintDocument1.PrintPage
        Dim newImage As Image = My.Resources.businessman
        Dim row As Integer = 530
        Dim col As Integer = 160
        Dim row1 As Integer = 416
        Dim row2 As Integer = 477
        Dim col1 As Integer = 43
        Dim printFont As New Font("Century Gothic", 14)
        Dim printFont3 As New Font("Century Gothic", 11)
        Dim printFont2 As New Font("Century Gothic", 18, FontStyle.Bold)
        Dim printposition As New PointF
        Dim printposition2 As New PointF
        Dim printcolor As New SolidBrush(Color.Black)
        Dim i As Integer
        Dim width As Integer = 100
        Dim heigth As Integer = 100
        Try

            Statement =
            " SELECT * " &
            " From Service LEFT OUTER JOIN employer ON Service.noemployer = employer.noemployer  " &
            " WHERE " &
            " IdService = " & "" & txtIdservice.Text & "" &
            " ORDER BY idservice "
            cmd = New OleDbCommand(Statement, Conn)
            dr = cmd.ExecuteReader
            While dr.Read()
                e.Graphics.DrawImage(newImage, 50, 50, width, heigth)
                e.Graphics.DrawString("" & My.Settings.nameemployer & "", printFont2, printcolor, 310, 80)
                e.Graphics.DrawString("" & My.Settings.addressemployer & " ", printFont, printcolor, 180, 110)
                e.Graphics.DrawString("โทร : " & My.Settings.tell & "", printFont, printcolor, 260, 140)
                e.Graphics.DrawString("ใบรับงาน", printFont2, printcolor, 400, 200)
                e.Graphics.DrawString("เล่มที่ " & TextBox1.Text & "", printFont, printcolor, 50, 200)
                e.Graphics.DrawString("เลขที่ " & TextBox2.Text & "", printFont, printcolor, 700, 200)
                e.Graphics.DrawString("วันที่  " & TextBox10.Text & "", printFont, printcolor, 550, 250)
                e.Graphics.DrawString("รหัสบริการ " & dr.Item("Idservice").ToString & "", printFont, printcolor, 50, 280)
                e.Graphics.DrawString("ชื่อนายจ้าง  " & dr.Item("nameemployer").ToString & "", printFont, printcolor, 50, 320)
                e.Graphics.DrawString("เบอร์โทรติดต่อ  " & dr.Item("tel").ToString & "", printFont, printcolor, 500, 320)
                e.Graphics.DrawString("ผู้ยื่นเอกสาร  " & dr.Item("contact").ToString & "", printFont, printcolor, 50, 360)
  printposition = New PointF(col, row)
                e.Graphics.DrawString("" & dr.Item("passport").ToString & "", printFont, printcolor, printposition)
                e.Graphics.DrawString("" & dr.Item("namealien").ToString & "", printFont, printcolor, 280, row)
                'e.Graphics.DrawString(DataGridView2.Rows(x).Cells(2).Value.ToString, printFont, printcolor, printposition)
                row = row + 30
                '  Next
            End While
  dr.Close()
            cmd.Dispose()
        Catch ex As Exception
            MessageBox.Show(ex.Message, "ข้อผิดพลาด กรุณาทำรายการใหม่", MessageBoxButtons.OK, MessageBoxIcon.Error)

        End Try
    End Sub




Tag : .NET







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2019-02-06 15:13:03 By : 1639518442828154 View : 948 Reply : 2
 

 

No. 1



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

e.Graphics.DrawString("" & dr.Item("passport").ToString & "", printFont, printcolor, printposition)
e.Graphics.DrawString("" & dr.Item("namealien").ToString & "", printFont, printcolor, 280, row)
'e.Graphics.DrawString(DataGridView2.Rows(x).Cells(2).Value.ToString, printFont, printcolor, printposition)
row = row + 30

ผมอยากให้ส่วนนี้ พอครับ 13 รายการ ก็ให้สั่งพิมพ์หน้าใหม่เลยอะครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-02-06 15:14:23 By : 1639518442828154
 


 

No. 2



โพสกระทู้ ( 46 )
บทความ ( 0 )



สถานะออฟไลน์


เวลาทำรายงานเพื่อสั่งพิมพ์ ผมแนะนำให้เขียนรายงานแยกดีกว่าครับ
มันจัดการได้ง่ายและยืดหยุ่นกว่า ลองศึกษา SQL Server Reporting Services (SSRS), crystal report ดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2019-04-25 13:47:45 By : jaypang
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ถามเรื่อง Printdocument ของ vb ครับ ผมอยากให้พิมพ์ข้อมูล แค่ 13 ราย ถ้าเกิน 13 ราย ให้เพิ่มหน้าใหม่ ครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่