|  |  | 
          
            | รบกวนสอบถามเรื่องการ print บน web service หน่อยครับ คือว่าผมสั่ง print จาก web service โดยตรงสามารถ print ออกได้ครบทั้งจำนวนและข้อมูล
 แต่ถ้าผมส่งค่าจาก Form ไปหา Service สามารถ print ออกได้ตามจำนวนที่สั่งครับ แต่เป็นกระดาษเปล่าออกมา
 ซึ่งตรวจสอบแล้วค่าที่ Form ก็ส่งไปหา Service จำนวนก็ออกครบ แต่ออกกระดาษเปล่าๆ
 Service
 
 Code (VB.NET)
 
     <WebMethod()> _
    Public Function Print_Sticker(ByVal Pallet_No As String, ByVal Location As String, ByVal Article As String, _
                                    ByVal Description As String, ByVal Qty As String) As Boolean
        PAL = Pallet_No
        PQTY = Qty
        LOC = Location
        ART = Article
        DESC = Description
        Try
            For rcoun As Integer = 0 To PQTY - 1
                pd.PrinterSettings.PrinterName = "IntermecPC43t"
                Artloop = rcoun + 1
                pd.Print()
            Next
            Return True
        Catch ex As Exception
            Throw ex
        End Try
    End Function
    Public Sub _Print(ByVal s As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd.PrintPage
        e.Graphics.DrawString("*" & PAL & "*", Fbarfont, Brushes.Black, x + 15, y + 55)
        e.Graphics.DrawString(PAL, Dfont, Brushes.Black, x + 15, y + 80)
        e.Graphics.DrawString(LOC, Bfont, Brushes.Black, x + 100, y + 5)
        e.Graphics.DrawString(ART & "-" & DESC, Dfont, Brushes.Black, x + 15, y + 30)
        e.Graphics.DrawString(" " & Artloop & " / " & PQTY, Bfont, Brushes.Black, x + 230, y + 5)
    End Sub
Form ที่ส่งค่าไป
 Code (VB.NET)
 
  Private Sub TxtQTY_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtQTY.KeyPress
        If e.KeyChar = Chr(13) Then
        ReturnToPickingService.Print_Sticker(TxtPalletNo.Text, TxtPicking.Text, TxtArticle.Text, TxtDesc.Text, TxtQTY.Text)
        End If
End Sub
 
 
 Tag : .NET, Oracle, WebService, VS 2008 (.NET 3.x), Mobile, Web Service
 
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2015-02-20 11:07:00 | By :
                          xcom | View :
                          834 | Reply :
                          2 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |