In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TMemDataSet:Clone() not working in Xailer 8

Xailer professional forum in English
Responder
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Hi,

In Xailer 7.2 it's ok.

Could you please check?

Regards,

Fausto Di Creddo Trautwein
Adjuntos
TestClone.zip
(3.54 KiB) Descargado 87 veces
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ignacio »

Hi,

We will take a look. BTW, if a RTE is generated, the error.log is highly appreciated.

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Unfortunately there is no RTE.

Thanks,

Fausto
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ignacio »

Unfortunately I can´t see the error. Please be MORE SPECIFIC.

My test with sample \datacontrols\MemDataset2

Código: Seleccionar todo

METHOD RSCreate( oSender ) CLASS TForm1

   LOCAL aData, aHeaders
   LOCAL oClone

   aData := ::oSQLiteDataSource1:QueryArray( "SELECT * FROM CUSTOMER", @aHeaders )

   oSender:Open( aData, aHeaders )

   oClone := ::oRS:Clone()

   WITH OBJECT oClone
      :Gotop()
      DO WHILE !:Eof()
         LogDebug( :First )
         :Skip()
      ENDDO
      :End()
   END WITH
RETURN Nil
Everything worked as expected.

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Please run the project attached in the first post.

Fausto
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ignacio »

Hi,

Done! Everything worked as expected.

Regards.
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Hi,

Until version 7.2 when a record was added to the cloned TMemDataSet it was reflected to the original TMemDataSet, in version 8 this does not happen.

So, in the code bellow, in version 7.2 oDSClone:RecCount() is equal to ::oMemDataSet1:RecCount(). And in version 8 they are not, ::oMemDataSet1:RecCount() remains 0.

Código: Seleccionar todo

METHOD Button1Click( oSender ) CLASS TForm1
LOCAL oDSClone

oDSClone:= ::oMemDataSet1:Clone()

oDSClone:AddNew()
oDSClone:id:= 1
oDSClone:Update()

::oMemDataSet1:Refresh()

::oEdit1:Value:= ::oMemDataSet1:RecCount()
::oEdit2:Value:= oDSClone:RecCount()

RETURN Nil
Thanks for your time,

Fausto
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ignacio »

Hi,

Not in my tests. As you can see in the code only when a TRUE parameter is passed to Clone() method the data is also cloned.

Código: Seleccionar todo

METHOD Clone( lFull ) CLASS XMemRecords

	LOCAL oDataSet, oField

   DEFAULT lFull TO .f.

	WITH OBJECT oDataSet := TMemDataSet():Create()

		FOR EACH oField IN ::oDataset:aFields
			WITH OBJECT :AddField( oField:cName )
				:cDisplayName := oField:cDisplayName
				:cDbfName     := oField:cDbfName
				:cType        := oField:cType
				:nLen         := oField:nLen
				:nDec			  := oField:nDec
            :lAllowsNull  := oField:lAllowsNull
            :lEditable    := oField:lEditable
            :DefValue     := oField:DefValue
            :lAutoInc     := oField:lAutoInc
            :lPrimaryKey  := oField:lPrimaryKey
            :cTable       := oField:cTable
            :cFullname    := oField:cFullname
			END WITH
		NEXT

		FOR EACH oField IN ::oDataset:aUserFields
			:AddCalcField( oField:cName, oField:bGetValue )
		NEXT

      :cProcess          := ::oDataset:cProcess
      :lDisplayErrors    := ::oDataset:lDisplayErrors
      :lReadOnly         := ::oDataset:lReadOnly
      :lUpdLinked        := ::oDataset:lUpdLinked
      :oRecords:cFiltExp := ::cFiltExp
      :oRecords:SortExp  := ::SortExp

      IF ::oDataset:lOpen
         :Open( iif( !lFull, ::aData, aClone( ::aData ) ) )
         :Goto( ::Recno )
		ENDIF

	END WITH

RETURN oDataset
Imagen 157.png
Imagen 157.png (3.03 KiB) Visto 1587 veces
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Hi,

I've tested by installing Xailer 8 in a new folder and it's still not working.

What else can I try to resolve this issue?

Maybe someone else can try it and post the result. Somebody ?

Thanks,

Fausto
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Dear friends,

I installed Xailer 8 on another computer, one that never had Xailer installed, and no luck. The same problem persists.

Downloaded Xailer 8 from https://download.xailer.com/?en&file=1
and harbour from https://download.xailer.com/?en&file=2

I will be grateful if you continue to investigate this case.

Fausto
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ignacio »

Hi,

Complete project attached. Included EXE file.

https://ozs0-my.sharepoint.com/:u:/g/pe ... g?e=xZnKMJ

I really do not know where is the problem

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Hi,

Thank you for the files.

I think maybe the version available for download may have some difference from yours.

I'm saying this because I downloaded and installed it on another computer and it gave me the wrong result.

In my tests if I added

Código: Seleccionar todo

/*MemRecords.prg*/
METHOD My_Refresh() CLASS XMemRecords
   ::RecCount := Len( ::aWork )
   ::Bof      := .F.
   ::Eof      := ( ::RecCount == 0 )
RETURN Nil
and changeg

Código: Seleccionar todo

/*Form1.prg*/
METHOD Button1Click( oSender ) CLASS TForm1
LOCAL oDSClone

oDSClone:= ::oMemDataSet1:Clone()

oDSClone:AddNew()
oDSClone:id:= 1
oDSClone:Update()

::oMemDataSet1:oRecords:My_Refresh()

::oEdit1:Value:= ::oMemDataSet1:RecCount()
::oEdit2:Value:= oDSClone:RecCount()

RETURN Nil
This way it works, because ::aData and ::aWork were being updated, but not ::RecCount.

I would really like to switch to version 8, with all the improvements it has, but this issue is holding me back.

Thank you again and I hope you can come up with an idea.

Fausto.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ignacio »

Hello,

Xailer 8.01 will be published shortly. Please wait until then. TIA.

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
ftwein
Mensajes: 50
Registrado: Lun Oct 22, 2007 5:17 pm

Re: TMemDataSet:Clone() not working in Xailer 8

Mensaje por ftwein »

Hi,

It's ok with Xailer 8.0.1.

Thank you very much.

Regards,

Fausto
Responder