topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xbrowse Devolver valor de una celda | oXBrowse:SelectedCol() --> oColumn
oXBrowse:nAt --> nColumnPosition // OJO: Posición en las columnas visualizadas
Es interesante ver el código del método nAt():
METHOD nAt() INLINE ::ColPos( ::SelectedCol() )
oColumn:nCreationOrder es el índice de columna cuando se creó |
xbrowse ERROR ADS (Dynamic descend not supported) RESUELTO | Estimados,
la clase xbrowse produce este error la presionar la columna 2 veces para ordenar
Time from start: 0 hours 0 mins 11 secs
Error occurred at: 10-10-2012, 10:13:06
Error description: Error DBCMD/1034 Dynamic descend not supported in this version: ORDDESCEND
Stack Calls
===========
Called from: => ORDDESCEND( 0 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBRWCOLUMN:SETORDER( 11353 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBRWCOLUMN:HEADERLBUTTONUP( 10186 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBROWSE:LBUTTONUP( 3303 )
Called from: c:\fwh\source\classes\CONTROL.prg => TCONTROL:HANDLEEVENT( 1691 )
Called from: c:\fwh\source\classes\xbrowse.prg => TXBROWSE:HANDLEEVENT( 11633 )
Called from: c:\fwh\source\classes\WINDOW.prg => _FWH( 3152 )
adjunto un ejemplo sacado de xbrwAdt.prg
[code=fw:29xcwrio]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ads.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"richedit.ch"</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />field CAMPO1, CAMPO2<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oFont, aRddList, i<br /><br /> SET DATE ITALIAN<br /> SET CENTURY <span style="color: #0000ff;">ON</span><br /> SET EXCLUSIVE OFF<br /><br /><br /> RddRegister<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ADS"</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /> AdsSetServerType<span style="color: #000000;">(</span> ADS_LOCAL_SERVER <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> AScan<span style="color: #000000;">(</span> aRddList := RddList<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'ADT'</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> RDDSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">'ADT'</span> <span style="color: #000000;">)</span><br /> elseif AScan<span style="color: #000000;">(</span> aRddList, <span style="color: #ff0000;">'ADSADT'</span> <span style="color: #000000;">)</span> > <span style="color: #000000;">0</span><br /> RDDSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">'ADSADT'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'RDD ADT not linked'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> <span style="color: #00C800;">if</span> !file<span style="color: #000000;">(</span> <span style="color: #ff0000;">"flds1.adt"</span> <span style="color: #000000;">)</span><br /> dbcreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"flds1"</span>, <span style="color: #000000;">{</span><span style="color: #000000;">{</span> <span style="color: #ff0000;">"campo1"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"campo2"</span>, <span style="color: #ff0000;">"N"</span>, <span style="color: #000000;">10</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"campo3"</span>, <span style="color: #ff0000;">"D"</span>, <span style="color: #000000;">08</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"campo4"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">15</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"fmemo"</span>, <span style="color: #ff0000;">"M"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> USE FLDS1 exclusive<br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> campo1 tag campo1<br /> <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> campo4 tag campo4<br /><br /> <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">10</span><br /> dbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> field->campo1 := ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>i<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" indice.."</span><br /> field->campo2 := i<br /> field->campo3 := date<span style="color: #000000;">(</span><span style="color: #000000;">)</span>+i<br /> field->campo4 := ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span><span style="color: #000000;">11</span>-i<span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" indice.."</span><br /> field->fmemo := <span style="color: #ff0000;">"indice numero "</span>+ltrim<span style="color: #000000;">(</span>str<span style="color: #000000;">(</span>i<span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> i<br /> dbcommitall<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dbCloseAll<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> USE FLDS1<br /><br /> GO TOP<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDI</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Xbrowse with ADT"</span> ;<br /> <span style="color: #0000ff;">MENU</span> MakeMenu<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">SetFont</span><span style="color: #000000;">(</span> oFont <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">RIGHT</span> <span style="color: #0000ff;">CLICK</span> <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">(</span> ownd <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MakeMenu<br /><br /> <span style="color: #00C800;">local</span> oMenu<br /><br /> <span style="color: #0000ff;">MENU</span> oMenu <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"ADT"</span><br /> <span style="color: #0000ff;">MENU</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Data"</span> <span style="color: #0000ff;">ACTION</span> xbrData<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Structure"</span> <span style="color: #0000ff;">ACTION</span> xBrStruct<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">SEPARATOR</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"e&Xit"</span> <span style="color: #0000ff;">ACTION</span> WndMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /> oMenu:<span style="color: #000000;">AddMdi</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oMenu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> xbrStruct<br /><br /> <span style="color: #00C800;">local</span> aStruct := dbStruct<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oWnd, oBrw, n<br /><br /><span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">(</span> astruct <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span> astruct <span style="color: #000000;">)</span><br /> asize<span style="color: #000000;">(</span> astruct<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>, <span style="color: #000000;">6</span> <span style="color: #000000;">)</span><br /> astruct<span style="color: #000000;">[</span> n <span style="color: #000000;">]</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span> := ValType<span style="color: #000000;">(</span> FieldGet<span style="color: #000000;">(</span> n <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">OF</span> WndMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Structure'</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br /> HEADERS <span style="color: #ff0000;">"Name"</span>, <span style="color: #ff0000;">"Type"</span>, <span style="color: #ff0000;">"Len"</span>, <span style="color: #ff0000;">"Dec"</span>, <span style="color: #ff0000;">"Ext"</span>, <span style="color: #ff0000;">"Read"</span> ;<br /> <span style="color: #0000ff;">OF</span> ownd ;<br /> ARRAY aStruct ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> xbrData<br /><br /> <span style="color: #00C800;">local</span> oWnd, oBrw<br /> <span style="color: #00C800;">local</span> c<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">OF</span> WndMain<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw;<br /> <span style="color: #0000ff;">OF</span> oWnd ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_RAISED<br /> :<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_RAISED<br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /><br /> :<span style="color: #000000;">LAllowColSwapping</span> := .f.<br /> :<span style="color: #000000;">lColDividerComplete</span> := .f.<br /> :<span style="color: #000000;">lAllowRowSizing</span> := .f.<br /> :<span style="color: #000000;">lAllowColHiding</span> := .f.<br /> :<span style="color: #000000;">lKineticBrw</span> := .f.<br /> :<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">24</span><br /> :<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">22</span><br /><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cSortOrder</span> := <span style="color: #ff0000;">"campo1"</span><br /> :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cSortOrder</span> := <span style="color: #ff0000;">"campo4"</span><br /> :<span style="color: #000000;">lRecordSelector</span> := .f.<br /> END<br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">fmemo</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">bLDClickData</span> := <span style="color: #000000;">{</span> |r,c,f,o| c:= flds->fmemo, MemoEdit<span style="color: #000000;">(</span> @c <span style="color: #000000;">)</span>, flds->fmemo := c <span style="color: #000000;">}</span><br /> END<br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Rtf2text<span style="color: #000000;">(</span> cRtf <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, hDll, oRich<br /> <span style="color: #00C800;">local</span> cText<br /><br /> <span style="color: #00C800;">if</span> cRtf != <span style="color: #00C800;">nil</span><br /> hDll := LoadLibrary<span style="color: #000000;">(</span> <span style="color: #ff0000;">'riched20.dll'</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> RICHEDIT oRich <span style="color: #0000ff;">VAR</span> cRtf <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>,<span style="color: #000000;">50</span><br /> cText := oRich:<span style="color: #000000;">GetText</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd HIDDEN <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> FreeLibrary<span style="color: #000000;">(</span> hDll <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cText<br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------//</span><br /><br />external hb_decode<br /> </div>[/code:29xcwrio] |
xbrowse ERROR ADS (Dynamic descend not supported) RESUELTO | Este puede ser la solucion
[code=fw:20m34pga]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> SetOrder<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br />..<br />..<br /><br /> elseif ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span> .and. ValType<span style="color: #000000;">(</span> ::<span style="color: #000000;">cSortOrder</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">'C'</span><br /> <span style="color: #00C800;">DEFAULT</span> cOrdBag := <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdBagName<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> OrdSetFocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> == Upper<span style="color: #000000;">(</span> ::<span style="color: #000000;">cSortOrder</span> <span style="color: #000000;">)</span> .and.;<br /> !<span style="color: #000000;">(</span><span style="color: #ff0000;">"ADS"</span>$<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RddName<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> .or. <span style="color: #ff0000;">'ADT'</span> $ <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>-><span style="color: #000000;">(</span> RddName<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// esta linea he puesto </span><br /> </div>[/code:20m34pga] |
xbrowse ERROR ADS (Dynamic descend not supported) RESUELTO | Hola Patricio:
El problema debe ser otro, ya que a mi me funciona bien.
Creo que es problema es de version, yo uso la ver. 9.xx
Hace tiempo usaba la version 7.x y tenia problemas como ese, no lo recuerdo bien.
El error [b:281fayww]DBCMD/1034[/b:281fayww] no parece ser de ADS. Para mayor detalle fijate en la info de la tabla, en la mia aparece [b:281fayww]Rddname: ADSCDX[/b:281fayww].
Atentamente,
Rolando.
Cochabamba, Bolivia. |
xbrowse ERROR ADS (Dynamic descend not supported) RESUELTO | Hola Rolando
Puedes reproducir el ejemplo que he puesto arriba, puede que este haciendo algo mal.
ahora yo utilizo ads v10 modo local |
xbrowse ERROR ADS (Dynamic descend not supported) RESUELTO | Patricio,
compilado con buildx.bat de \fwh\samples
sin cambiar ningun pelito de codigo,
funciona correctamente: [u:1e7sgz2g]https://www.box.com/s/268kylkq0xtmn4keumzo[/u:1e7sgz2g]
xhb 1.2.1 oct 2012
saludos..
Cesar SysCtrl Soft. |
xbrowse ERROR ADS (Dynamic descend not supported) RESUELTO | Gracias a todos
el problema era la libreria rddads.lib que tenia, ahora compile la nueva bajada del svn |
xbrowse Email|PDF | Good evening,
is it possible to send an Email with the data exported to TXT or PDF directly out of xbrowse?
Thank you and kind regards
Iris |
xbrowse Email|PDF | You need to write your own function for this.
Here is a sample function:
[code=fw:2a6a8ais]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> SendMail<span style="color: #000000;">(</span> oBrw, cPdf, cAddress <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oMail, cFile<br /><br /> cPdf := TrueName<span style="color: #000000;">(</span> cPdf <span style="color: #000000;">)</span><br /> cFile := cFileNoPath<span style="color: #000000;">(</span> cPdf <span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, .F., <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, cPDF <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">MAIL</span> oMail ;<br /> <span style="color: #0000ff;">TO</span> cAddress ;<br /> <span style="color: #0000ff;">SUBJECT</span> cFile ;<br /> <span style="color: #0000ff;">TEXT</span> <span style="color: #ff0000;">""</span> ;<br /> FILES cPdf, cFile ;<br /> <span style="color: #0000ff;">FROM</span> USER<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">MAIL</span> oMail<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2a6a8ais]
You may modify this function according to your requirements. |
xbrowse FWH 903 | Antonio,
in FWH 903 there is a little bug in xbrowse.prg
In METHOD SelectCol( ) I found this:
[code=fw:30f174bo]<div class="fw" id="{CB}" style="font-family: monospace;">? ::<span style="color: #000000;">nColSel</span> := <span style="color: #0000ff;">Min</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">nColSel</span>, ::<span style="color: #000000;">LastDisplayPos</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span></div>[/code:30f174bo]
This message shows a number, when the vertical thumbpos is moved.
Regards,
Dietmar |
xbrowse FWH 903 | Hello Dietmar,
Please see this topic:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15258&p=79138&hilit=xbrowse#p79138">viewtopic.php?f=3&t=15258&p=79138&hilit=xbrowse#p79138</a><!-- l -->
I think this bug is fixed in 9.04.
Best regards,
Otto |
xbrowse FastEdit | If I use oBrw:lFastEdit := .t.
How can I prevent one cell from editing.
Thanks inadvance
Otto |
xbrowse FastEdit | oCol:bEditWhen := { || <condition> } |
xbrowse FastEdit | Dear Rao,
thank you very much for your help.
Best regards,
Otto
PS: drag&drop oCursor
I have to install the newest FWH to test. |
xbrowse Footer sum of all numeric fileds in a row | is it possible to show the sum of all fields in one row of a xbrowsetx Uwe D aus E |
xbrowse Footer sum of all numeric fileds in a row | How about something like:oCol:bStrData := { || str(field1 + field2 + field3) } |
xbrowse Footer sum of all numeric fileds in a row | Excuse my errorsum of one column |
xbrowse Footer sum of all numeric fileds in a row | Uwe,>sum of one columnThis is more difficult. You have to read through the entire database and sum all the columns BEFORE you display the browse. Summing the entire database might be feasible with small databases (or subsets), but it would create an unaccepatble delay with larger ones.If any record is then edited, you have to change the sum according to the changes made to the record. If it is a multi-user system, with multi-user access to the browsed database, the totals could become out of date at any time if another user changed a value.I have done something like this with invoices. The invoice header record is locked, then the detail records are browsed and the totals are updated if the user makes any changes (add or edit). No other user can make changes at the same time so this is not an issue.I know that TSBrowse supports footers, but I don't know about TXBrowse. With my invoice system I just put the totals below the browse on the dialog.James |
xbrowse Footer sum of all numeric fileds in a row | Uwe,I have the same problem with my xBrowse with „meter“.<!-- m --><a class="postlink" href="http://forums.fivetechsoft.com/viewtopic.php?t=11473">http://forums.fivetechsoft.com/viewtopic.php?t=11473</a><!-- m -->I have to browse thought the whole database to get the maximum value.Otherwise you can’t show a percentage.Maybe there is a function to show the max- value of a database field?Regards,Otto |
xbrowse Footer sum of all numeric fileds in a row | Otto,>I have to browse thought the whole database to get the maximum value. To the find the largest value in a field, you can index on that field then do a GO BOTTOM.James |
xbrowse Footer sum of all numeric fileds in a row | >Maybe there is a function to show the max- value of a database field?>You can use sql statment to find maximum value. example:SELECT MAX(SALARY) FROM EMPLOYEE WHERE AGE > 30( or some appropriate statement like that).You will get the result much faster if the SALARY column and AGE column are indexed in the above example. We can achieve more by combining the normal familar ISAM code blended with SQL code where appropriate.Interestingly, we can use SQL on normal DBF tables also, if we open the connection to the folder in ADO. For connecting to normal DBF tables through ADO, we can use appropriate connection string from <!-- m --><a class="postlink" href="http://www.connectionstrings.com">http://www.connectionstrings.com</a><!-- m -->------------------------------->oCol:bStrData := { || str(field1 + field2 + field3) }>it is not any more necessary in xbrowse to covert values as character values. Use of bStrData is deprecated according to documentation in whatsnew.oCol:bEditValue := field1 + field2 + field3.XBrowse automatically constructs the bStrData block, using oCol:cEditPicture, if assigned. In case of ADO,DBF, etc, XBrowse constructs the picture automatically based on the column characteristics.------------------>I know that TSBrowse supports footers, but I don't know about TXBrowse. >TXBrowse supports footers. oCol:bFooter := { || nTotal }It is not necessary to convert nTotal into a character value. XBrowse uses the oCol:cEditPicture to format the footer.If during the course of the browse, if nTotal changes, we do not have to reassign the revised total. oCol:RefreshFooter will do. Or oBrw:RefreshFooters will refesh all footers without refreshing the rest of the browse.I find the xbrowse footers are extremely convinient to use.----------------------About showing totals of the columns in the footers. I do ths in many cases, because users want this.Obviously, in single user mode it is easy. But here i like to say how convinient it is to handle footers in xbrowse.XBrowse automatically refreshes the column's footer also, after editing a value in the column, if oCol:lTotal is set to .t.We can write in the oCol:bOnPostEdit block to change the value of nTotal after successful edit. Then without writing any extra code, XBrowse refreshes the column value and also the footer with new nTotal.I normally maintain the footer values in an array ( keep updating them on edits ) and let the xbrowse do the appropriate refeshing job.Now as Mr James points out, the problem is quite complex in multiuser environment. We develop our own techniques depending on the speicifics of the program module, data and environment when and how to sense other user modifications and whether to recalculate totals on the client only or to recompute totals of the table on the server. ( Now SQL does great job when needed : Exampe SELECT SUM(SALARY),SUM(COMMISSION) FROM MYTABLE WEHRE MYCONDITION ). No unique way, but what we do depends on our program and database design.But nonetheless, our coding to refresh footers in xbrowse is the simplest. |
xbrowse Footer sum of all numeric fileds in a row | Hello James, hello NagesWaraRao,thank you very much for your help.As I never tried using a dbf through a SQL statement I would like to ask about performance and speed?Best regards,Otto |
xbrowse Footer sum of all numeric fileds in a row | NageswaraRao,I am not clear on how xBrowse updates the footer totals. Does it scan through the entire database and add up all the values every time you refresh the footers?I can see how it might update the footer for one column if you are editing a column value within xBrowse (spreadsheet style) because that is internal, but normally my edits are in a dialog box called from the browse. So, it would seem to be much more difficult for the browse to know to change all the totals based on changes to the underlying record. Does it do that?James |
xbrowse Footer sum of all numeric fileds in a row | Mr Otto>As I never tried using a dbf through a SQL statement I would like to ask about performance and speed?>There are definite speed advantages when using server based databases, like Advantage and other RDMSs. The reason is the entire iteration through the table is performed on the server and only the result is read from the server. In case of using ADO for normal DBFs, there will not be much speed advantage, but it is not slower. Advantages include whatver speed advantage and simpler code. |
xbrowse Footer sum of all numeric fileds in a row | Mr James>I am not clear on how xBrowse updates the footer totals. Does it scan through the entire database and add up all the values every time you refresh the footers?>I am sorry if I my post gave such an impression. No it does not. As usual it is the programmer's reesponsibility to recompute the totals after each edit.Normally after inline edit of a cell, we need to write code for (1) save the data, (2) alter the total, (3) assign the formatted value to cfooter (4) redraw the footer and ( 5 ) if the column is indexed, refersh the entire browse or else refresh the current row only.What xbrowse helps us is by avoiding the 3rd, 4th and 5th steps. PostEdit method refreshes the browse if the column is sorted ( using inbuilt sort facilty ) or refreshes the row only otherwise. We do not have to write code to decide whether full browse is to be refreshed or only edited row is to be refreshed. If oCol:lTotal is true and oCol:bFooter is not empty the xbrowse automatically refreshes the footer also. We do not have to write code calling oCol:RefreshFooter.Since it is possible to refresh footer of a single column alone, it is very fast. When using the dialog edit. naturally we need to write code to call oBrw:Refreshfooters also after changing the totals if necessary. |
xbrowse Footer sum of all numeric fileds in a row | NageswaraRao,Thanks for clearing that up.James |
xbrowse Footer sum of all numeric fileds in a row | With XBrowse 8.06, coding for recalculation of totals and refreshing footers is made simpler:Example:[code:rcbardtg]
#include 'fivewin.ch'
#include 'xbrowse.ch'
//----------------------------------------------------------------------------//
function main()
local oDlg, oBrw, oFont
local nTotal := 0
USE CUSTOMER ALIAS CUST
DBEVAL( { || nTotal += CUST->SALARY } )
GO TOP
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 600,400 PIXEL ;
TITLE 'Easy totals with XBrowse';
FONT oFont
@ 10,10 XBROWSE oBrw ;
COLUMNS "First", "Last", "Salary" ;
SIZE 280,180 PIXEL ;
OF oDlg ;
ALIAS "CUST" ;
FASTEDIT FOOTERS LINES CELL
WITH OBJECT oBrw:oCol( "Salary" )
:nTotal := nTotal
:nEditType := EDIT_GET
END
/*
// To use add column command for the same
// facility
ADD TO oBrw DATA FieldWBlock( "SALARY", SELECT( "CUST" ) ) '
HEADER "Salary" ;
PICTURE "99,999,999.99" ;
EDITABLE ;
TOTAL nTotal
*/
oBrw:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
//----------------------------------------------------------------------------//
[/code:rcbardtg]Inline edit of salary column automatically recalculates and shows the revised total. This works perfectly for single user environments or where there is no chance of other users modifying the same set of data. Where such modifications are expected, appropriate code can be added to change the variable nTotal and use oCol:RefreshFooter() |
xbrowse Header extension | Maybe I'm not remembering correctly.
I'm using the new COMMAND syntax for xBrowse and all works well. To be consistent for my clients, all main dialogs are the same size, and the xbrowse in the .rc is also the same width.
In some cases, the data I am displaying does not fill the full width of the browse control space. I'm using a gradient header for the browse. In cases where we have space to the right of the last data column, we have the lines to separate row and column. However, the gradient header does not extend over it.
Didn't we have a command at one time that allowed the gradient ( or colored ) header display across the full width ?
If so, how do we activate it now ?
Thanks. |
xbrowse Header extension | Tim, try oBrw:nStretchCol := STRETCHCOL_LAST |
xbrowse Header extension | Thanks ... I may "game" this a bit and try adding an extra blank column. That can throw things off if we have numeric data.
Tim |
xbrowse Header extension | New in FWH16.04
Set
oBrw:lGradientComplete := .t. |
xbrowse Header extension | Nice ... I will look at adding that. |
xbrowse Help window | We like to create a smal window to open into xbrowse to show help Key
How We can create a Dialog / window with SHADOW
and when the use click esc or click with the mouse the xbrowse this help window must be hide |
xbrowse MakeTotals() | Hello everyone.
After updating to a more recent fwh, I find all my apps break when executing xbrowse's makeTotals() method after a cell is changed. This happens when MakeTotals is called on bchange or on bOnPostEdit.
I understand how new enhancements to the xbrowse class makes it unnecessary -at least on most cases- to execute MakeTotals after a cell is changed. That is good and I'm all for that. What is not good is when new fw behavior, features, or even fixes totally breaks existing code. I hope you can all understand it would be unreasonable to re-write your apps any time something changes in fw.
Trust me, there are legitimate reasons to call MakeTotoals on bChange or bOnPostEdit. I can demonstrate if necessary. I suppose there is a workaround to this problem. Can someone help? In other words, what can I do so that MakeTotals does not break my existing code? I think this was a change introduced into xbrowse in 2014.
Thank you very much,
Reinaldo. |
xbrowse MakeTotals() | Below is a self-contained sample that demonstrates some of the problems with xbrowse. Once the app is built, click on the square "edit_get_button" button on any tree leaf for column "AmtPaid". Notice when clicking on the button of a branch cell of the tree it works as expected -that is, as coded on bEditBlock. When clicking on a leaf, the xbrowse breaks. If I compile with fwh 2012 it all works perfectly. If I compile with fwh 2014 it breaks. Notice the problem happens when you try to assign a value to a leaf cell on the tree, as in: oBrw:oTreeItem:Cargo[ 2 ] := 0.00.
Please test and please help!
Thank you.
[code=fw:23hxl4cu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00D7D7;">#DEFINE</span> _KEY <span style="color: #000000;">1</span> <br /><span style="color: #00D7D7;">#DEFINE</span> _PAID <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#DEFINE</span> _EXPECTED <span style="color: #000000;">2</span><br /><span style="color: #00D7D7;">#DEFINE</span> _PENDING <span style="color: #000000;">3</span><br /><br /><br /><br /><span style="color: #00C800;">STATIC</span> aItems := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Id 1"</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 1"</span>, <span style="color: #000000;">100.00</span>, <span style="color: #000000;">200.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 2"</span>, <span style="color: #000000;">150.00</span>, <span style="color: #000000;">100.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Id 2"</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 1"</span>, <span style="color: #000000;">300.00</span>, <span style="color: #000000;">200.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 2"</span>, <span style="color: #000000;">450.00</span>, <span style="color: #000000;">100.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Id 3"</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 1"</span>, <span style="color: #000000;">100.00</span>, <span style="color: #000000;">200.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 2"</span>, <span style="color: #000000;">150.00</span>, <span style="color: #000000;">100.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Id 4"</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 1"</span>, <span style="color: #000000;">300.00</span>, <span style="color: #000000;">200.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Line 2"</span>, <span style="color: #000000;">450.00</span>, <span style="color: #000000;">100.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">FUNCTION</span> start<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">LOCAL</span> oApp := TApp<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oApp:<span style="color: #000000;">CreateTree</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oApp:<span style="color: #0000ff;">Init</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oApp:<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oApp:<span style="color: #000000;">ReCalculateCompleteTree</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">CLASS</span> TApp <br /><br /> <span style="color: #00C800;">DATA</span> oBrw, oWnd, oTree, oFont12_bold<br /> <br /> <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">INLINE</span> <span style="color: #00C800;">SELF</span><br /> <span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">init</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /> <span style="color: #00C800;">METHOD</span> CreateTree<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">METHOD</span> SubTree<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">METHOD</span> ReCalculate<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> ReCalculateCompleteTree<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">METHOD</span> PayEachLeaf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">init</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> ::<span style="color: #000000;">oFont12_bold</span> <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">6</span>,<span style="color: #000000;">-12</span> BOLD<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oWnd</span> FOOTERS FASTEDIT <br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">SetTree</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oTree</span> <span style="color: #000000;">)</span><br /><br /> ADD <span style="color: #0000ff;">TO</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #00C800;">DATA</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> HEADER <span style="color: #ff0000;">"AmtPaid"</span> <span style="color: #B900B9;">//2</span><br /> ADD <span style="color: #0000ff;">TO</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #00C800;">DATA</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _EXPECTED <span style="color: #000000;">]</span> HEADER <span style="color: #ff0000;">"Expected"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9,999,999.99"</span><br /> ADD <span style="color: #0000ff;">TO</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #00C800;">DATA</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PENDING <span style="color: #000000;">]</span> HEADER <span style="color: #ff0000;">"Pending"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9,999,999.99"</span><br /><br /> WITH OBJECT ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">AmtPaid</span><br /><br /> :<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> |o,x| ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span>:= x , ::<span style="color: #000000;">ReCalculate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /><br /> :<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">{</span> |R, C, o, K| ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">1</span>, ;<br /> ::<span style="color: #000000;">PayEachLeaf</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> iif<span style="color: #000000;">(</span> EMPTY<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _EXPECTED <span style="color: #000000;">]</span>,;<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> := <span style="color: #000000;">0.00</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">ReCalculate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> <br /> <br /> END <br /><br /> AEVAL<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span> |o| o:<span style="color: #000000;">oDataFont</span> := <span style="color: #000000;">{</span>|| iif<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">1</span>, ::<span style="color: #000000;">oFont12_bold</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oFont</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> AEVAL<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span> |e| e:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT,;<br /> e:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">70</span>,;<br /> e:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"999,999.99"</span>,;<br /> e:<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL,;<br /> e:<span style="color: #000000;">oFooterFont</span> := ::<span style="color: #000000;">oFont12_bold</span>,;<br /> e:<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT <span style="color: #000000;">}</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oClient</span> := ::<span style="color: #000000;">oBrw</span> <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> CreateTree<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">LOCAL</span> aItem, oItem <br /><br /> TREE ::<span style="color: #000000;">oTree</span> <span style="color: #B900B9;">//::oTree is type Tlinklist</span><br /><br /> <span style="color: #00C800;">FOR</span> EACH aItem IN aItems<br /><br /> oItem := ::<span style="color: #000000;">oTree</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> aItem<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//each oItem is type TTreeItem</span><br /><br /> oItem:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">{</span> <span style="color: #000000;">0.00</span>, <span style="color: #000000;">0.00</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">}</span><br /> oItem:<span style="color: #000000;">nLevel</span> := <span style="color: #000000;">1</span> <br /><br /> oItem:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span> |o| o:<span style="color: #000000;">SetTree</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">SubTree</span><span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, o:<span style="color: #000000;">bAction</span> := <span style="color: #00C800;">Nil</span> <span style="color: #000000;">}</span><br /><br /> EVAL<span style="color: #000000;">(</span> oItem:<span style="color: #000000;">bAction</span>, oItem <span style="color: #000000;">)</span><br /> <br /> END<br /><br /> ENDTREE<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> SubTree<span style="color: #000000;">(</span> oParent <span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">LOCAL</span> nLevel <br /> <span style="color: #00C800;">LOCAL</span> oTree, oItem<br /> <span style="color: #00C800;">LOCAL</span> aItem<br /> <span style="color: #00C800;">LOCAL</span> cId := ALLTRIM<span style="color: #000000;">(</span> oParent:<span style="color: #000000;">cPrompt</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> nAt := aSCAN<span style="color: #000000;">(</span> aItems, <span style="color: #000000;">{</span> |e| e<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> == cId <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> nLevel := oParent:<span style="color: #000000;">nLevel</span> + <span style="color: #000000;">1</span><br /> TREE oTree<br /><br /> <span style="color: #00C800;">FOR</span> EACH aItem IN aItems<span style="color: #000000;">[</span> nAt <span style="color: #000000;">]</span><br /><br /> <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">(</span> aItem <span style="color: #000000;">)</span> != <span style="color: #ff0000;">"A"</span> ;LOOP ;ENDIF <br /><br /> TREEITEM oItem <span style="color: #0000ff;">PROMPT</span> aItem<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #B900B9;">//creates a new leaf </span><br /><br /> oItem:<span style="color: #000000;">nlevel</span> := nLevel<br /><br /> oItem:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">{</span> aItem<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, aItem<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> , aItem<span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">NEXT</span><br /><br /> ENDTREE<br /> <br /><span style="color: #00C800;">RETURN</span> oTree <br /><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">METHOD</span> PayEachLeaf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">LOCAL</span> nPaid := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">LOCAL</span> oItem := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">GetNext</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">WHILE</span> oItem != <span style="color: #00C800;">NIL</span> .AND. oItem:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">2</span> <br /><br /> oItem:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> := IIF<span style="color: #000000;">(</span> nPaid == <span style="color: #000000;">0.00</span>, oItem:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _EXPECTED <span style="color: #000000;">]</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">)</span><br /> oItem := oItem:<span style="color: #000000;">GetNext</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> END <br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> ReCalculateCompleteTree<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oBranch := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTree</span>:<span style="color: #000000;">oFirst</span><br /> <br /> <span style="color: #00C800;">WHILE</span> oBranch != <span style="color: #00C800;">NIL</span> <br /> ::<span style="color: #000000;">Recalculate</span><span style="color: #000000;">(</span> oBranch <span style="color: #000000;">)</span> <br /> oBranch := oBranch:<span style="color: #000000;">GetNext</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> END<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> Recalculate<span style="color: #000000;">(</span> oItem <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> bAddTotals, oBranch, oParent<br /> <span style="color: #00C800;">LOCAL</span> nTotPend := <span style="color: #000000;">0.00</span> <br /> <span style="color: #00C800;">LOCAL</span> nTotExp := <span style="color: #000000;">0.00</span><br /> <span style="color: #00C800;">LOCAL</span> ntotPaid := <span style="color: #000000;">0.00</span> <br /> <span style="color: #00C800;">LOCAL</span> nAt := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">ItemNo</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">DEFAULT</span> oItem := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span><br /> <br /> bAddTotals := <span style="color: #000000;">{</span> | o | nTotExp += o:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _EXPECTED <span style="color: #000000;">]</span>,;<br /> nTotPend += o:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PENDING <span style="color: #000000;">]</span>,;<br /> nTotPaid += o:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> <span style="color: #000000;">}</span><br /><br /> <br /><br /> oParent := IIF<span style="color: #000000;">(</span> oItem:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">2</span>, oItem:<span style="color: #000000;">Parent</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oItem <span style="color: #000000;">)</span><br /> oParent:<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBranch := oParent:<span style="color: #000000;">GetNext</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//Visit each branch leaf</span><br /> <span style="color: #00C800;">WHILE</span> oBranch != <span style="color: #00C800;">NIL</span> .AND. oBranch:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">2</span><br /><br /> EVAL<span style="color: #000000;">(</span> bAddTotals, oBranch <span style="color: #000000;">)</span> <br /> oBranch := oBranch:<span style="color: #000000;">GetNext</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> END <br /><br /> oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _EXPECTED <span style="color: #000000;">]</span> := nTotExp<br /> oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> := nTotPaid<br /><br /> oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PENDING <span style="color: #000000;">]</span> := oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _EXPECTED <span style="color: #000000;">]</span> - oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> <br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /><br /> EVAL<span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bBookmark</span>, nAt <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /><br /><br /><br /> </div>[/code:23hxl4cu] |
xbrowse MakeTotals() | Reinaldo
Forgive me .. I am not a class and method kind of programmer .. I have found this code to be effective when you have to update Maketotals()
When ever I need to update my total ( once it is initialized ) just call oLbx:MakeTotals() from your function and refresh the browse and your totals are updated.
From looking at your code, it appears you are doing the same thing, just in a different way <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Rick Lipkin
[code=fw:1zjaahou]<div class="fw" id="{CB}" style="font-family: monospace;"><br />WITH OBJECT oLbxB<br /> :<span style="color: #000000;">Balance</span>:<span style="color: #000000;">nFooterType</span> := AGGR_SUM <span style="color: #B900B9;">// balance is the column fieldname</span><br /> :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br /><br />...<br />...<br /><br /><span style="color: #00C800;">Static</span> Func YourFunction<span style="color: #000000;">(</span>oLbxB<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// add some records,delete some records or edit a record</span><br /><br />oLbxB:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// update the footer total</span><br />oLbxB:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span><span style="color: #00C800;">nil</span><span style="color: #000000;">)</span><br /> </div>[/code:1zjaahou] |
xbrowse MakeTotals() | Thank you Rick. I appreciate your response.
Perhaps I should break this post into two separate subjects. The makeTotals() problem arrises when you try to run MakeTotals from the bChange or bOnPostEdit property of the column and problem #2 is the one I demonstrate with my code. I'm guessing problem #2 is related but I'm not certain. To reproduce problem #1 you can try code like this:
[code=fw:2zdnuxzx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">ColHeaderName</span>:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> || oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:2zdnuxzx]
Problem #2 can be reproduced when working with trees (linked lists) and my code above can be used to test. I will start a new thread about problem #2 in hopes that someone can confirm and perhaps fix this problem with xbrowse if i'm proven correct.
Reinaldo. |
xbrowse MakeTotals() | [code=fw:z92a5xgi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> :<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> |o,x| ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span>:= x , ::<span style="color: #000000;">ReCalculate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:z92a5xgi]
may please be replaced with the standard construct:
[code=fw:z92a5xgi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> :<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span> |o,x,k| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> k == VK_ESCAPE, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">(</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span>:= x , ::<span style="color: #000000;">ReCalculate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:z92a5xgi]
which is safer.
With this change, the program works the same way as it was working in FWH 12.02 (the version I tested).
Standard safe practice is to assign the new value after considering the 3rd parameter nKey and the 2nd parameter xValue and then decide to assign the new value. Normal checks are that the nKey is not Escape key and 2nd parameter is not nil.
As we keep recommending and requesting from time to time, safer way would be to assign a SetGet block as bEditValue and let the XBrowse construct a safe bOnPostEdit codeblock. If there are some actions to be taken comsequent on a change in the value, as always we recommend using oCol:bOnChange codeblock. These recommendations apply to 2012 versions also as much as they apply to current versions. Our standard recommendation is not to code bOnPostEdit in the application program.
For example ( FWH12.08 till FWH15.03 )
[code=fw:z92a5xgi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> ADD <span style="color: #0000ff;">TO</span> ::<span style="color: #000000;">oBrw</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">{</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> x == <span style="color: #00C800;">nil</span> .or. ::<span style="color: #000000;">Brw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">nLevel</span> < <span style="color: #000000;">2</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span>, ;<br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> _PAID <span style="color: #000000;">]</span> := x <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> ;<br /> HEADER <span style="color: #ff0000;">"AmtPaid"</span><br /><other statements><br /><br /> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">AmtPaid</span>:<span style="color: #000000;">bOnChange</span> := <span style="color: #000000;">{</span> || ::<span style="color: #000000;">Recalculate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:z92a5xgi]
[quote:z92a5xgi]
I find all my apps break when executing xbrowse's makeTotals() method after a cell is changed. This happens when MakeTotals is called on bchange or on bOnPostEdit.
[/quote:z92a5xgi]
We are surprised and also pained to learn that all your appls are breaking with makeTotals(). Please let us know any other cases and we are too eager to support you.
For your information MakeTotals() today is the same as it was in the beginning of 2012. There are only two improvements (including 15.04 to be released) but those two are only improvements and method is fully backward compatible.
[quote:z92a5xgi]
I understand how new enhancements to the xbrowse class makes it unnecessary -at least on most cases- to execute MakeTotals after a cell is changed.
[/quote:z92a5xgi]
There is nothing new. This was there prior to 2012 too. And it remains the same even today.
[quote:z92a5xgi]
Trust me, there are legitimate reasons to call MakeTotoals
[/quote:z92a5xgi]
We do agree. The automatic recalculation of totals is not adequate in all cases and there are always good reasons to call :MakeTotals() again and again consequent on some changes. And please trust us too when we say there is no change in MakeTotals() method that breaks earlier code.
We may like to make one or two suggestions to the sample code provided.
MakeTotals() is not very appropriate to this case. Method Recalculate() which calculates the group totals can also calculate grand totals and displayed with oCol:bFooter codeblock.
The main problem is MakeTotals() by default total all rows. In this case it totals both group totals and also the leaf values resulting in the footer totals being twice the actual totals. You may see that the footer total of the "Paid" column in the above sample is displayed as 4000 whereas the correct total is 2000. (Whether you use 2012 or 2015 versions)
At the same time XBrowse provides for conditional totals similar to SUMIF(....). In this case
oCol:bSumCondition := { |n,o| o:oBrw:oTreeItem:nLevel == 1 }
totals only values for the Level 1 items. If you use this for columns 2,3,4, MakeTotals() gives the correct totals.
This feature was available in FWH12.02 too and continues to function the same way even today.
But the limitation is that the automaic retotal feature dose not work correctly We need to call MakeTotals() whenever there is a change. |
xbrowse MakeTotals() | Mr. Rao.
Thank you very much for your response and detailed explanation.
[quote:rcdwyizd] :bOnPostEdit := { |o,x,k| If( k == VK_ESCAPE, nil, ( ::oBrw:oTreeItem:Cargo[ _PAID ]:= x , ::ReCalculate() ) ) }[/quote:rcdwyizd]
Notice the error occurs when clicking on the square box of the leaf cell -**Esc key is not being explicitly pressed**- and how with 2012 it works even w/out doing this check. I can, however, understand how some code will eventually fail if it is different or "faulty" from the beginning. I can perfectly understand how this is not xbrowse's fault. I apologize. Having said that, I think the action taken by xbrowse when clicking on the square box, should not cause a run time error even if bOnPostEdit is not checking for the esc key. Does this make sense?
My sample code above does not demonstrate problems with MakeTotals that the use of bSumCondition can't fix. I haven't been using makeTotals with Trees since I did not know about bSumCondition. I thought I did not have to demonstrate the problem with MakeTotals as I thought it was well known and was hoping for a quick fix. However, after reading your response I now realize the problem was on my use of bOnPostEdit which in turn made any sum() function fail when encountering Nil values.
Even though you argue that there is no change on MakeTotals, I still think there are since I had to add code to return cursor position to the current cell after calling MakeTotals. I did not have to do this with 2012.
This new/odd behavior is what mislead me into thinking all the problems were MakeTotals() related. I was wrong. I hope I don't have to demonstrate that the cursor does move from the current cell to the very last row after calling Maketotals() on fw 2014. Granted, this is not a huge problem and I found a quick fix for it so it is not my point on this post. Like I said -I was, obviously, mislead into thinking MakeTotals() was the culprit of -what we now know- was my bad use of bOnPostEdit.
Someone should write a guide on how to best use xbrowse as this class keeps getting more and more complex with the passing of time -which is a good thing and I wouldn't have it any other way.
Again, thank you very much for your help and I hope you continue to improve xbrowse.
Reinaldo. |
xbrowse MakeTotals() | [quote:222xwxy9]Even though you argue that there is no change on MakeTotals, I still think there are since I had to add code to return cursor position to the current cell after calling MakeTotals. [/quote:222xwxy9]
I do not know which current version are you using.
You do not need to re-position after MakeTotals() in the current versions. Please re-check again and if you still have the problem please let us know your version. I do not think that it is current. If the version is older, let us check and provide fix if needed.
Sorry, I do not argue. I try my best to help and support. |
xbrowse RETURN no hace nada en combobox. | Hola.
Tengo un combobox en una celda, si expando la lista y selecciono con el mouse anda perfecto. Ahora si expando o solo quiero seleccionar con las flechas... al presionar la tecla RETURN no me deja la opcion que he seleccionado.
Que hago mal?
gracias. |
xbrowse Report from array ( images field logic) | As you can see here I have a xbrowse and I make oGrid:Report()
[img:1y24wh3w]https://i.postimg.cc/WzJFmZRT/errore-stampa.jpg[/img:1y24wh3w]
the images are printed but the 3th column not print the image but .t. or .f.
How I can to print images as xbrowse ? |
xbrowse Report from array ( images field logic) | As of now, these images are not printed.
We will try to improve this soon. |
xbrowse Report from array ( images field logic) | Can i print with particolar setup of xb report ?
Or i must report to hand |
xbrowse Report from array ( images field logic) | You need to do it by hand.
It is coplex to do it from xbrowse. We need time to provide for that. |
xbrowse SCROOL... | Hola. Por favor podrian decirme porque esto no funciona? ya me he leido los post dicen que hay que poner un WINDOWS STYLE, pero yo trabajo con .res no con .rc
[code=fw:31rhev19]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> :<span style="color: #000000;">lKinetic</span> := .F.<br /> :<span style="color: #000000;">ltransparent</span> := .F.<br /> :<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">29</span><br /> :<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">28</span><br /> :<span style="color: #000000;">lHScroll</span> := <span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> :<span style="color: #000000;">lVScroll</span> := <span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> :<span style="color: #000000;">lRecordSelector</span> := .F.<br /> :<span style="color: #000000;">lAllowColSwapping</span> := .F.<br /> :<span style="color: #000000;">lColDividerComplete</span> := .F.<br /> :<span style="color: #000000;">nRowDividerStyle</span> := <span style="color: #000000;">4</span><br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /> :<span style="color: #000000;">nColDividerStyle</span> := <span style="color: #000000;">4</span><br /> :<span style="color: #000000;">L2007</span> := .T.<br /> </div>[/code:31rhev19]
Es un problema que ya viene hace tiempo, no hay forma que se solucione definitivamente?
gracias. |
xbrowse SCROOL... | Cual?
[code=fw:1xwz6zwr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> :<span style="color: #000000;">lHScroll</span> := <span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> :<span style="color: #000000;">lVScroll</span> := <span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> </div>[/code:1xwz6zwr]
Regards, saludos. |
xbrowse SCROOL... | Teste \samples\COLIN.prg que está errado?
Regards, saludos. |
xbrowse SCROOL... | Mira:
[code=fw:1uha4v3p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// \samples\COLIN.PRG - Modificado en: 14/11/2021 - Joao.</span><br /><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"xBrowse.ch"</span><br /><br /><span style="color: #00D7D7;">#Define</span> <span style="color: #00C800;">TRUE</span> .T.<br /><span style="color: #00D7D7;">#Define</span> <span style="color: #00C800;">FALSE</span> .F.<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oWnd, oBrw, oCol<br /><br /> REQUEST DBFCDX<br /><br /> USE Colin <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Class TXBrowse example"</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> FWVERSION + <span style="color: #ff0000;">", "</span> + FWCOPYRIGHT <span style="color: #0000ff;">CENTERED</span> TIME DATE<br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL<br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_BLACK<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := <span style="color: #00C800;">TRUE</span><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := <span style="color: #00C800;">TRUE</span><br /> oBrw:<span style="color: #000000;">nDatalines</span> := <span style="color: #000000;">1</span><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">24</span><br /><br /> <span style="color: #B900B9;">// AQUI:</span><br /> oBrw:<span style="color: #000000;">lHScroll</span> := <span style="color: #00C800;">TRUE</span> <span style="color: #B900B9;">// FALSE</span><br /> oBrw:<span style="color: #000000;">lVScroll</span> := <span style="color: #00C800;">TRUE</span> <span style="color: #B900B9;">// FALSE</span><br /><br /> oBrw:<span style="color: #000000;">lFooter</span> := <span style="color: #00C800;">TRUE</span><br /> oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span>|| oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// oBrw:nStretchCol := STRETCHCOL_LAST</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Code"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">50</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@!'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->CODE <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_LEFT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->CODE := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Description"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">220</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->DESC <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_LEFT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->DESC := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Qty"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">45</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'9999'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->qty <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_RIGHT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->qty := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Cost"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br /><br /> <span style="color: #B900B9;">// oCol:cEditPicture := '999999.99'</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'€999999.99 '</span><br /><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->cost <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_RIGHT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->cost := v, ;<br /> Colin->charge := Colin->cost * ;<br /> Colin->qty, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">lTotal</span> := <span style="color: #00C800;">TRUE</span><br /> oCol:<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Charget"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'999999.99'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->charge <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_RIGHT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->charge := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol:<span style="color: #000000;">lTotal</span> := <span style="color: #00C800;">TRUE</span><br /> oCol:<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, CLRTEST<span style="color: #000000;">(</span> CLR_WHITE, CLR_WHITE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// COLORES EN WINDOW -FUNCIONA-- +-</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> CLRTEST <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> int aElements<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> COLOR_CAPTIONTEXT, COLOR_ACTIVECAPTION <span style="color: #000000;">}</span>;<br /> DWORD aColors<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>;<br /><br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span> = hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> SetSysColors<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, aElements, aColors <span style="color: #000000;">)</span>;<br /><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #B900B9;">// ???</span><br /><span style="color: #B900B9;">/*<br />DLL32 Function SetSysColors ( nChanges As LONG, lpSysColor As LONG, lpColorValues As LONG) As LONG ;<br /> PASCAL FROM "SetSysColors" Lib "user32"<br />*/</span><br /> </div>[/code:1uha4v3p]
Regards, saludos. |
xbrowse SCROOL... | [quote="karinha":5ms9sy6r]Mira:
[code=fw:5ms9sy6r]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// \samples\COLIN.PRG - Modificado en: 14/11/2021 - Joao.</span><br /><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"xBrowse.ch"</span><br /><br /><span style="color: #00D7D7;">#Define</span> <span style="color: #00C800;">TRUE</span> .T.<br /><span style="color: #00D7D7;">#Define</span> <span style="color: #00C800;">FALSE</span> .F.<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oWnd, oBrw, oCol<br /><br /> REQUEST DBFCDX<br /><br /> USE Colin <span style="color: #00C800;">NEW</span> SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Class TXBrowse example"</span><br /><br /> SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">TO</span> FWVERSION + <span style="color: #ff0000;">", "</span> + FWCOPYRIGHT <span style="color: #0000ff;">CENTERED</span> TIME DATE<br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ALIAS</span> <span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL<br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_BLACK<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := <span style="color: #00C800;">TRUE</span><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := <span style="color: #00C800;">TRUE</span><br /> oBrw:<span style="color: #000000;">nDatalines</span> := <span style="color: #000000;">1</span><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">24</span><br /><br /> <span style="color: #B900B9;">// AQUI:</span><br /> oBrw:<span style="color: #000000;">lHScroll</span> := <span style="color: #00C800;">TRUE</span> <span style="color: #B900B9;">// FALSE</span><br /> oBrw:<span style="color: #000000;">lVScroll</span> := <span style="color: #00C800;">TRUE</span> <span style="color: #B900B9;">// FALSE</span><br /><br /> oBrw:<span style="color: #000000;">lFooter</span> := <span style="color: #00C800;">TRUE</span><br /> oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span>|| oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #B900B9;">// oBrw:nStretchCol := STRETCHCOL_LAST</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Code"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">50</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@!'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->CODE <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_LEFT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->CODE := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Description"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">220</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->DESC <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_LEFT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->DESC := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Qty"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">45</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'9999'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->qty <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_RIGHT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->qty := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Cost"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br /><br /> <span style="color: #B900B9;">// oCol:cEditPicture := '999999.99'</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'€999999.99 '</span><br /><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->cost <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_RIGHT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->cost := v, ;<br /> Colin->charge := Colin->cost * ;<br /> Colin->qty, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">lTotal</span> := <span style="color: #00C800;">TRUE</span><br /> oCol:<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br /><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Charget"</span><br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">60</span><br /> oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'999999.99'</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span>|| Colin->charge <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nDataStyle</span> := oCol:<span style="color: #000000;">DefStyle</span><span style="color: #000000;">(</span> AL_RIGHT, .T. <span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">{</span>| o, v | RLock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, Colin->charge := v, dbCommit<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> dbUnlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oCol:<span style="color: #000000;">lTotal</span> := <span style="color: #00C800;">TRUE</span><br /> oCol:<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br /><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oWnd:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, CLRTEST<span style="color: #000000;">(</span> CLR_WHITE, CLR_WHITE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// COLORES EN WINDOW -FUNCIONA-- +-</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> CLRTEST <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> int aElements<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> = <span style="color: #000000;">{</span> COLOR_CAPTIONTEXT, COLOR_ACTIVECAPTION <span style="color: #000000;">}</span>;<br /> DWORD aColors<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>;<br /><br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span> = hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> aColors<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>;<br /> SetSysColors<span style="color: #000000;">(</span> <span style="color: #000000;">2</span>, aElements, aColors <span style="color: #000000;">)</span>;<br /><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #B900B9;">// ???</span><br /><span style="color: #B900B9;">/*<br />DLL32 Function SetSysColors ( nChanges As LONG, lpSysColor As LONG, lpColorValues As LONG) As LONG ;<br /> PASCAL FROM "SetSysColors" Lib "user32"<br />*/</span><br /> </div>[/code:5ms9sy6r]
Regards, saludos.[/quote:5ms9sy6r]
Hola. todo eso ya he probado. y nada resulto. utilizo el control LISTBOX en pelesC ya he probado con combobox y nada. |
xbrowse SCROOL... | Post un ejemplo de como usted está haciendo para testes. Donde está el error que usted produce. Mister Nages puede mirar. Saludos. |
xbrowse SCROOL... | Hola,
Si usas PELLES revisa la propiedad DISABLE NO SCROLL debe estar en YES
Espero sea eso. |
xbrowse SCROOL... | [quote="JoseAlvarez":2o86z2yu]Hola,
Si usas PELLES revisa la propiedad DISABLE NO SCROLL debe estar en YES
Espero sea eso.[/quote:2o86z2yu]
FUNCIONO!
perfecto! gracias |
xbrowse Tree - Error alguien le pasa esto | Alguien me puede dar una indicacion que pasa cuando genera este error, cuando cargo el browse xbrowse tree cuando ubico el puntero en cuanquier columna menos en la primera me genera un error al salir. cuando me ubico el la columna primera no pasa esto. Anexo error y pantalla.
Codigo cuando me digo salir
[code=fw:1wpuyjtc]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br /> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"reg_salir"</span> TOP ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Salir"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>lExit := .T.,oLbxr:<span style="color: #000000;">oDlgBrow</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>; <span style="color: #B900B9;">//oLbxr:oDlgBrow:End()</span><br /> TOOLTIP <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Salir del Formulario"</span>, <span style="color: #ff0000;">"Salir"</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">if</span> x_brodesv<br /> barbwodegra<span style="color: #000000;">(</span>oBar,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> </div>[/code:1wpuyjtc]
Error
Application
===========
Path and name: K:\proy_harb\plastwin.Exe (32 bits)
Size: 1,495,040 bytes
Time from start: 0 hours 0 mins 41 secs
Error occurred at: 11/23/2010, 14:17:12
Error description: Error BASE/1004 Class: 'NUMERIC' has no exported method: EVAL
Args:
[ 1] = N 255
Stack Calls
===========
Called from: => EVAL(0)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(9060)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DRAWLINE(1697)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1408)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(1201)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1457)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(11016)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => SYSREFRESH(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONDOWN(586)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1481)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1437)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: K:\proy_harb\PRG\claserub_brow.prg => BROP0025_1:DIALGINI(180)
Called from: K:\proy_harb\PRG\pxprebro_1.prg => BROP0025_1:NEW(5919)
Called from: K:\proy_harb\PRG\pxplrep1.prg => PROG_REP_1(317)
Called from: K:\proy_harb\PRG\pxprutrep_1.prg => MYCLICK(819)
Called from: K:\proy_harb\PRG\pxprutrep_1.prg => (b)REP_TREE1(116)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LDBLCLICK(1872)
Called from: .\source\classes\CONTROL.PRG => TTREEVIEW:LDBLCLICK(1512)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1497)
Called from: .\source\classes\TTREEVIE.PRG => TTREEVIEW:HANDLEEVENT(287)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: K:\proy_harb\PRG\pxprutrep_1.prg => REP_TREE1(131)
Called from: K:\proy_harb\PRG\pxpmenbar.prg => (b)MENU01_1:DIALBAR00(263)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(463)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(658)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1487)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1437)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(978)
Called from: K:\proy_harb\PRG\pxpmenbar.prg => MENU01_1:DIALMEN00(176)
Called from: K:\proy_harb\PRG\pxpmenbar.prg => MENU01_1:NEW(1051)
Called from: K:\proy_harb\PRG\pxpmenu.prg => MAIN(451)
System
======
CPU type: Intel(R) Pentium(R) 4 CPU 2.80GHz 2800 Mhz
Hardware memory: 2040 megs
<!-- m --><a class="postlink" href="http://img593.imageshack.us/img593/8857/errorentree.jpg">http://img593.imageshack.us/img593/8857/errorentree.jpg</a><!-- m --> |
xbrowse Tree - Error alguien le pasa esto | [quote="ruben Dario":1dv9y5nf]Alguien me puede dar una indicacion que pasa cuando genera este error, cuando cargo el browse xbrowse tree cuando ubico el puntero en cuanquier columna menos en la primera me genera un error al salir. cuando me ubico el la columna primera no pasa esto. Anexo error y pantalla.
Codigo cuando me digo salir
[code=fw:1dv9y5nf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar ;<br /> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"reg_salir"</span> TOP ;<br /> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Salir"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>lExit := .T.,oLbxr:<span style="color: #000000;">oDlgBrow</span>:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>; <span style="color: #B900B9;">//oLbxr:oDlgBrow:End()</span><br /> TOOLTIP <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Salir del Formulario"</span>, <span style="color: #ff0000;">"Salir"</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">if</span> x_brodesv<br /> barbwodegra<span style="color: #000000;">(</span>oBar,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><br /> </div>[/code:1dv9y5nf]
Error
Application
===========
Path and name: K:\proy_harb\plastwin.Exe (32 bits)
Size: 1,495,040 bytes
Time from start: 0 hours 0 mins 41 secs
Error occurred at: 11/23/2010, 14:17:12
Error description: Error BASE/1004 Class: 'NUMERIC' has no exported method: EVAL
Args:
[ 1] = N 255
Stack Calls
===========
Called from: => EVAL(0)
Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(9060)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DRAWLINE(1697)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:PAINT(1408)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:DISPLAY(1201)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1457)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT(11016)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => SYSREFRESH(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONDOWN(586)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1481)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1437)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: K:\proy_harb\PRG\claserub_brow.prg => BROP0025_1:DIALGINI(180)
Called from: K:\proy_harb\PRG\pxprebro_1.prg => BROP0025_1:NEW(5919)
Called from: K:\proy_harb\PRG\pxplrep1.prg => PROG_REP_1(317)
Called from: K:\proy_harb\PRG\pxprutrep_1.prg => MYCLICK(819)
Called from: K:\proy_harb\PRG\pxprutrep_1.prg => (b)REP_TREE1(116)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:LDBLCLICK(1872)
Called from: .\source\classes\CONTROL.PRG => TTREEVIEW:LDBLCLICK(1512)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1497)
Called from: .\source\classes\TTREEVIE.PRG => TTREEVIEW:HANDLEEVENT(287)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: K:\proy_harb\PRG\pxprutrep_1.prg => REP_TREE1(131)
Called from: K:\proy_harb\PRG\pxpmenbar.prg => (b)MENU01_1:DIALBAR00(263)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(463)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(658)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1487)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1437)
Called from: .\source\classes\WINDOW.PRG => _FWH(3397)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(978)
Called from: K:\proy_harb\PRG\pxpmenbar.prg => MENU01_1:DIALMEN00(176)
Called from: K:\proy_harb\PRG\pxpmenbar.prg => MENU01_1:NEW(1051)
Called from: K:\proy_harb\PRG\pxpmenu.prg => MAIN(451)
System
======
CPU type: Intel(R) Pentium(R) 4 CPU 2.80GHz 2800 Mhz
Hardware memory: 2040 megs
<!-- m --><a class="postlink" href="http://img593.imageshack.us/img593/8857/errorentree.jpg">http://img593.imageshack.us/img593/8857/errorentree.jpg</a><!-- m -->[/quote:1dv9y5nf] |
xbrowse TreeItem | Dear All,
How to delete oTreeItem ( oItem:Delete() ) if oTreeItem:oNext is NIL?
Kind Regards,
Frances |
xbrowse TreeItem | Dear Mr. RAO,
Any sample how to remove a tree treeitem from oTree?
If a condition is met.. this treeitem mus be remove. Any help?
Kind Regards,
Frances |
xbrowse TreeItem | you Know how delete a record from xbrowse ? |
xbrowse TreeItem | [quote="fraxzi":2y4vlrhz]Dear Mr. RAO,
Any sample how to remove a tree treeitem from oTree?
If a condition is met.. this treeitem mus be remove. Any help?
Kind Regards,
Frances[/quote:2y4vlrhz]
Actually this is not quite simple.
Version 10.12 handles this properly. |
xbrowse TreeItem | [quote="nageswaragunupudi":2ls4efrd][quote="fraxzi":2ls4efrd]Dear Mr. RAO,
Any sample how to remove a tree treeitem from oTree?
If a condition is met.. this treeitem mus be remove. Any help?
Kind Regards,
Frances[/quote:2ls4efrd]
Actually this is not quite simple.
Version 10.12 handles this properly.[/quote:2ls4efrd]
I see..
I already requested my company for new FHW upgrade 11.1
I guess I need to wait for that.
Kind Regards,
Frances |
xbrowse TreeItem | [quote="Silvio":ldmyplna]you Know how delete a record from xbrowse ?[/quote:ldmyplna]
Dear Silvio,
In my case, I used VK_DELETE key assign it to bKeyChar with code block alias->( dbdelete() ) and refresh the xbrowse.
if you mean the ::oTreeItem:Delete(), doesn't work perfectly with my case.
Kind regards,
Frances |
xbrowse TreeItem | but I think you can delete a record and then refresh the tree |
xbrowse TreeItem | [quote="MdaSolution":3rzmyrmv]but I think you can delete a record and then refresh the tree[/quote:3rzmyrmv]
My alternate solution is to exclude a record matching my condition..
Thank you for your suggestion.
Kind Regards,
Frances |
xbrowse TreeItem | Yes. For the time being, you can delete the record from the original data and then reconstruct the tree and refresh the browse. Seems very crude solution but works quite well and I myself used it under complex situations without hitting the performance. |
xbrowse TreeItem | Hello,
in other way are there the option to create a subtree or tree on run-time, per example all the item in the xbrowse are level 0 in the tree then by double click or another method we add a tree for the current row in the xbrowse and open it.
regards
Marcelo |
xbrowse TreeItem | Yes.
[code=fw:qgj2ps6k]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT oBrw:<span style="color: #000000;">oTreeItem</span><br /> :<span style="color: #000000;">SetTree</span><span style="color: #000000;">(</span> oSubTree <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">Open</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />END<br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:qgj2ps6k] |
xbrowse TreeItem | Thanks very much Mr. RAO,
I found it and work, another question how can delete the tree without delete the root, in other words delete only the same tree added
regards
Marcelo |
xbrowse TreeItem | Hello again.
because I have thousands of records, I want to know if it possible to have a normal xBrowse database associated
with the possibility to make a tree in some row by demand, no for all, only for selected row
thanks in advance
Marcelo |
xbrowse TreeItem | [quote="Marcelo Via Giglio":j9g0t5na]Thanks very much Mr. RAO,
I found it and work, another question how can delete the tree without delete the root, in other words delete only the same tree added
regards
Marcelo[/quote:j9g0t5na]
[code=fw:j9g0t5na]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oItem:<span style="color: #000000;">oTree</span> := <span style="color: #00C800;">nil</span><br /> </div>[/code:j9g0t5na] |
xbrowse TreeItem | [quote="Marcelo Via Giglio":3q32885b]Hello again.
because I have thousands of records, I want to know if it possible to have a normal xBrowse database associated
with the possibility to make a tree in some row by demand, no for all, only for selected row
thanks in advance
Marcelo[/quote:3q32885b]
Please try this:
Create browse of the DBF in the normal way.
Insert this line:
[code=fw:3q32885b]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">SetTree</span><span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span></div>[/code:3q32885b]
just before activating window or dialog.
Now the browse will be on oBrw:oTree created automatically by XBrowse and each oItem of the oTree having the record number of the dbf.
When the tree is navigated, the dbf goes to the record. The browse will still look like the one you created on the dbf.
Now you add a child tree to any item you want. |
xbrowse TreeItem | Mr. RAO,
thanks very much for your answer, to delete tree work perfectly, but not to create a tree inside xbrowse dbf data, do you have other idea?
many thanks again
regards
Marcelo |
xbrowse Vs listbox: help to structure the body of invoice | in the old program to display the body of the invoice I used the lbx class now with xbrowse I have many difficulties
[b:2y1lpnyu]with listbox[/b:2y1lpnyu]
[code=fw:2y1lpnyu]<div class="fw" id="{CB}" style="font-family: monospace;">oDPar:=Open_Dbf<span style="color: #000000;">(</span><span style="color: #ff0000;">"ParxFac"</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oBPar ;<br /> FIELDS <span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->CvePro, Desp_Fld<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->Alm , ;<br /> Tran<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->Cantid,oT:<span style="color: #000000;">cPic3</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->UniMed, ;<br /> Tran<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->PreUni,oT:<span style="color: #000000;">cPic4</span><span style="color: #000000;">)</span>, ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->MC,cCon,<span style="color: #ff0000;">""</span><span style="color: #000000;">)</span>, ;<br /> Tran<span style="color: #000000;">(</span><span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>->ImpPar,<span style="color: #ff0000;">"9999,999.99"</span><span style="color: #000000;">)</span>;<br /> HEADER <span style="color: #ff0000;">"Codice"</span>, <span style="color: #ff0000;">"Descrizione"</span>, <span style="color: #ff0000;">"A"</span>, <span style="color: #ff0000;">"Quantità"</span>, <span style="color: #ff0000;">"Misura"</span>,;<br /> <span style="color: #ff0000;">"€ Unit"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"Importo"</span> ;<br /> SIZES <span style="color: #000000;">75</span>,<span style="color: #000000;">275</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">65</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">65</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">70</span> ;<br /> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">(</span>oDPar<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span><span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> oBPar:<span style="color: #000000;">nColAct</span>:=<span style="color: #000000;">1</span><br /> oBPar:<span style="color: #000000;">lCellStyle</span> :=.T.<br /> oBPar:<span style="color: #000000;">lDrawFooter</span>:=.T.<br /> oBPar:<span style="color: #000000;">nClrForeHead</span>:=CLR_BLUE<br /> oBPar:<span style="color: #000000;">bChange</span> :=<span style="color: #000000;">{</span>|| Refr_Con<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oBPar:<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span>|nKey| Val_nKPar<span style="color: #000000;">(</span>nKey,oDlg<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oBPar:<span style="color: #000000;">bLDblClick</span>:=<span style="color: #000000;">{</span>|| <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>oT:<span style="color: #000000;">lNew</span>,Captura<span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oBPar:<span style="color: #000000;">bGoTop</span> :=<span style="color: #000000;">{</span>|| GoToTop<span style="color: #000000;">(</span>oDPar,oT:<span style="color: #000000;">aDat</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oBPar:<span style="color: #000000;">bGoBottom</span>:=<span style="color: #000000;">{</span>|| GoToBot<span style="color: #000000;">(</span>oDPar,oT:<span style="color: #000000;">aDat</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oBPar:<span style="color: #000000;">bSkip</span> :=<span style="color: #000000;">{</span>|n| MovePtr<span style="color: #000000;">(</span>oDPar,oT:<span style="color: #000000;">aDat</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>,n<span style="color: #000000;">)</span><span style="color: #000000;">}</span></div>[/code:2y1lpnyu]
oT:aDat[1] is the number of the invoice
now with xbrowse how do I have to do to show only the lines that are of that invoice?
SELECT TB
TB->(DbSetOrder(1))
TB->( OrdScope(0, { || oT:aDat[1] }))
TB->( OrdScope(1, { || oT:aDat[1] }) )
TB->(DbGoTop())
[code=fw:2y1lpnyu]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aBrowse := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">"PAITEM"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">50</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PADESC"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Descrizione"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">290</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAQTY"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Quantità"</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">"9999"</span> ,<span style="color: #000000;">45</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAMISURA"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Misura"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">37</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAUNITARIO"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span> ,pict_money_Euro ,<span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PASCONTO"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"%Sconto"</span><span style="color: #000000;">)</span> , <span style="color: #00C800;">nil</span> ,<span style="color: #000000;">60</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAPROVV"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"%Provv."</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">'@ 999.99%'</span> ,<span style="color: #000000;">50</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PARIT"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Ritenuta"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAIVA"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">"99%"</span> ,<span style="color: #000000;">36</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PATOTALE"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Importo"</span><span style="color: #000000;">)</span> ,pict_money_Euro ,<span style="color: #000000;">80</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0.2</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br /> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">adialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> DATASOURCE <span style="color: #ff0000;">"TB"</span> ;<br /> COLUMNS aBrowse CELL LINES FOOTERS NOBORDER <span style="color: #0000ff;">FONT</span> oFont<br /> </div>[/code:2y1lpnyu]
I also thought of saving all the records of that invoice number in an array and working with the array but how do I save? and if there is another operator on the net who opens the same invoice what happens?
I do not feel confident that it will work well, risk of blowing up everything and displaying the data of other invoice
can you help me by giving me a small example perhaps with the class Tdatabase please
I made a test with tdatabase and when I insert a new record let me give an error
[img:2y1lpnyu]https://i.postimg.cc/WpFk48jB/invoice.png[/img:2y1lpnyu]
[code=fw:2y1lpnyu]<div class="fw" id="{CB}" style="font-family: monospace;"> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">07</span><span style="color: #000000;">-06</span><span style="color: #000000;">-2019</span>, <span style="color: #000000;">12</span>:<span style="color: #000000;">26</span>:<span style="color: #000000;">30</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1005</span> <span style="color: #0000ff;">Message</span> not found: <span style="color: #000000;">TDATABASE</span>:_NINVOICE<br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: .\source\<span style="color: #00C800;">function</span>\HARBOUR.PRG => _CLSSETERROR<span style="color: #000000;">(</span> <span style="color: #000000;">247</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\DATABASE.PRG => TDATABASE:_NINVOICE<span style="color: #000000;">(</span> <span style="color: #000000;">1392</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => INSERTRECORD<span style="color: #000000;">(</span> <span style="color: #000000;">861</span> <span style="color: #000000;">)</span></div>[/code:2y1lpnyu]
source
[code=fw:2y1lpnyu]<div class="fw" id="{CB}" style="font-family: monospace;"> aBrowse := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Image"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"ico"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"type"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Tipo"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Service"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Servizio"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Qta"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Q.tà"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Price"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Costo"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"TotPrice"</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Tot p q.tà"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"From"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Dal"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"To"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"al"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Days"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Attivo"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Descount"</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"sconto"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Totale"</span> , i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"totale"</span><span style="color: #000000;">)</span>,, <span style="color: #000000;">80</span>, <span style="color: #000000;">}</span> <span style="color: #000000;">}</span></div>[/code:2y1lpnyu]
oPartxRes:SetOrder(1)
oPartxRes:OrdScope(0, { ||nInvoice })
oPartxRes:OrdScope(1, { ||nInvoice })
oPartxRes:GoTop()
@ 120, 10 XBROWSE oBrowse OF oDlgPre ;
SIZE 100,150 PIXEL NOBORDER;
DATASOURCE oPartxRes COLUMNS aBrowse[/code]
when I press on product I call the function InsertRecord(oBrowse,nInvoice,oBtn,n,aGet)
[code=fw:2y1lpnyu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> InsertRecord<span style="color: #000000;">(</span>oBrowse,nInvoice,oBtn,n,aGet<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> ImgProduct := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> cProdDesc := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> nProdPrice := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> lPrintA4 := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> lPrintPos := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> lMultiple := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> cDescBreve := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> cStruttura := oBtn:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span><span style="color: #000000;">8</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Local</span> cStringaServizi:=<span style="color: #ff0000;">""</span><br /> <span style="color: #00C800;">Local</span> nPrezzoUnitario:=<span style="color: #000000;">0</span><br /><br /> <span style="color: #00C800;">Local</span> nQuant := <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">Local</span> nTotale:= <span style="color: #000000;">0</span><br /><br /> nTotale:= nProdPrice*nQuant<br /><br /> oPartxRes:<span style="color: #000000;">Append</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oPartxRes:<span style="color: #000000;">nInvoice</span> := nInvoice<br /> oPartxRes:<span style="color: #000000;">Type</span> :=<span style="color: #ff0000;">"S"</span><br /> oPartxRes:<span style="color: #0000ff;">image</span> := ImgProduct<br /> oPartxRes:<span style="color: #0000ff;">Desc</span> := cProdDesc<br /> oPartxRes:<span style="color: #000000;">Qta</span> := nQuant<br /> oPartxRes:<span style="color: #000000;">price</span> := nProdPrice<br /> oPartxRes:<span style="color: #000000;">totprice</span> := nTotale<br /><br /><br /> oPartxRes:<span style="color: #000000;">save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> nSubTotale+= nProdPrice<br /> oBrowse:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrowse:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> </div>[/code:2y1lpnyu] |
xbrowse ajustar columnas | estmados
como ajustar las columnas al ancho de las celdas
tengo este codigo con la version antiguas no pasaba, con la version 16.1 build2
con arreglos no pasa, solo con dbf
[quote:1zbpekt8] @ 0,0 XBROWSE oBrw OF oPanel ;
FIELDS ;
"'"+(alias_articu)->Ar_Codig, ;
(alias_articu)->Ar_Descr, ;
iif( (alias_articu)->Ar_N_Inv, 0, Stocksucursal(aAlias,aGet2,aBodega)),;
(alias_articu)->(vPrecioArt()*val("1."+alltrim(str((alias_parame)->Iva)))),;
(alias_articu)->ar_m_des,;
vertabla( "UBI" + ((alias_bodega)->( dbSeek( (alias_articu)->ar_codig + _bodega ) ), (alias_bodega)->ar_ubica ), alias_tablas),;
Vertabla( "FAM" + (alias_articu)->ar_familia, (alias_tablas) ),;
Vertabla( "CLA" + (alias_articu)->ar_clase, (alias_tablas) ),;
(alias_articu)->Ar_Prove,;
((alias_proveedo)->( dbSeek( (alias_articu)->Ar_Prove) ),(alias_proveedo)->Nombre),;
dtoc( (alias_articu)->Ar_F_Uco),;
(alias_articu)->Ar_P_Med,;
(alias_articu)->Ar_s_Cri,;
(alias_articu)->Ar_f_ini,;
iif( (alias_articu)->Ar_n_inv, "NO INVENTARIABLE", "INVENTARIABLE" ),;
(alias_articu)->Ar_S_Act,;
Vertabla( "UNI" + (alias_articu)->ar_unida, (alias_tablas) ),;
Vertabla( "CTA" + (alias_articu)->ar_ctacble, (alias_tablas) ) ;
;
HEADERS 'Código', 'Descripción ', 'Stock ', 'Precio c/iva', '% Desc', 'Ubicación', 'Nombre Familia', 'Nombre Clase',;
'Rut Prov.', 'Nombre Proveedor', 'Fec.U.C', 'P.Medio', 'Crítico', 'Fec.Creación', 'Articulo', 'Stock Actual', 'Unidad', 'CtaCble' ;
;
ALIAS (alias_articu) ;
PICTURE NIL,NIL,"@E 9,999.9", "@E 9,999,999";
JUSTIFY AL_LEFT,AL_LEFT UPDATE ;
LINES CELL AUTOSORT;
ON DBLCLICK iif( Eval( oTaskPanel:Item(1):Item(2):bWhen ), ( AbmArticu(aAlias,oBrw, "M", aGet2 ), oBrw:SetFocus() ), MsgInfo( "No está autorizado..","Usuario" ) )
WITH OBJECT oBrw
:nStretchCol := STRETCHCOL_WIDEST
:nColDividerStyle := LINESTYLE_RAISED
:nRowDividerStyle := LINESTYLE_RAISED
:nMarqueeStyle := MARQSTYLE_HIGHLROW
:LAllowColSwapping := .f.
:lColDividerComplete := .f.
:lAllowRowSizing := .f.
:lAllowColHiding := .f.
:lKineticBrw := .f.
:nRowHeight := 24
:nHeaderHeight := 22
:bClrRowFocus := { || { CLR_BLACK, aGradRowSel/*RGB(185,220,255)*/ } }
:bClrStd := {|| { nRGB( 0, 0, 0), nRGB(255,248,220) } } // colores para lineas normales
:bClrSel := {|| { nRGB( 0, 0, 0), aGradRowSel } } // para barra de linea selecc cuando el control no tiene el foco
:bClrSelFocus := { || { CLR_BLACK, aGradBarSel } } // para barra de linea selecc cuando el control tiene el foco
:lRecordSelector := .f.
:aCols[1]:cSortOrder := "ARCODIG"
:aCols[2]:cSortOrder := "ARDESCR"
//:bSeek := {|c| (alias_articu)->(DbSeek( Upper( c ) )) }
:bPopUp := { |o| ShowPopupBrw( o, oTaskPanel ) }
:CreateFromCode()
END
[/quote:1zbpekt8]
[img:1zbpekt8]http://s2.subirimagenes.com/imagen/previo/thump_9515100xbrowse2.png[/img:1zbpekt8] |
xbrowse ajustar columnas | Estimados
aun le estoy dando vuelta al tema y al parecer el problema se resualve parcialmente con
//:nRowHeight := 24
se le saco esta instruccion el sistema muestra correcto pero demasiado ajustado y no se ve bien
[url=http://www.subeimagenes.com/img/xbrowse-1636506.html:24juo8am][img:24juo8am]http://www.subeimagenes.com/thumb/xbrowse-1636506.jpg[/img:24juo8am][/url:24juo8am] Subido en [url=http://www.subeimagenes.com:24juo8am]subir imagenes[/url:24juo8am] |
xbrowse ajuste coluna | fwh1509
[img:6srgx844]https://uploaddeimagens.com.br/images/000/570/204/full/Sem_t%C3%ADtulo2.jpg?1455632149[/img:6srgx844]
fwh1512
[img:6srgx844]https://uploaddeimagens.com.br/images/000/570/203/full/Sem_t%C3%ADtulo.jpg?1455632001[/img:6srgx844]
tem como corrigir isto? |
xbrowse ajuste coluna | We are going to review it asap, thanks |
xbrowse ajuste coluna | Antonio
el problema esta en el este method
[b:2bd5wmdn]METHOD DataWidth() CLASS TXBrwColumn[/b:2bd5wmdn]
he utilizado momentaneamnete una version antigua 15.2 y las culumnas quedan cuadradas |
xbrowse ajuste coluna | UP
espera de correccion.
[]s |
xbrowse alinear columnas. | En el ejmeplo que pongo quiero alinear todo a centrado, el titulo si sale centrado, pero no se como alinear centrado los datos de las celdas, he probado con :nDataStrAlign pero me da el siguiente error : Message not found: TXBROWSE:NDATASTRALIGN
Alguien podria indicarme como ordenar los datos dentro de cada "celda". Se que deber ser una tonteria, pero no lo consigo.
Muchas Gracias.
[code=fw:jzjn5rlf]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">FOLDER</span> oFld <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDDATOS <span style="color: #0000ff;">UPDATE</span>;<br /> <span style="color: #0000ff;">PROMPT</span> &vprompt <span style="color: #0000ff;">DIALOGS</span> &vfolders <span style="color: #0000ff;">ADJUST</span>;<br /> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">change</span> <span style="color: #000000;">(</span>refrescardatos<span style="color: #000000;">(</span>vestanteria,oBrw<span style="color: #000000;">[</span>oFld:<span style="color: #000000;">nOption</span><span style="color: #000000;">]</span>,oFld:<span style="color: #000000;">nOption</span>,vfilas<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">FOR</span> i:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> vprofundo<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> ;<br /> HEADERS V_Header ;<br /> SIZES V_ColSize ;<br /> DATASOURCE aData<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER FASTEDIT <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /><br /> WITH OBJECT oBrw<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">bRClicked</span>:= <span style="color: #000000;">{</span>|| borrararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria,vfilas,oFld<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span>|| buscararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bKeychar</span> := <span style="color: #000000;">{</span>|nkey| iif<span style="color: #000000;">(</span>nkey=<span style="color: #000000;">13</span> .and. oBrw<span style="color: #000000;">[</span>oFld:<span style="color: #000000;">nOption</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nColSel</span> > <span style="color: #000000;">1</span>,buscararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria<span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">lColChangeNotify</span> := .t.<br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> |oBrw| refrescardatos<span style="color: #000000;">(</span>vestanteria,oBrw,oFld:<span style="color: #000000;">nOption</span>,vfilas<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nFreeze</span>:=<span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lFullGrid</span> := .t.<br /><br /> END<br /><br /> <span style="color: #00C800;">next</span> i</div>[/code:jzjn5rlf] |
xbrowse alinear columnas. | Con que versión estás compilando ?
Saludos |
xbrowse alinear columnas. | Fivewin Habour 15.09 y borland cc 5.82 |
xbrowse alinear columnas. | Garbi.
Intentalo asi:
....
....
[code=fw:13t6n443]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT oBrw<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">bRClicked</span>:= <span style="color: #000000;">{</span>|| borrararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria,vfilas,oFld<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span>|| buscararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bKeychar</span> := <span style="color: #000000;">{</span>|nkey| iif<span style="color: #000000;">(</span>nkey=<span style="color: #000000;">13</span> .and. oBrw<span style="color: #000000;">[</span>oFld:<span style="color: #000000;">nOption</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nColSel</span> > <span style="color: #000000;">1</span>,buscararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria<span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">lColChangeNotify</span> := .t.<br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> |oBrw| refrescardatos<span style="color: #000000;">(</span>vestanteria,oBrw,oFld:<span style="color: #000000;">nOption</span>,vfilas<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nFreeze</span>:=<span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lFullGrid</span> := .t.<br /> END<br /><br />AEval<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER <span style="color: #000000;">}</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// <----</span><br /><br /><span style="color: #00C800;">next</span> i</div>[/code:13t6n443]
Saludos. |
xbrowse alinear columnas. | Muchas Gracias. Funcionando Perfectamente.
Gracias por evitarme horas de trabajo.
Un saludo. |
xbrowse alinear columnas. | Hola garbi como armas vprompt y vFolders
PROMPT &vprompt DIALOGS &vfolders
Saludos |
xbrowse alinear columnas. | [code=fw:2kttaz8m]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// varias profundos</span><br /><br /><br /> <span style="color: #00C800;">for</span> i:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> vcolumnas<span style="color: #000000;">+1</span><br /> <span style="color: #00C800;">if</span> i = <span style="color: #000000;">1</span><br /> AADD<span style="color: #000000;">(</span>V_Header,<span style="color: #ff0000;">" "</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>V_Colsize,<span style="color: #000000;">50</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> AADD<span style="color: #000000;">(</span>V_Header,<span style="color: #ff0000;">"Columna "</span>+alltrim<span style="color: #000000;">(</span>transform<span style="color: #000000;">(</span>i<span style="color: #000000;">-1</span>,<span style="color: #ff0000;">"999"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> AADD<span style="color: #000000;">(</span>V_Colsize,<span style="color: #000000;">100</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">next</span> i<br /><br /><br />vprompt:= <span style="color: #ff0000;">'" 1 Profundidad"'</span><br /><span style="color: #00C800;">for</span> i:=<span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> vprofundo<br /> vprompt:=vprompt+<span style="color: #ff0000;">","</span>+<span style="color: #ff0000;">'"'</span>+alltrim<span style="color: #000000;">(</span>transform<span style="color: #000000;">(</span>i,<span style="color: #ff0000;">"999"</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">' Profundidad"'</span><br /><span style="color: #00C800;">next</span> i<br /><br /><br />vfolders:=<span style="color: #ff0000;">'"FOLDERS"'</span><br /><span style="color: #00C800;">FOR</span> i:= <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> vprofundo<br /> vfolders:=vfolders+<span style="color: #ff0000;">","</span>+<span style="color: #ff0000;">'"FOLDERS"'</span><br /><span style="color: #00C800;">next</span> i<br /><br /> aData := Array<span style="color: #000000;">(</span> vprofundo <span style="color: #000000;">)</span><br /> aData<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := Array<span style="color: #000000;">(</span> vfilas, vcolumnas<span style="color: #000000;">+1</span> <span style="color: #000000;">)</span><br /><br /> AEval<span style="color: #000000;">(</span> aData<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #000000;">{</span> |a,k| a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> := chr<span style="color: #000000;">(</span><span style="color: #000000;">(</span> k <span style="color: #000000;">)</span><span style="color: #000000;">+64</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">for</span> i:= <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> vcolumnas<span style="color: #000000;">+1</span><br /> AEval<span style="color: #000000;">(</span> aData<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, <span style="color: #000000;">{</span> |a,k| a<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span> := space<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> i<br /> AEval<span style="color: #000000;">(</span> aData, <span style="color: #000000;">{</span> |u,k| aData<span style="color: #000000;">[</span> k <span style="color: #000000;">]</span> := AClone<span style="color: #000000;">(</span> aData<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> oBrw := Array<span style="color: #000000;">(</span> vprofundo <span style="color: #000000;">)</span><br /><br /> area:=<span style="color: #0000ff;">select</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cdestant := OpenDbf<span style="color: #000000;">(</span>fdestant,<span style="color: #000000;">1</span>, , , , kdestant,<span style="color: #ff0000;">"DBFCDX"</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>DbSetOrder<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Dbgotop<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> acdestan:=<span style="color: #0000ff;">select</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> dbseek<span style="color: #000000;">(</span>vestanteria<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span> .and. <span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>->estanteria = vestanteria<br /> aData<span style="color: #000000;">[</span><span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>->profundo<span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>->fila,<span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>->columna<span style="color: #000000;">+1</span><span style="color: #000000;">]</span>:= <span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>->articulo<br /> dbskip<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /> <span style="color: #000000;">(</span>cdestant<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Dbclosearea<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">select</span><span style="color: #000000;">(</span>area<span style="color: #000000;">)</span><br /><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">Dialog</span> oDDATOS <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"FOLDER_VARIOS"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Estanteria : "</span>+alltrim<span style="color: #000000;">(</span>vestanteria<span style="color: #000000;">)</span>+<span style="color: #ff0000;">" -- "</span>+alltrim<span style="color: #000000;">(</span>vdetallestanteria<span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oApp:<span style="color: #000000;">aMod</span><span style="color: #000000;">[</span><span style="color: #000000;">20</span><span style="color: #000000;">]</span>:<span style="color: #000000;">oWnd</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfcliente <span style="color: #0000ff;">Var</span> vfcliente <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfnombre <span style="color: #0000ff;">Var</span> vfnombre <span style="color: #0000ff;">ID</span> <span style="color: #000000;">103</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfarticulo <span style="color: #0000ff;">Var</span> vfarticulo <span style="color: #0000ff;">ID</span> <span style="color: #000000;">104</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfdetalle <span style="color: #0000ff;">Var</span> vfdetalle <span style="color: #0000ff;">ID</span> <span style="color: #000000;">105</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfcantidad <span style="color: #0000ff;">Var</span> vfcantidad <span style="color: #0000ff;">ID</span> <span style="color: #000000;">106</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfpaquetes <span style="color: #0000ff;">Var</span> vfpaquetes <span style="color: #0000ff;">ID</span> <span style="color: #000000;">107</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfcolumna <span style="color: #0000ff;">Var</span> vfcolumna <span style="color: #0000ff;">ID</span> <span style="color: #000000;">108</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvffila <span style="color: #0000ff;">Var</span> vffila <span style="color: #0000ff;">ID</span> <span style="color: #000000;">109</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">get</span> gvfprofundo <span style="color: #0000ff;">Var</span> vfprofundo <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">of</span> oDDATOS <span style="color: #0000ff;">when</span> lsay<br /><br /> <span style="color: #0000ff;">REDEFINE</span> FOLDEREX oFld <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDDATOS <span style="color: #0000ff;">UPDATE</span>;<br /> <span style="color: #0000ff;">PROMPT</span> &vprompt <span style="color: #0000ff;">DIALOGS</span> &vfolders ;<br /> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">change</span> <span style="color: #000000;">(</span>refrescardatos<span style="color: #000000;">(</span>vestanteria,oBrw<span style="color: #000000;">[</span>oFld:<span style="color: #000000;">nOption</span><span style="color: #000000;">]</span>,oFld:<span style="color: #000000;">nOption</span>,vfilas<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">FOR</span> i:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> vprofundo<br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> ;<br /> HEADERS V_Header ;<br /> SIZES V_ColSize ;<br /> DATASOURCE aData<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER FASTEDIT <span style="color: #0000ff;">of</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /><br /> WITH OBJECT oBrw<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">bRClicked</span>:= <span style="color: #000000;">{</span>|| borrararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria,vfilas,oFld<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">{</span>|| buscararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">bKeychar</span> := <span style="color: #000000;">{</span>|nkey| iif<span style="color: #000000;">(</span>nkey=<span style="color: #000000;">13</span> .and. oBrw<span style="color: #000000;">[</span>oFld:<span style="color: #000000;">nOption</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nColSel</span> > <span style="color: #000000;">1</span>,buscararticulo<span style="color: #000000;">(</span>aData,oBrw,oFld:<span style="color: #000000;">nOption</span>,vestanteria<span style="color: #000000;">)</span>,<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">lColChangeNotify</span> := .t.<br /> :<span style="color: #000000;">bChange</span> := <span style="color: #000000;">{</span> |oBrw| refrescardatos<span style="color: #000000;">(</span>vestanteria,oBrw,oFld:<span style="color: #000000;">nOption</span>,vfilas<span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nFreeze</span>:=<span style="color: #000000;">1</span><br /> :<span style="color: #000000;">lFullGrid</span> := .t.<br /><br /> END<br /><br /> AEval<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">[</span> i <span style="color: #000000;">]</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span>|o| o:<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER <span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span> i<br /><br /> </div>[/code:2kttaz8m] |
xbrowse alinear columnas. | Muchas Gracias resulto bien.
Saludos |
xbrowse alinear columnas. | Garbi yo armo asi:
Local aData
LOcal vData:=""
cProductos:=xServer:Query("SELECT * FROM productos")
cProductos:GoTop()
vData:='"aProd"'
cProductos:Skip(1) //Skip
Do While !cProductos:Eof()
vData :=vData +","+ '"aProd"'
cProductos:Skip(1) //Skip
ENDDO
cProductos:End()
? vData
aData := Array( vData )
? aData //aca esta vacio marca error
saludos |
xbrowse alinear columnas. | Vamos a ver si me acuerdo, que ya hace tiempo.
Creo que el error que esta teniendo es que :
aData := Array( vData )
vData es un "literal" no es un numero, fijate que yo asigno vprofundo, que es un numero, es decir lo largo del array, tu deberías asignar el numero de registros, y casi te diria que numero de registros +1 que tienes fuera.
Prueba a ver si fuera eso |
xbrowse and Excel | I wish use the comand oBrowse:ToExcel
but I wish select some columns not all
then when the excel is created the oBrowse must be as I had
any solution please |
xbrowse and Excel | From wiki
<!-- m --><a class="postlink" href="http://wiki.fivetechsoft.com/doku.php?id=fivewin_class_txbrowse">http://wiki.fivetechsoft.com/doku.php?i ... s_txbrowse</a><!-- m -->
[quote:1dqrs0uf]
ToExcel XLS,PDF ( [bProgress], [nGroupBy], [aCols], [lShow], [cPDF], [bPrePDF] ) –> oSheet
Exports contents of the browse to a new Excel Sheet and returns the sheet object.
If Excel is not installed and OpenOffice is installed, the call is transferred to ::ToCalc() using bProgress, nGroupBy and aCols.
Parameters:
1. [bProgress]: By default, progress is shown in tex form on oBrw:oWnd:oMsgBar if exists. If bProgress bar is specified, the same is used with parameters nRowsExported, nTotal
2. [nGroupBy]:If specified, this number indicates the column number of the exported columns. If any columns have totals, the exported sheet is grouped by nGroupBy column and subtotals displayed. For this purpose, Excel’s subtotal method is used so that the results can be used for futher computations.
3. [aCols]: By default, all visible columns are exported in that order. See ::GetVisibleCols(). If aCols is specified, only the specified columns are exported, in that order. aCols is an array of ordinal positions in oBrw:aCols array.
4. [lShow]: Default .T. and shows the result of export. i.e., Excel Sheet or PDF as the case may be.
5. [cPDF]: Optional. Name of PDF file to be exported. If specified, the exported Excel sheet is saved as PDF. This PDF contains table with contents as text for futher use
[/quote:1dqrs0uf] |
xbrowse and Excel | exactly I know this well.
But I had asked for something else
I have a customer table with specific columns
I want to create a file for excel by selecting some columns not all columns of xbrowse
So I select the xbrowse columns from the header and then call the ToExcel() function. and it run ok
[b:20wksxdr]Problem when I return on my xbrowse[/b:20wksxdr] : I no longer have the columns I had before but only the ones I selected.
How do I automatically get back the same configuration that I had before selecting columns for Excel? |
xbrowse and Excel | Silvio,
Maybe this can help you ? I don't know if you allready select the coloms this way.
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=34058&hilit=select+colums+in+xbrowse">viewtopic.php?f=3&t=34058&hilit=select+colums+in+xbrowse</a><!-- l -->
If you put this code after the creation of the exel file, the colums are back.
AEval( oBrw:aCols, { |o| o:lHide := .f. } )
oBrw:refresh() |
xbrowse and Excel | (1) If your program knows which columns are to be exported then you adopt this method.
Assume you want columns 5, 4, 2 to be exported.
[code=fw:2jtxnoz2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, <span style="color: #000000;">{</span> oBrw:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">oCol</span><span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> </div>[/code:2jtxnoz2]
Your xbrowse is not changed at all.
(2) If you want your user to select the columns at runtime to be exported.
Initially save the state of xbrowse as cState := oBrw:SaveState()
After the user selects the columns and calls oBrw:ToExcel(), then call oBrw:RestoreState( cState ) |
xbrowse and Excel | Rao,
I'm Working on your function XbrColSelector( oBrowse )
it can run ok only I modified with
[code=fw:277yzxxl]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><br /><span style="color: #00C800;">function</span> XbrColSelector<span style="color: #000000;">(</span> oBrowse <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /> <span style="color: #00C800;">local</span> aSave := aCopy<span style="color: #000000;">(</span> oBrowse:<span style="color: #000000;">aCols</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> cSaveState:= oBrowse:<span style="color: #000000;">SaveState</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /><br /> @ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE oBrowse:<span style="color: #000000;">aCols</span> ;<br /> COLUMNS <span style="color: #ff0000;">"lHide"</span>, <span style="color: #ff0000;">"cHeader"</span> ;<br /> HEADERS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"Header"</span> ;<br /> COLSIZES <span style="color: #000000;">40</span>, <span style="color: #000000;">100</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">2</span><br /> WITH OBJECT :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> x == <span style="color: #00C800;">nil</span>, !oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">lHide</span>, oBrw:<span style="color: #000000;">aRow</span>:<span style="color: #000000;">lHide</span> := !x <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span><br /> END<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Go to Excel "</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">30</span> FLAT <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oBrowse:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">180</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Return"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">30</span> FLAT <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>oBrowse:<span style="color: #000000;">RestoreState</span><span style="color: #000000;">(</span> cSaveState <span style="color: #000000;">)</span> , oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> oBrowse:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:277yzxxl]
See cSaveState |
xbrowse and Excel | As we explained above, it is not necessary to Hide/Unhide columns for exporting to Excel. You need to have modified my example to suit the present purpose.
Here is the modified function:
[code=fw:3pry5lew]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> ExportToExcel<span style="color: #000000;">(</span> oBrowse <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> aCols := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br /> AEval<span style="color: #000000;">(</span> oBrowse:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span> |o,i| AAdd<span style="color: #000000;">(</span> aCols, <span style="color: #000000;">{</span> !o:<span style="color: #000000;">lHide</span>, i, o:<span style="color: #000000;">cHeader</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br /><br /> @ <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-40</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> DATASOURCE aCols ;<br /> COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span> ;<br /> HEADERS <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"No"</span>, <span style="color: #ff0000;">"Header"</span> ;<br /> COLSIZES <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">100</span> ;<br /> CELL LINES NOBORDER<br /><br /> WITH OBJECT oBrw<br /> :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> WITH OBJECT :<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, .t. <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span><br /> END<br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"ToExcel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">30</span> FLAT <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> aCols := <span style="color: #000000;">{</span><span style="color: #000000;">}</span>, ;<br /> AEval<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">{</span> |a| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, AAdd<span style="color: #000000;">(</span> aCols, oBrowse:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span>, ;<br /> oBrowse:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, aCols <span style="color: #000000;">)</span> ;<br /> <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">180</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Close"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">30</span> FLAT <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">370</span>,<span style="color: #000000;">020</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Ctrl-Up/Ctrl-Dn to Swap Rows Up/Down"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">260</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">CENTER</span> VCENTER <span style="color: #0000ff;">COLOR</span> CLR_HRED, oDlg:<span style="color: #000000;">nClrPane</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3pry5lew]
User can select which columns are to be exported and also the order in which they are to be exported. |
xbrowse and Excel | thanks |
xbrowse and Excel | Mr. Rao,
Could you please find some time to enhance this function with a save/restore button where the state off a selected colums is saved?
This would be a great tool for setup new xbrowses when develloping. We could open all columns, select some and some more and finaly we could code the needed colums.
Thanks in advance. |
xbrowse and Index | I made a test to index a dbf .
I insert a xbrowse in a window
I have abuttonbar on this window
I press the first button of buttonbar to index the dbf
it cal Index( .t.,obrw)
it make error dbskipper
some can help me
thanks
I insert the test source on this address : <!-- w --><a class="postlink" href="http://www.vdswin.it/testindex.rar">www.vdswin.it/testindex.rar</a><!-- w --> |
xbrowse and Tree | Hi everyone;
I'm new to trees inside xbrowse.
I intend to display a tree using xbrowse and allow the user to change the tree (branches and leafs) at any time (although based on the same data), therefore I would need to change the tree being viewed on the xbrowse. Is this possible?
In other words, have a tree where the branches are dates and the leafs are individual transactions for that date, but then allow the user to change the view to a tree where the branches are department codes and the leafs are individual transactions for that department. All based on the same table.
Again, I'm new to trees inside an xbrowse. Any idea will be appreciated.
Thank you,
Reinaldo. |
xbrowse and Tree | Possible.
We need to make two trees. We may start the browse with Dates tree. When user wants to switch over just oBrw:oTree := oBranchTree ( also need to set oTreeItem). Keep switching the two trees like this.
Main task is to make a tree. How do we make it depends on (1) tree with subtotals or not (2) how dynamic the data is and (3) how large the data is.
Showing subtotals gets a bit complex when the data is dynamic and large. Need to consider speed implications.
If you can describe your requirement in greater detail, preferably with sample data structure with a few essential fields and sample data of say 10 to 20 transactions, we can provide clearer advice.
Also, please indicate the FWH version you are using. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.