You are on page 1of 2

SUMAR COLUMNAS DE DW

Crea un evento en el dw.


Por ejemplo. Llamalo ue_calcular.. sin valor de retorno y sin parmetros
en este evento codificaras lo siguiente.
//Esto asumiendo que el importe ya esta incluido el igv.
int li_fila
dec(2) ldec_subtotal=0,ldec_igv=0,ldec_total=0
dw_1.accepttext()
if dw_1.rowcount() > 0 then
for li_fila = 1 to dw_1.rowcount()
ldec_total = ldec_total + dw_1.getitemstring(li_fila,'importe')
next
ldec_subtotal = ldec_total / (1.19) //Desgregando el igv
ldec_igv = ldec_total - ldec_subtotal
end if
sle_subtotal.text = string(ldec_subtotal,"#####0.00")
sle_igv.text = string(ldec_igv,"#####0.00")
sle_total.text = string(ldec_total,"#####0.00")
//Obiamente este vento tendrias que invocarlo cuando agregas o quitas filas nuevas en el
dw
Saludos!

Ok, si has creado tu ODBC, debes de marcar la opcin TCP/IP.

Otro.
hola, para leer un compute field es similar a leer un campo del dw

decimal ldec_total
ldec_total=dw_1.getitemdecimal(1,"total_general")) //total_general seria el nombre del compute field

st_1.text=string(ldec_total,"#####0.00")

You might also like