Autosort no funciona con Object (MySql)?

Autosort no funciona con Object (MySql)?

Postby FranciscoA » Thu Sep 06, 2018 6:01 pm

Amigos.
Tengo el siguiente codigo (xBrowse con TMySql) que da error al usar AUTOSORT:

Code: Select all  Expand view
REDEFINE XBROWSE oBrw ID 180 OF oDlg ;
  OBJECT oBalanza ;
  COLUMNS "CodiCont", "Nombre", "SaldoAnt", "MovDebe", "MovHaber", "SaldoAct" ;
  PICTURES ,,"@( 9,999,999,999.99","@Z 9,999,999,999.99","@Z 9,999,999,999.99","@( 9,999,999,999.99" ;
  SIZES 120,320,120,120,120,120 ;
  CELL LINES FOOTERS AUTOSORT
 

Alguien puede darme una luz sobre esto?
Saludos.

El error es:
Application
===========
Path and name: D:\FAPSOFT\NEWCONT32_MYSQL\Wcont32.Exe (32 bits)
Size: 2,611,712 bytes
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9445)
FiveWin Version: FWHX 12.03
Windows version: 6.1, Build 7601 Service Pack 1

Time from start: 0 hours 0 mins 33 secs
Error occurred at: 06/09/2018, 11:53:28
Error description: Error BASE/1102 Argument error: UPPER
Args:
[ 1] = U

Stack Calls
===========
Called from: => UPPER( 0 )
Called from: XBROWSE.PRG => TXBRWCOLUMN:SETORDER( 11450 )
Called from: XBROWSE.PRG => TXBRWCOLUMN:HEADERLBUTTONUP( 10347 )
Called from: XBROWSE.PRG => TXBROWSE:LBUTTONUP( 3399 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1690 )
Called from: XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11793 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3153 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 270 )
Called from: D:\FAPSOFT\NEWCON~2\wcont32.prg => BROWBALANZA( 198 )
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Autosort no funciona con Object (MySql)?

Postby FranciscoA » Fri Sep 07, 2018 9:03 pm

Holas.
Si hago:
Code: Select all  Expand view
oBrw:bSeek := { |c| MysqlSeek( oBrw:oMysql, c ), oBrw:Refresh() }

obtengo el siguiente error:
Code: Select all  Expand view
Error: Unresolved external '_HB_FUN_MYSQLSEEK' referenced from D:\FAPSOFT\NEWCONT32_MYSQL\WCONT32.OBJ


MySqlSeek() // Esta function se encuentra en XBrowse.prg y es static.
Uso FW1204
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Autosort no funciona con Object (MySql)?

Postby nageswaragunupudi » Sun Sep 09, 2018 11:13 pm

It appears you are using modified xbrowse.prg, because line no.11450 in the original xbrowse.prg of FWHX 12.03 is not in method SetOrder.

It appears that you are getting error at this line in xbrowse.prg: (line 11287 in the original xbrowse.prg)
Code: Select all  Expand view

            cSort   := Upper( ::oBrw:oMysql:cSort )
 

Before defining xbrowse try setting
Code: Select all  Expand view

oBalanza:cSort := ""
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Autosort no funciona con Object (MySql)?

Postby FranciscoA » Wed Sep 12, 2018 2:14 am

Code: Select all  Expand view

oBalanza:=oServer:Query(" SELECT * FROM " + cBalanza + "  WHERE saldoant<>'0' OR movdebe<>'0' OR movhaber <>'0' OR saldoact <>'0' ORDER BY codicont ;")

oBalanza: cSort: = ""

REDEFINE XBROWSE oBrw ID 180 OF oDlg ;
  OBJECT oBalanza ;
  COLUMNS "CodiCont", "Nombre", "SaldoAnt", "MovDebe", "MovHaber", "SaldoAct" ;
  PICTURES ,,"@( 9,999,999,999.99","@Z 9,999,999,999.99","@Z 9,999,999,999.99","@( 9,999,999,999.99" ;
  SIZES 120,320,120,120,120,120 ;
  CELL LINES FOOTERS  //AUTOSORT

WITH OBJECT oBrw
    //:SetMySql(oBalanza, .f., .t., )
    :CodiCont:cSortOrder := "CODICONT"  
END
 
  oBrw:bSeek := { |c| MysqlSeek( oBalanza, c ) }    //this not works
 


It appears you are using modified xbrowse.prg, because line no.11450 in the original xbrowse.prg of FWHX 12.03 is not in method SetOrder.

Yes, I use it linked to my program. ( XBrowse.prg Ver 1204 )

It appears that you are getting error at this line in xbrowse.prg: (line 11287 in the original xbrowse.prg)

Yes.
I followed your instructions, but the error persists. ( oBalanza: cSort: = "" or oBalanza: cSort: = "CODICONT" )

Indeed, the error occurs in the line you mention, whose value is always nil. ( cSort: = Upper (:: oBrw: oMysql: cSort) )

Thanks
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Autosort no funciona con Object (MySql)?

Postby nageswaragunupudi » Wed Sep 12, 2018 2:37 am

