  | 
              
	              
	                
  
    |   | 
   
  
    
        
        PrintDialog ให้ข้อมูลใน datagridview มีทศนิยม .00 กำหนดเป็น "N2" แล้วแต่ก็ได้ค่าเป็นจำนวนเต็มอยู่ครับ     | 
   
  
    |   | 
   
 
 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 .ToString("0.00") 
 
"N2" ไม่ได้เกี่ยวกับ report แค่ displayใน datagrid                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-26 19:55:57 | 
                        By :
                            lamaka.tor | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 มันแสดงแค่ 6 อ่ะครับ 
                         
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-26 20:11:11 | 
                        By :
                            2535466999857732 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แล้วได้ทำตามที่บอกไปยังครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-26 20:51:12 | 
                        By :
                            lamaka.tor | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ทำแล้วครับผม                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-26 21:27:44 | 
                        By :
                            2535466999857732 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ขอดูโค้ดล่าสุดหน่อยคร้าบ เขียนไปยังไงแล้วมั่ง                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-26 21:32:34 | 
                        By :
                            lamaka.tor | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 Code (VB.NET) 
Dim font1 As New Font("Angsana New", 19)
        Dim font2 As New Font("Angsana New", 38)
        Dim head As String = "ใบเสร็จรับเงิน"
        Dim js As String = "ร้าน เจริญค้า"
        Dim add As String = "198/8 ม.7 ต.อ่างทอง อ.เมือง จ.ราชบุรี 70000"
        Dim order As String = "เลขที่ : "
        Dim cusname As String = "ชื่อลูกค้า:"
        Dim datess As String = "วันที่ : "
        Dim typecus As String = Tb_cname.Text
        Dim x As String = Tb_order.Text
        Dim daytime As Date = Date.Today
        Dim line As String = "______________________________________________________________________________________"
        Dim deta As String = "                  สินค้า                                    จำนวน              หน่วย                     ราคา                        รวมเงิน"
        Dim tot As String = "รวมเงินทั้งสิ้น : "
        Dim sum As String = Tb_total.Text
        Dim bath As String = "บาท"
        Dim c1 As String = "ผู้รับของ:__________________"
        Dim c2 As String = "ผู้รับเงิน:__________________"
        e.Graphics.DrawString(js.ToString, font1, Brushes.Black, 50, 75)  
        e.Graphics.DrawString(head.ToString, font2, Brushes.Black, 300, 15)
        e.Graphics.DrawString(add.ToString, font1, Brushes.Black, 50, 105)
        e.Graphics.DrawString(order.ToString, font1, Brushes.Black, 50, 135)
        e.Graphics.DrawString(x.ToString, font1, Brushes.Black, 110, 135)
        e.Graphics.DrawString(datess.ToString, font1, Brushes.Black, 50, 165)
        e.Graphics.DrawString(daytime.Date, font1, Brushes.Black, 100, 165)
        e.Graphics.DrawString(cusname.ToString, font1, Brushes.Black, 50, 195)
        e.Graphics.DrawString(typecus.ToString, font1, Brushes.Black, 120, 195)
        
        e.Graphics.DrawString(line.ToString, font1, Brushes.Black, 30, 200) 'เส้นคั่น
        e.Graphics.DrawString(deta.ToString, font1, Brushes.Black, 30, 230)
        e.Graphics.DrawString(line.ToString, font1, Brushes.Black, 30, 240) 'เส้นคั่น
        Dim PrintPosition As New PointF
        Dim PrintColor As New SolidBrush(Color.Black)
        Dim col As Integer = 50 'ยาว
        Dim row As Integer = 280 'บรรทัด
        Dim col1 As Integer = 340
        Dim row1 As Integer = 280
        Dim col2 As Integer = 440
        Dim row2 As Integer = 280
        Dim col3 As Integer = 640
        Dim row3 As Integer = 300
        Dim col4 As Integer = 790
        Dim row4 As Integer = 300
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col, row)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(2).Value.ToString, font1, PrintColor, PrintPosition)
            row = row + 30
        Next
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col1, row1)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(5).Value.ToString, font1, PrintColor, PrintPosition)
            row1 = row1 + 30
        Next
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col2, row2)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(3).Value.ToString, font1, PrintColor, PrintPosition)
            row2 = row2 + 30
        Next
        Dim format1 As New StringFormat(StringFormatFlags.NoClip)
        Dim format2 As New StringFormat(format1)
        format1.LineAlignment = StringAlignment.Near
        format1.Alignment = StringAlignment.Center
        format2.LineAlignment = StringAlignment.Center
        format2.Alignment = StringAlignment.Far
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col3, row3)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(4).Value.ToString, font1, PrintColor, PrintPosition, format2)
            row3 = row3 + 30
        Next
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col4, row4)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(6).Value.ToString, font1, PrintColor, PrintPosition, format2)
            row4 = row4 + 30
        Next
       
        e.Graphics.DrawString(line.ToString, font1, Brushes.Black, 30, 950) 'เส้นคั่น 
        e.Graphics.DrawString(tot.ToString, font1, Brushes.Black, 520, 1000)
        e.Graphics.DrawString(sum.ToString, font1, Brushes.Black, 640, 1000)
        e.Graphics.DrawString(bath.ToString, font1, Brushes.Black, 750, 1000)
        e.Graphics.DrawString(c1.ToString, font1, Brushes.Black, 80, 1050)
        e.Graphics.DrawString(c2.ToString, font1, Brushes.Black, 85, 1110)
    End Sub
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-26 21:58:02 | 
                        By :
                            2535466999857732 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ช่วยหน่อยค้าบ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-30 01:17:18 | 
                        By :
                            2535466999857732 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 กลับไปอ่านความเห็น 1 ทำตรงไหนทีบอกทำแล้ว                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-30 05:46:30 | 
                        By :
                            Chaidhanan | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ตามที่ท่าน Chaidhanan บอกเลยครับ 
