Order in a Grid

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Order in a Grid

Post by danielmaximiliano »


Hi guys:
looking at the forum, I found several ways to filter a table.
some with SET FILTER TO or ORDSCOPE as some faster than SET FILTER
wanting to apply it to the grid unresponsive see, I'm doing something wrong, or need to supplement with some other function???

Code: Select all

Procedure Filtar()
Local cDesc := ''

cDesc := UPPER( InputBox ( "Buscar Artículos", "Buscar : " ) )
cDesc := AllTrim( cDesc ) 
If .Not. Empty ( cDesc ) 
  PRODUCTOS->( OrdSetFocus( "SCS" ) )
  SET FILTER TO cDesc $ Productos->SCS
  Stock.Articulos.Refresh
Endif

Return
income in the inputbox 'shampoo' to filter the grid with this article and ignore.
Stock Autoservicio Los Tilos_2012-09-03_16-07-06.jpg
Stock Autoservicio Los Tilos_2012-09-03_16-07-06.jpg (161.98 KiB) Viewed 2740 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: Order in a Grid

Post by IMATECH »

Hi danielmaximiliano !

Please, try this code:

Code: Select all


Procedure Filtar()
Local cDesc := UPPER( InputBox ( "Buscar Artículos", "Buscar : " ) )

cDesc := AllTrim( cDesc )

If .Not. Empty ( cDesc )

  // Bag Order: make sure it exists
  Productos->( OrdSetFocus( "SCS" ) )

  // Initial and Final range filter
  Productos->( ordscope( 0, cDesc ) )
  Productos->( ordscope( 1, cDesc + 'Z' ) ) // Try to remove + 'Z' after test

  // Top of File
  Productos->( DBGOTOP() )

  // Browse Data
  Stock.Articulos.Refresh()

Endif

Return

Static Function F_Clear_Filter( cAlias )
  LOCAL lRet := .T.

  // Clear Range
  ( cAlias )->( ordscope( 0, NIL ) )
  ( cAlias )->( ordscope( 1, NIL ) )

Return( lRet )

M., Ronaldo

By: IMATECH

Imation Tecnologia
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Order in a Grid

Post by danielmaximiliano »

Funciona Perfecto :
muchas gracias Ronaldo
Stock Autoservicio Los Tilos_2012-09-03_17-06-35.jpg
Stock Autoservicio Los Tilos_2012-09-03_17-06-35.jpg (106.88 KiB) Viewed 2729 times
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply