FoxPro/Visual FoxPro - TENGO PROBLEMAS CON UNA GRID

 
Vista:

TENGO PROBLEMAS CON UNA GRID

Publicado por Jose Medina (4 intervenciones) el 25/03/2007 07:24:33
Buenas, necesito ayuda urgente, ya que por primera vez me encuentro utilizando una Grid en un formulario tipo factura, me han dicho que es facilisimo usarla pero me encuentro trabajo, el proceso de la Grid donde busco productos, agrego cantidades y el precio y total, lo hace bien, el problema empieza a darse cuenta cuando no me graba nada en la Tabla, si alguien me pudiera ayudar muchas gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por Plinio (7841 intervenciones) el 25/03/2007 20:11:53
Todo depende de como estas manejando las cosas. Por ejemplo, la tabla de la que depende el grid esta en el Data Environment?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por Jose Medina (4 intervenciones) el 25/03/2007 20:24:14
no no se encuentra en el dataenvironment, me podrias explicar que puedo hacer para que funcione bien esta cosa, si no es mucha molestia, gracias por responder
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por juan fernando (537 intervenciones) el 25/03/2007 20:30:05
Primero se parte por tener un Botón de Grabar nueva factura
yo he diseñado varias facturas y me funciona asi.

Botón de Nueva Factura :
Primero hay que dibujar que añadir el valor de la última factura
al final de la tabla y asi la columna 1 del grid reciberá el primer
valor .
luego se dibuja el Grid mediante código incluidas todas las columnas
y se refresca .
este ejemplo tiene un grid con cuatro columnas .

Saludos desde La Patagonia CHILENA .

**************************************************************************************
Set Filter to
Sele facturar
Index on factura to nfac1

Public fac
store 0 to fac

Go Bottom
fac=factura
fac=fac+1


Thisform.Pageframe1.Page1.Text3.Value=fac

Set Filter to factura=fac
*
Append Blank
Replace factura With fac
*------------------------------------------------------------
Thisform.Pageframe1.Page1.Grid1.AllowAddNew=.t.
Thisform.Pageframe1.Page1.Grid1.ColumnCount=4
Thisform.Pageframe1.Page1.Grid1.RecordSource="facturar"
*------------------------------------------------------------
* Thisform.Pageframe1.Page1.Grid1.Column1.Header1.Caption=" Descripción"
* Thisform.Pageframe1.Page1.Grid1.Column1.ControlSource="facturar.descripcio"
* Thisform.Pageframe1.Page1.Grid1.Column1.Format="@!"
*-------------------------------------------------------------------------


Thisform.Pageframe1.Page1.Grid1.Column1.Header1.Caption=" Descripción"
Thisform.Pageframe1.Page1.Grid1.Column1.ControlSource="facturar.descripcio"
Thisform.Pageframe1.Page1.Grid1.Column1.Format="@!"
*-------------------------------------------------------------------------

Thisform.Pageframe1.Page1.Grid1.Column2.Header1.Caption="Cant."
Thisform.Pageframe1.Page1.Grid1.Column2.ControlSource="facturar.cantidad"
* Thisform.Pageframe1.Page1.Grid1.Column2.InputMask="9999999.9"
*-------------------------------------------------------------------------

Thisform.Pageframe1.Page1.Grid1.Column3.Header1.Caption="P.Unit."
Thisform.Pageframe1.Page1.Grid1.Column3.ControlSource="facturar.preciovent"

Thisform.Pageframe1.Page1.Grid1.Column4.Header1.Caption="Val.Total"
Thisform.Pageframe1.Page1.Grid1.Column4.ControlSource="facturar.neto"
Thisform.Pageframe1.Page1.Grid1.Column4.InputMask="99,999,999"
Thisform.Pageframe1.Page1.Refresh
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por Jose Medina (4 intervenciones) el 25/03/2007 20:35:50
FIJATE QUE TENGO TU RUTINA COMPLETA, PERO ME PIERDO EN LA FORMA QUE GRABAS LOS REGISTROS, Y NO ENTIENDO LO DEMAS, PODRIAS BAJAR UN POCO EL NIVEL
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por juan fernando (537 intervenciones) el 25/03/2007 20:37:09
si estás sobre el Formulario de Visual Foxpro
haces clic con el botón derecho del Mouse
eliges Entorno de Datos
Luego otro clic con el derecho y eliges Agregar
busca la Ruta de tús tablas y aceptar luego grabas el Form.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por Jose Medina (4 intervenciones) el 25/03/2007 20:52:43
tienes algun manual o algun ejemplo sencillo del grid, que me puedas enviar
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por juan fernando (537 intervenciones) el 25/03/2007 20:53:34
Mira José este es otro ejemplo no tiene que ver con factura
es una Orden de Trabajo (O.t ) y la forma es casi similar

