FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xBrowse con merge
Posts: 139
Joined: Fri Nov 25, 2005 04:38 PM
xBrowse con merge
Posted: Tue Mar 31, 2009 11:00 PM

Me pregunto si es posible en la clase xBrowse merde opción de utilizar la base de datos (dbf) directamente

Ronaldo Minacapelli
Sistemas, Hospedagem e Criação de WebSites
http://www.bazevani.com.br
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse con merge
Posted: Sun Apr 05, 2009 11:04 AM

Ronaldo,

Si, es posible. Lo que ocurre es que la DBF debe contener pocos registros o funcionarĆ” lento.

Vamos a proporcionarte un ejemplo.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: xBrowse con merge
Posted: Sun Apr 05, 2009 11:30 PM
Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'ord.ch'
#include 'xbrowse.ch'

REQUEST DBFCDX

function main()

  local aData
  local oDlg, oBrw, oCol, oFont
  local nTotal

  BuildIndex()

  use customer new alias 'cust' shared via 'DBFCDX'
  set order to tag state
  go top

  DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
  DEFINE DIALOG oDlg SIZE 560,680 PIXEL ;
     TITLE 'TXBrowse - Merged Cells' ;
     FONT oFont

  @ 10,10 XBROWSE oBrw ;
     COLUMNS 'State', 'City', 'Last', 'Age', 'Salary' ;
     SIZE 260,320 PIXEL ;
     COLSIZES ,100,,,100 ;
     PICTURES ,,,'@Z 99', '999,999,999.99' ;
     JUSTIFY AL_CENTER ;
     OF oDlg ALIAS 'CUST' LINES CELL

  oBrw:bClrSelFocus    := { || { CLR_BLUE, nRGB( 230, 255, 230 ) } }

  oBrw:lColDividerComplete := .f.

  // Following line for vertical cell merging
  oBrw:State:lMergeVert   := .t.

  oBrw:CreateFromCode()

  ACTIVATE DIALOG oDlg CENTERED

  RELEASE FONT oFont

return nil

static function BuildIndex

  FIELD STATE

  if File( "customer.cdx" )
     FErase( "customer.cdx" )
  endif
  use customer exclusive via 'DBFCDX'
  index on state tag state
  use

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion