DEFINE REPORT (with filtered data)

Moderator: Rathinagiri

User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: DEFINE REPORT (with filtered data)

Post by SALINETAS24 »

Muchas gracias. Efectivamente el error lo causa el DbCreate, lo tengo que ejecutar una sola vez.
Pero no deja de ser muy raro que al intentar cerrarlo con "MEMDATO->(DBCloseArea())" pierda los datos del Grid, pero bueno con el aporte del Sr. Claudio ya lo tenemos solucionado.

Un cuestión más, en el DO REPORT (muy sencillo y facil, magnifica herramienta), imprime totales, pero hay alguna forma de imprimir subtotales cuando por ejemplo cambia el valor de unos de los campos, como indicaba lineas arriba. He estado viendo los ejemplos pero ninguno lo hace, sin embargo si que he visto en las fuentes del Report que en un momento imprimiría "SUBTOTAL", yo pense que GROUPED BY si se le indicaba la variable del fichero "workarea", cuando esta cambia de valor haría el subtotal...pero no.
En caso negativo, sería posible implementarlo en el código fuente..?

Y una de estética, en la visión previa a la impresión (esta muy bien), se muestra el informe con dos tamaños.., o muy pequeño .. o muy grande..., sería posible un tamaño intermedio?

Muchas gracias por leerme y ayudarme.
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: DEFINE REPORT (with filtered data)

Post by esgici »

srvet_claudio wrote: Tue Apr 10, 2018 8:16 pm
SALINETAS24 wrote: Tue Apr 10, 2018 4:43 pm Andy he conseguido imprimir 1 vez, pero cuando devuelvo el control al GRID y quiero volver a imprimir es cuando tengo problemas. Si no cierro me da un error ya que no ejecuta otra vez el DBCreate..., y si cierro pues entonces pierdo el GRID.
Creo que el problema está ahí. El dbcreate lo debes ejecutar una sola vez por ej al inicio del programa, luego cuando llamas la rutina de imprimir en lugar de poner el dbcreate haces un
Delete all
Pack
En el archivo memdato para borrar todo su contenido antes de hacer el filtrado.
DBCreate() is a common and frequently used function. So despite it is not important for authors, IMO may be useful for everyone and translated to international language :mrgreen:
Google Translate wrote:
srvet_claudio wrote: Tue Apr 10, 2018 8:16 pm
SALINETAS24 wrote: Tue Apr 10, 2018 4:43 pm Andy I have managed to print 1 time, but when I return the control to the GRID and I want to print again it is when I have problems. If I do not close it gives me an error because it does not execute the DBCreate again ..., and if I close then I lose the GRID.

I think the problem is there. The dbcreate should be executed once only eg at the beginning of the program, then when you call the print routine instead of putting the dbcreate you do a

In the memdato file to delete all its contents before filtering.
Creo que el problema está ahí. El dbcreate lo debes ejecutar una sola vez por ej al inicio del programa, luego cuando llamas la rutina de imprimir en lugar de poner el dbcreate haces un
Delete all
Pack
En el archivo memdato para borrar todo su contenido antes de hacer el filtrado.
Viva INTERNATIONAL HMG :mrgreen:
Viva INTERNATIONAL HMG :D
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: DEFINE REPORT (with filtered data)

Post by SALINETAS24 »

¿ Intenational language..? No entiendo a que te refieres.
De todas formas en la parte de arriba de la página hay una opción que te lo traduce al idioma deseado.
Al final hace más el que quiere que el que puede.
Saludos,
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: DEFINE REPORT (with filtered data)

Post by SALINETAS24 »

TACHAAAANNN, RESUELTO!!
El cAlias->(Dbclosearea()), funciona correctamente.
Lo que ocurre es que una vez cerrado el fichero en cuestión, el puntero del que está activo se vuelve loco.
Me ha ocurrido haciendo una agenda, una especie de POST-IT para activar con f2 muy simple pero efectiva.
Tengo una rutina que llamo desde cualquier parte del programa con F2, abro un fichero de Agenda y cuando termino lo cierro, (era entonces cuando desaparecían los datos del GRID activo).
Esta es la forma de solucionar que los datos del GRID no desaparezcan ..., por si alguno tiene el mismo problema.
Un chorrada, pero me ha liado varios días.

Al empezar guardar en una variable el alias del fichero activo "cAlias:=()".
Y cuando termino CIERRO y si hay algo en "cAlias", la activo DBSELECTAREA(cAlias)

Y esto es lo que dice GOOGLE que he dicho en Inglés-
-------------------------------------------------------------------------------------------------------------
TACHAAAANNN, RESOLVED !!
The cAlias ​​-> (Dbclosearea ()), works correctly.
What happens is that once closed the file in question, the pointer of which is active goes crazy.
It has happened to me doing an agenda, a kind of POST-IT to activate with f2 very simple but effective.
I have a routine that I call from any part of the program with F2, I open an Agenda file and when I finish I close it, (it was then when the active GRID data disappeared).
This is the way to solve that the data of the GRID does not disappear ..., in case any one has the same problem.
A bullshit, but it has messed up for several days.

When you start saving the alias of the active file "cAlias: = ()" in a variable.
And when I finish CLOSED and if there is something in "cAlias", the active DBSELECTAREA (cAlias)

---------------------------------------------------------------------------------------------------------------

Code: Select all

Function _AGENDA(cUser)
LOCAL cFichero
LOCAL cAlias:=DBF()
STATIC lRunCal:=.f.
DEFAULT cUser:="000"  //-> Es el usuario activo 

	IF lRunCal
		MsgBox( "La Agenad ya está en uso", "E R R O R" )
	  ELSE
		//--> Compruebo fichero
		IF !_IFFILE("AGENDA")
			MSGSTOP("AGENDA NO CREADA","¡ATENCION!")
		  ELSE
			lRunCal = .t.
		  	// --> Apertura de ficher
			// --> Hasta que esté arreglado el CLOSE no ejecutamos cierres parciales, abrimos en menu
			OPEN AGENDA
*			// --> Ejecuta funcion principal
			_AGEN_DA()
			CLOSED AGENDA	
			IF !Empty(cAlias)
				DBSELECTAREA(cAlias)
			ENDIF
		ENDIF
	ENDIF
	lRunCal=.f.
	
RETURN Nil
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
User avatar
SALINETAS24
Posts: 667
Joined: Tue Feb 27, 2018 3:06 am
DBs Used: DBF
Contact:

Re: DEFINE REPORT (with filtered data)

Post by SALINETAS24 »

Perdon.., quise decir
Al empezar guardar en una variable el alias del fichero activo "cAlias:=DBF()"
Sorry .., is
When you start saving the alias of the active file "cAlias: =DBF()" in a variable.
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no. :shock:
Post Reply