Botón NUEVO :
Thisform.Pageframe1.Page1.Text7.Enabled=.t.

Sele tabla1
Inde On orden To ordenados
Public nuevaorden
store 0 to nuevaorden

Go Bottom
nuevaorden=orden
nuevaorden=nuevaorden+1

Thisform.Pageframe1.Page1.Text7.Value=nuevaorden

Set Filter to orden=nuevaorden

Append Blank
Replace orden With nuevaorden
*------------------------------------------------------------
* Pagina II **
Thisform.Pageframe1.Page2.Grid1.AllowAddNew=.t.
Thisform.Pageframe1.Page2.Grid1.ColumnCount=1
Thisform.Pageframe1.Page2.Grid1.RecordSource="tabla1"
*------------------------------------------------------------
* Thisform.Pageframe1.Page1.Grid1.Column1.Header1.Caption=" Descripción"
Thisform.Pageframe1.Page2.Grid1.Column1.ControlSource="tabla1.detalle1"
Thisform.Pageframe1.Page2.Grid1.Column1.Format="@!"
Thisform.Pageframe1.Page2.Grid1.Refresh
*-------------------------------------------------------------------------

Thisform.Pageframe1.Page2.Grid2.AllowAddNew=.t.
Thisform.Pageframe1.Page2.Grid2.ColumnCount=1
Thisform.Pageframe1.Page2.Grid2.RecordSource="tabla1"

*------------------------------------------------------------
* Thisform.Pageframe1.Page1.Grid1.Column1.Header1.Caption=" Descripción"
Thisform.Pageframe1.Page2.Grid2.Column1.ControlSource="tabla1.detalle2"
Thisform.Pageframe1.Page2.Grid2.Column1.Format="@!"
Thisform.Pageframe1.Page2.Grid2.Refresh
*--------------------------------------------------------------------------------

*Página III **
Thisform.Pageframe1.Page3.Grid1.AllowAddNew=.t.
Thisform.Pageframe1.Page3.Grid1.ColumnCount=2
Thisform.Pageframe1.Page3.Grid1.RecordSource="tabla1"
*------------------------------------------------------------
* Thisform.Pageframe1.Page1.Grid1.Column1.Header1.Caption=" Descripción"
Thisform.Pageframe1.Page3.Grid1.Column1.ControlSource="tabla1.detalle3"
Thisform.Pageframe1.Page3.Grid1.Column1.Format="@!"
*-----------------------------------------------------------------------
Thisform.Pageframe1.Page3.Grid1.Column2.Header1.Caption="Valor"
Thisform.Pageframe1.Page3.Grid1.Column2.Header1.FontBold=.t.
Thisform.Pageframe1.Page3.Grid1.Column2.ControlSource="tabla1.suma1"
Thisform.Pageframe1.Page3.Grid1.Column2.InputMask="99,999,999"
Thisform.Pageframe1.Page3.Grid1.Refresh
*-----------------------------------------------------------------------

ESTE OTRO EN LOS GRID :
EVENTO AFTER ROWCOLCHANGE DE LOS GRID
Este código es similar para todos los grid puesto que es el filtro para la O.t

sele tabla1

Set Filter to orden=nuevaorden

*___________________________________________
* Append Blank

Replace orden With Thisform.Pageframe1.Page1.Text7.Value
Repl rutcliente With rutc

AHORA EN EL EVENTO VALID DE LA TEXT1 DE LA COLUMNA 2 DEL ULTIMO
GRID QUEREMOS QUE NOS SUME LOS TOTALES PARCIALES DE LA OT.
Este es el código :

sele tabla1
Public nuevaorden

nuevaorden=Thisform.Pageframe1.Page1.text7.value
set filter to Orden=nuevaorden

Sum(suma1)to Thisform.Pageframe1.Page3.Text1.value
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por neo (1604 intervenciones) el 26/03/2007 16:08:02
Para Facturacion, aquí existe un codigo fuente que te puede servir de apoyo.

http://www.lawebdelprogramador.com/codigo/mostrar.php?pagina=2&id=34&texto=FoxPro/Visual+FoxPro

utiliza una grid solo como temporal, y después de ahí solo actualiza datos en cuestiones de articulos comprados, de existencia, etc.

Está hecha en vfp version 6, creo


suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por Ernesto Hernandez (4623 intervenciones) el 26/03/2007 18:19:25
mas directo

http://www.lawebdelprogramador.com/codigo/enlace.php?idp=1206&id=34&texto=FoxPro/Visual+FoxPro

Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:TENGO PROBLEMAS CON UNA GRID

Publicado por juan fernando (537 intervenciones) el 26/03/2007 19:47:31
Ya lo soluciono ,se contacto conmigo .
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar