Sub ConsultaNota (xCaja, xNota As String)
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("select_partidas", Array(xCaja, xNota))
Wait For (req.ExecuteQuery(cmd, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Wait For (req) req_Result(res As DBResult)
'work with result
req.PrintTable(res)
Dim x As Int=1
Dim AProducto, ANota, ACaja, APartida, ACantidad,APrecio, AImporte As String
Dim ATienda As String
Dim AExistencia As String
Dim AEmpaque, ACajas
Table2.Left = 5dip
Table2.Height = 90%y - 80dip
Table2.Width = 96%x
Table2.Top = Table1.Top + 43dip
Table2.Visible = True
Table2.MultiSelect = True
Table2.HeaderColor = Colors.Blue
Table2.HeaderTextColor = Colors.Yellow
Table2.TextColor = Colors.Blue
Table2.TableColor = Colors.Red
Table2.RowHeight = 20dip
Table2.ShowStatusLine = False
Table2.StatusLineAutoFill = False
Table2.SortColumn = False
Table2.SingleLine = True
Table2.LineWidth = 3dip
Table2.TextSize = 11
Dim Alignments() As Int
Alignments = Array As Int(Gravity.CENTER, Bit.Or(Gravity.CENTER, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.Center, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.left, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.Center, Gravity.CENTER_VERTICAL), Bit.Or(Gravity.RIGHT, Gravity.CENTER_VERTICAL),Bit.Or(Gravity.RIGHT, Gravity.CENTER_VERTICAL))
Table2.SetCellAlignments(Alignments)
Dim tf() As Typeface
tf = Array As Typeface(Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT, Typeface.DEFAULT)
Table2.SetTypeFaces(tf)
Table2.SetHeaderTypeFaces(tf)
Table2.SetHeader(Array As String("Caja","Nota", "Partida", "Producto", "Cantidad", "Precio","Importe"))
Table2.SetColumnsWidths(Array As Int(15%x, 20%x, 15%x, 35%x, 18%x, 20%x, 20%x))
Table2.ClearAll
For Each records() As Object In res.Rows
ACaja=records(0)
ANota=records(1)
APartida=NumberFormat(records(2),0,0)
AProducto=records(8)
ACantidad=NumberFormat(records(9),1,2)
APrecio="$ "&NumberFormat(records(11),1,2)
AImporte="$ "&NumberFormat(records(18),1,2)
Table2.AddRow(Array As String(ACaja,ANota,APartida,AProducto,ACantidad,APrecio,AImporte))
Next
j.Release
Else
Msgbox("NO HAY CONEXION CON EL SERVIDOR DE DATOS.","ALERTA !!!!!")
Log("ERROR: " & j.ErrorMessage)
j.Release
End If
End Sub