After you assigned a character value to oBalanza:cSort, how is it getting reset to NIL on its own?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Autosort no funciona con Object (MySql)?

Postby FranciscoA » Wed Sep 12, 2018 4:48 pm

Mr. Rao.
This xbrowse works well with dbf files, and we have not made any modifications to the SetOrder (), Seek () methods,

Code: Select all  Expand view
oBalanza:=oServer:Query(" SELECT * FROM " + cBalanza + "  WHERE saldoant<>'0' OR movdebe<>'0' OR movhaber <>'0' OR saldoact <>'0' ORDER BY codicont ASC ;")

oBalanza:cSort := "CODICONT"

  REDEFINE XBROWSE oBrw ID 180 OF oDlg ;
  DATASOURCE oBalanza ;
  COLUMNS "CodiCont", "Nombre", "SaldoAnt", "MovDebe", "MovHaber", "SaldoAct" ;
  PICTURES ,,"@( 9,999,999,999.99","@Z 9,999,999,999.99","@Z 9,999,999,999.99","@( 9,999,999,999.99" ;
  SIZES 120,320,120,120,120,120 ;
  CELL LINES FOOTERS //AUTOSORT

  WITH OBJECT oBrw
    //:SetMySql(oBalanza, .f., .t., )

    :CodiCont:cSortOrder := "CODICONT"   //los indices
  END

  oBrw:bSeek := { |c| MysqlSeek( oBalanza, c ) }
 



When you click on the header of the CODICONT column, it shows the following error.
Application
===========
Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9445)
FiveWin Version: FWHX 12.03
Error description: Error BASE/1102 Argument error: UPPER
Args:
[ 1] = U

Called from: => UPPER( 0 )
Called from: D:\FAPSOFT\NEWCON~2\xbrowse.prg => TXBRWCOLUMN:SETORDER( 11453 ) //this line varies from previous post, because I have added some msginfo ().
Variables in use
================
Procedure Type Value
==========================
UPPER
Param 1: U
Local 1: U
Local 2: U
TXBRWCOLUMN:SETORDER
Local 1: O Class: TXBRWCOLUMN
Local 2: L .F.
Local 3: U
Local 4: U
Local 5: U
Local 6: U
Local 7: U
Local 8: U
Local 9: U
Local 10: U





When typing for incremental search, it does nothing. (Do not search)
Code: Select all  Expand view
METHOD SetOrder() CLASS TXBrwColumn

      elseif nAnd( ::oBrw:nDataType, DATATYPE_MYSQL ) == DATATYPE_MYSQL .and. ;
            ::oBrw:oMysql != nil
         if ::oBrw:oMysql:IsKindOf( 'TDOLPHINQRY' )
            ........
            .......
         else
            //msginfo( ::oBrw:oMysql:cSort , "METHOD SetOrder()")  //Here, allways show nil.
            cSort   := Upper( ::oBrw:oMysql:cSort )
            cSort   := TRIM( StrTran( StrTran( cSort, 'DESC', '' ), 'ASC', '' ) )
            if EQ( cSort, ::cSortOrder )
               .......
               .......



METHOD Seek( cSeek ) CLASS TXBrowse
.....
.....
   uBook := ::BookMark

   if !Eval( ::bSeek, cSeek )  //Here you receive .f.
      ::BookMark  := uBook
      MsgBeep()
      return lRet
   endif

   lRet     := .t.
 

Best regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Autosort no funciona con Object (MySql)?

Postby FranciscoA » Wed Sep 12, 2018 8:34 pm

Mr Rao.
Despues de muchas pruebas y haber revisado xbrowse.prg, he llegado a la conclusioón que la classe TMysql contenida en la libreria MySql.lib, que bajé del blog de Wormar, no tiene el method o propiedad oMySql:cSort.

Tampoco pude encontrar informacion sobre la function WSEEKPLUS, contenida en la function MySqlSeek().

Talvez el Sr. William puede compartir los fuentes.

Saludos.


Mr Rao.
After many tests and having reviewed xbrowse.prg, I have come to the conclusion that the TMysql class contained in the MySql.lib library, which I downloaded from the Wormar blog, does not have the method or property oMySql: cSort.

Also, I could not find information about the WSEEKPLUS function, contained in the MySqlSeek () function.

Maybe Mr. William can share the sources.

Greetings.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Autosort no funciona con Object (MySql)?

Postby FranciscoA » Wed Sep 12, 2018 8:46 pm

Estimado William Morales.
Reitero mi solicitud.
Gracias.
Last edited by FranciscoA on Fri Sep 14, 2018 9:40 pm, edited 1 time in total.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Autosort no funciona con Object (MySql)?

Postby FranciscoA » Fri Sep 14, 2018 12:54 am

Hola.
Lo he solucionado tomando el methodo seek() de tmysql de Shuming Wang. La pasé a function y está funcionando.
Todos los créditos a Wang.
Mientras tanto, voy a tratar de crear la libreria, usando la tmysql de Wang.
Saludos.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 69 guests