ถ้าไม่ได้ แสดงว่า ไม่ได้ทำ คร้าบ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-04-30 08:17:13 | 
                        By :
                            lamaka.tor | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ผมทำตามไปแล้วครับมันไม่แสดง 650.00 แต่ แสดง 6 แทนครับ 
 
Code (VB.NET) 
Dim font1 As New Font("Angsana New", 19)
        Dim font2 As New Font("Angsana New", 38)
        Dim head As String = "ใบเสร็จรับเงิน"
        Dim js As String = "ร้าน เจริญค้า"
        Dim add As String = "198/8 ม.7 ต.อ่างทอง อ.เมือง จ.ราชบุรี 70000"
        Dim order As String = "เลขที่ : "
        Dim cusname As String = "ชื่อลูกค้า:"
        Dim datess As String = "วันที่ : "
        Dim typecus As String = Tb_cname.Text
        Dim x As String = Tb_order.Text
        Dim daytime As Date = Date.Today
        Dim line As String = "______________________________________________________________________________________"
        Dim deta As String = "                  สินค้า                                    จำนวน              หน่วย                     ราคา                        รวมเงิน"
        Dim tot As String = "รวมเงินทั้งสิ้น : "
        Dim sum As String = Tb_total.Text
        Dim bath As String = "บาท"
        Dim c1 As String = "ผู้รับของ:__________________"
        Dim c2 As String = "ผู้รับเงิน:__________________"
        e.Graphics.DrawString(js.ToString, font1, Brushes.Black, 50, 75)  
        e.Graphics.DrawString(head.ToString, font2, Brushes.Black, 300, 15)
        e.Graphics.DrawString(add.ToString, font1, Brushes.Black, 50, 105)
        e.Graphics.DrawString(order.ToString, font1, Brushes.Black, 50, 135)
        e.Graphics.DrawString(x.ToString, font1, Brushes.Black, 110, 135)
        e.Graphics.DrawString(datess.ToString, font1, Brushes.Black, 50, 165)
        e.Graphics.DrawString(daytime.Date, font1, Brushes.Black, 100, 165)
        e.Graphics.DrawString(cusname.ToString, font1, Brushes.Black, 50, 195)
        e.Graphics.DrawString(typecus.ToString, font1, Brushes.Black, 120, 195)
        
        e.Graphics.DrawString(line.ToString, font1, Brushes.Black, 30, 200) 'เส้นคั่น
        e.Graphics.DrawString(deta.ToString, font1, Brushes.Black, 30, 230)
        e.Graphics.DrawString(line.ToString, font1, Brushes.Black, 30, 240) 'เส้นคั่น
        Dim PrintPosition As New PointF
        Dim PrintColor As New SolidBrush(Color.Black)
        Dim col As Integer = 50 'ยาว
        Dim row As Integer = 280 'บรรทัด
        Dim col1 As Integer = 340
        Dim row1 As Integer = 280
        Dim col2 As Integer = 440
        Dim row2 As Integer = 280
        Dim col3 As Integer = 640
        Dim row3 As Integer = 300
        Dim col4 As Integer = 790
        Dim row4 As Integer = 300
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col, row)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(2).Value.ToString, font1, PrintColor, PrintPosition)
            row = row + 30
        Next
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col1, row1)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(5).Value.ToString, font1, PrintColor, PrintPosition)
            row1 = row1 + 30
        Next
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col2, row2)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(3).Value.ToString, font1, PrintColor, PrintPosition)
            row2 = row2 + 30
        Next
        Dim format1 As New StringFormat(StringFormatFlags.NoClip)
        Dim format2 As New StringFormat(format1)
        format1.LineAlignment = StringAlignment.Near
        format1.Alignment = StringAlignment.Center
        format2.LineAlignment = StringAlignment.Center
        format2.Alignment = StringAlignment.Far
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col3, row3)
            e.Graphics.DrawString(DataGridView3.Rows(z).Cells(4).Value.ToString, font1, PrintColor, PrintPosition, format2)
            row3 = row3 + 30
        Next
        For z = 0 To DataGridView3.Rows.Count - 2
            PrintPosition = New PointF(col4, row4)
           e.Graphics.DrawString(DataGridView3.Rows(z).Cells(6).Value.ToString("0.00"), font1, PrintColor, PrintPosition, format2)
            row4 = row4 + 30
        Next
       
        e.Graphics.DrawString(line.ToString, font1, Brushes.Black, 30, 950) 'เส้นคั่น 
        e.Graphics.DrawString(tot.ToString, font1, Brushes.Black, 520, 1000)
        e.Graphics.DrawString(sum.ToString, font1, Brushes.Black, 640, 1000)
        e.Graphics.DrawString(bath.ToString, font1, Brushes.Black, 750, 1000)
        e.Graphics.DrawString(c1.ToString, font1, Brushes.Black, 80, 1050)
        e.Graphics.DrawString(c2.ToString, font1, Brushes.Black, 85, 1110)
    End Sub
                        
               
               | 
             
            
              
			                
  ประวัติการแก้ไข 2019-05-01 00:45:26 2019-05-01 00:46:16              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-05-01 00:34:37 | 
                        By :
                            2535466999857732 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |