topic
stringlengths
1
63
text
stringlengths
1
577k
xbrowse to excel
Prova a eseguire FWNumFormat( 'E', .t. ) all'inizio del programma, dovrebbe cambiare la formattazione standard usata anche per Excel.
xbrowse to excel
Grazie, ho provato ma a funzione: FWNumFormat( 'E', .t. ) non e' riconosciuta e comunque ho provato a manomettere la classe xbrowse.prg, senza risultato !! Peccato ! Romeo
xbrowse to excel
Ciao così funziona: @130,5 xBROWSE oLBX1 OF oDlg1 SIZE 390,170 ON DBLCLICK (varturno()); UPDATE pixel FONT fntArial NOBORDER ---- ADD COLUMN TO oLBX1 DATA gio2n ; HEADER "Lu." SIZE 40 PICTURE "@E 9.99" --- oLBX1:lExcelCellWise := .t. olbx1:CreateFromCode() saluti Stefano
xbrowse to excel
Friends, you can export the color of the cell ? [url:16798t72]https://app.box.com/s/qiztvzp01pphou3u83so[/url:16798t72] [img:16798t72]https://app.box.com/s/qiztvzp01pphou3u83so[/img:16798t72] Grazie Stefano
xbrowse to excel
Possible, but we have not provided that feature. You may need to modify xbrowse method ToExcel. oSheet:Cells( r, c ):Interior:ColorIndex := <your background color> oSheet:Cells( r, c ):Font:ColorIndex := <text color index> You should also convert our color constants to Excel color index values.
xbrowse to excel
Grazie, ma non mi funziona lo stesso. Mi da l'errore e dice che: oLBX1:lExcelCellWise .... non lo trova Io ho la versione di FWH 8.10, forse e' un po vecchia ? Help
xbrowse to excel
FW e Xbrowse sono cambiati parecchio dal 2010 ad oggi, ci sono parecchie novità . Io ho approfittato dell'offerta (agg. 150,00 di alcuni mesi fa) prova a chiedere ad Antonio ... Ciao Stefano
xbrowse to excel
IN XBROWSE C'è UN ERRORE CHE ANCORA NON è STATO CORRETTO IO USO QUESTA FUNZIONE HA BISOGNO DELLA CLASSE FILEXLS [code=fw:2ykgovj6]<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;">"FileXLS.ch"</span><br /><br /><span style="color: #00C800;">function</span> ExportXLS<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">Local</span> oXLS, nCol, nFormat, nFormat2, nFont, nLen, nCol, nFila, x, cText<br /><br />&nbsp; &nbsp;XLS oXLS FILE <span style="color: #ff0000;">".<span style="color: #000000;">\f</span>ile.xls"</span> AUTOEXEC<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> XLS FORMAT nFormat <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">'#,##0.00'</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> XLS FORMAT nFormat2 <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">'#0'</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> XLS <span style="color: #0000ff;">FONT</span> nFont1 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> HEIGHT <span style="color: #000000;">16</span> BOLD<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> XLS <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"MI XLS BROWSE"</span> <span style="color: #0000ff;">FONT</span> nfont1 <span style="color: #0000ff;">OF</span> oXls &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">1</span>,<span style="color: #000000;">8</span> XLS <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Fecha:"</span> + DTOC<span style="color: #000000;">&#40;</span> Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">OF</span> oXls &nbsp; <br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// CABECERAS</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nCol &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nFila := <span style="color: #000000;">3</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> x := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> &nbsp;<span style="color: #B900B9;">// Si la columna no es oculta</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cValor := oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XLS COL nCol WIDTH oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nDataLen</span> <span style="color: #0000ff;">OF</span> oXLS<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @ nFila,nCol XLS <span style="color: #0000ff;">SAY</span> cvalor BORDER <span style="color: #0000ff;">OF</span> oXls &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nCol++ &nbsp;<span style="color: #B900B9;">// Las columnas solo las que estan visibles</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;nCol &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp;nFila++ &nbsp; <span style="color: #B900B9;">// Una fila despues del Header</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// DATOS</span><br />&nbsp; &nbsp; &nbsp; &nbsp; DbSelectArea<span style="color: #000000;">&#40;</span> oDbf:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oDbf:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">while</span> !oDbf:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> x := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> !oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lHide</span> &nbsp;<span style="color: #B900B9;">// Si la columna no es oculta</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cText := oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"N"</span> <span style="color: #B900B9;">// Si es numeric</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nDataDec</span> = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@ nFila, nCol XLS <span style="color: #0000ff;">SAY</span> cText FORMAT nFormat2 <span style="color: #0000ff;">OF</span> oXls<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@ nFila, nCol XLS <span style="color: #0000ff;">SAY</span> cText FORMAT nFormat <span style="color: #0000ff;">OF</span> oXls<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">/* else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@ nFila, nCol XLS SAY OemToAnsi( cText ) &nbsp;OF oXls*/</span><br /><br />elseif Valtype<span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"U"</span><br />@ nFila, nCol XLS <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Cargo</span> <span style="color: #0000ff;">OF</span> oXls<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nCol++ &nbsp;<span style="color: #B900B9;">// Las columnas solo las que estan visibles</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nFila++<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCol := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oDbf:<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; end <span style="color: #00C800;">While</span><br /><br />&nbsp; &nbsp;ENDXLS oXLS<br />&nbsp;</div>[/code:2ykgovj6]
xbrowse to excel field date
hi, I have a xbrowse with: -------------------------------------------------------------- code description date -------------------------------------------------------------- aaa door 11/07/2020 bbb book 31/07/2020 ... date format is dd/mm/yyyy when I use xbrowse:toexcel function and get my excel file("it" language) field date is in text format and not in date format, how can I to get date field in date format in excel? thanks
xbrowse to excel field date
Does xbrowse know that column 3 is a date? How did you define columns in xbrowse?
xbrowse to excel field date
hi Mr Rao column date comes from a ado object. it read a Db2 table from as400. in the sql select column date is a date field SELECT code, description, date... code and description are varchar and date is date field. thank you.
xbrowse to excel field date
After reading the recordset, can you please do this simple test? [code=fw:jhq6rws4]<div class="fw" id="{CB}" style="font-family: monospace;"><br />? oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"date"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Type</span><br />? ValType<span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"date"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:jhq6rws4]
xbrowse to excel field date
thank you mr Rao, field was char from select.
xbrowse to excel office 2010
Hello oBrw:lExcelCellwise := .t. OBRW:TOEXCEL() makes the computer hang , This occurs since i updated to fwh 11.04 Using office 2010 Anyone else experiencing this ? Thanks for the help PS : resetting back my xbrowse.prg from fwh 10.10 (previous version i used) , it works as expected
xbrowse to excel office 2010
May I know what version of Harbour / XHarbour (Free) / xHb commecial and the compiler are you using please? Specifically, are you using xharbour commercial?
xbrowse to excel office 2010
I am using bcc 5.82 and xharbour from fivetech version 1.2.1
xbrowse to excel office 2010
Can you please try this simple program and post the result here? [code=fw:2mbk9xu3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oExcel<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Before ExcelObj()'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oExcel &nbsp; := ExcelObj<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// is the program hanging here?</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'After ExcelObj()'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> oExcel <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'ValType of Object'</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span></div>[/code:2mbk9xu3] Let us see if the program is hanging at this function call. Note: I have only Office2007. Request you to help testing on Office2010
xbrowse to excel office 2010
Dear Mr. Rao, your code is working fine here. Richard, please have a look to: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=18483&p=96817&hilit=office#p96817">viewtopic.php?f=3&t=18483&p=96817&hilit=office#p96817</a><!-- l --> Did you install Office as usual or did you use the Click-to-Run option? Best regards, Otto
xbrowse to excel office 2010
Mr Rao,    msginfo( 'Before ExcelObj()' )    oExcel   := ExcelObj()  // is the program hanging here? yes it is hanging here If i can help further, let me know I have put back my xbrowse.prg from fwh 10.10 and everything works as expected Otto I have complete office 2010 professional, and the problem occured when i upgraded from fwh 10.10 to 11.04 Richard
xbrowse to excel office 2010
This is working fine for Mr.Otto but not for you. The problem is not because of the version of Office. Please open \fwh\source\function\olefuncs.prg. First function is GetOleObject( cApp ) [code=fw:1fgiw762]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> GetOleObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oObj<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; oObj &nbsp;:= GetActiveObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CATCH<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oObj &nbsp;:= CreateObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; CATCH<br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;END<br /><br /><span style="color: #00C800;">return</span> oObj<br />&nbsp;</div>[/code:1fgiw762] This function is reported to hanging with xHarbour commerical. Probably it may be hanging with your version of xHarbour too. Please try substituing the function with the following function [code=fw:1fgiw762]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> GetOleObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oObj<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; oObj &nbsp;:= TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CATCH<br />&nbsp; &nbsp;END<br /><br /><span style="color: #00C800;">return</span> oObj<br />&nbsp;</div>[/code:1fgiw762] Compile the program and link the object file with your above sample code. Please let us know if the sample program is working or still hanging. This work around solved the problem for some users.
xbrowse to excel office 2010
It works ok with these changes I do not update to xharbour's actual version because there is a bug with "copy to" and my application uses this syntax in some cases Thanks for your help,
xbrowse to excel office 2010
Good to know. Can you still help me more? It is desirable to know where exactly the code is hanging, so that we can think of a solution that works for all. Can you substitute GetOleObject() function with this modification and see where it is failing or hanging? [code=fw:3du1tq97]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> GetOleObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oObj<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Before GetActiveObject'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oObj &nbsp;:= GetActiveObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'GetActiveObject() succeeded'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CATCH<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'GetActiveObject() failed'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oObj == <span style="color: #00C800;">nil</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Before CreateObject()'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oObj &nbsp;:= CreateObject<span style="color: #000000;">&#40;</span> cApp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'CreateObj() succeeded'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; CATCH<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'CreateObj() failed'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;endf<br /><br /><span style="color: #00C800;">return</span> oObj<br />&nbsp;</div>[/code:3du1tq97] Once please test after booting computer. Second time, first open Excel normally and then run the program while excel is still running. I would be glad if you can post the test results.
xbrowse to excel office 2010
Mr Rao in both cases only one message, the very first one Before GetActiveObject It is displayed for ever , like in an endless loop , i have to stop the program from the task manager Hth Regards,
xbrowse to excel problem (numeric field with decimal)
I have a problem using Xbrowse class. When i got an EXCEL files from DBF with numeric field AND decimal. The problem is that in the excel files i got "." instead of "," and then i cannot use thi cell of excel for calculation. I tried to modify parametr of xbrowse class, but i am not able to resolve the problem. Please SEE the below minimal example: I am using FWH80 Tks Romeo/Zingoni **************************** * * testxbr.prg * #include "FiveWin.Ch" #include "XBrowse.Ch" * function main() local aDbf,oWnd, oBrw, oCol, oBrush, cAlias := cGetNewAlias( "CUST" ) aDbf := {} AADD(aDbf,{ "NOME", "C", 25, 0 }) AADD(aDbf,{ "SALARIO1", "N", 9,0}) AADD(aDbf,{ "SALARIO2", "N", 9,2}) DBCREATE("CUSTO", aDbf) USE CUSTO NEW ALIAS (cAlias) APPE BLANK REPLACE nome with "Rossi Mario",salario1 with 1234,salario2 with 1234.56 DEFINE dialog ownd TITLE "Test" FROM 0,0 TO 24,80 @ 0,0 XBROWSE oBrw OF ownd ALIAS cAlias ; SIZE 200,100 ; FOOTERS FASTEDIT LINES CELL oBrw:bClrRowFocus := oBrw:bClrSelFocus oBrw:CreateFromCode() oWnd:oClient := oBrw @9 ,1 button "To Excel" ACTION oBrw:ToExcel() of ownd ACTIVATE dialog oWnd ON INIT oBrw:SetFocus() CENTERED return nil * *** fine esempio *
xbrowse to excel problem (numeric field with decimal)
Any help ???????? Tks
xbrowse to excel problem (numeric field with decimal)
Please try to set: oBrw:lExcelCellWise := .t. Can u please let us know if the problem is solved with this setting?
xbrowse toExcel need help export bitmap column type
hello, friends. i have this code. [code=fw:832grczx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> IIf<span style="color: #000000;">&#40;</span> CLIE->ACTIVO, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>          <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Act"</span>         <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">030</span> BITMAP IN <span style="color: #ff0000;">"BMS_BGREEN"</span>, <span style="color: #ff0000;">"BMS_BPINK"</span>  <span style="color: #0000ff;">CENTER</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CLIE->NUM_CLIE                     <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Nº Cliente*"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">096</span> ORDER <span style="color: #ff0000;">"NUM_CLIE"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@L 999999"</span> <span style="color: #0000ff;">CENTER</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CLIE->NOMBRE                       <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Nombre*"</span>     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">270</span> ORDER <span style="color: #ff0000;">"NOMBRE"</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CLIE->CEDULA                       <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Cédula*"</span>     <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span> ORDER <span style="color: #ff0000;">"CEDULA"</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CIUD->NOMBRE                       <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Ciudad"</span>      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">130</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> RUTA->NOMBRE                       <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Ruta cobro"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span><br />   ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> IIf<span style="color: #000000;">&#40;</span> !Empty<span style="color: #000000;">&#40;</span> CLIE->NOTAS <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Nota"</span>        <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">034</span> BITMAP IN <span style="color: #ff0000;">"BMS_POSTIT"</span><br /> </div>[/code:832grczx] when i try export to excel using the method toexcel the column 1 and 7, no show any data. ok, both columns are bitmap type, but exist any form to assing another data (logical for example). i have an idea. using the tag data of txbrowse column object oBrw:aCols[1]:Tag = "CLIE->ACTIVE" /*---------------------> To Excel ( 'True' or 'False' ) and the toexcel method use the tag data when export column is bitmap type. y try modify the code but is complex for my. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> sorry for my bad english. salu2
xbrowse toExcel need help export bitmap column type
Instead of [code=fw:3vve43dp]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> IIf<span style="color: #000000;">&#40;</span> CLIE->ACTIVO, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Act"</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">030</span> BITMAP IN <span style="color: #ff0000;">"BMS_BGREEN"</span>, <span style="color: #ff0000;">"BMS_BPINK"</span> &nbsp;<span style="color: #0000ff;">CENTER</span><br />&nbsp;</div>[/code:3vve43dp] Use this code [code=fw:3vve43dp]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ADD <span style="color: #0000ff;">TO</span> oBrw <span style="color: #00C800;">DATA</span> CLIE->ACTIVO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Act"</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">030</span><br />oBrw:<span style="color: #000000;">Act</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"BMS_BGREEN"</span>, <span style="color: #ff0000;">"BMS_BPINK"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3vve43dp] No need to change any code in XBrowse.
xbrowse toExcel need help export bitmap column type
thank you, rao, this work. salu2
xbrowse toexcel() img(jpg) field error: oSheet:Paste()
Hi, oCol := obrow:AddCol() oCol:bStrData := { ||cpath1+"\sub\"+cvaltochar(odb2:imgid)+".jpg"} oCol:cHeader := "img" ocol:cdatatype:="F" METHOD ToExcel( oSheet, nRow, nCol ) CLASS TXBrwColumn oSheet:Paste() (DOS Error -2147352567) WINOLE/1007 Argument error: PASTE Best regard! Shuming Wang
xbrowse toexcel() img(jpg) field error: oSheet:Paste()
Please try oCol:bEditValue := { ||cpath1+"\sub\"+cvaltochar(odb2:imgid)+".jpg"} Please note use of bStrData in the application program is deprecated since long.
xbrowse too slow
on an archive lotto.dbf I'm using tdatabase I have 57 field I have 6130 records for 733KB I index on dts(data)+concorso [img:1m3e48ur]https&#58;//i&#46;postimg&#46;cc/mk2rByP7/jjjjjjjj&#46;png[/img:1m3e48ur] and xbrowse is too too slow do you have try with big dbf ? I use Multiheader perhaps it is slow ?
xbrowse too slow
Turn off buffering. oDBF:lBuffer:=.f.
xbrowse too slow
it'a tdata or tdatabase set ?
xbrowse too slow
Works with both.
xbrowse too slow
I guess I wasn't clear. oDbf:setBuffer(.F.) Works. Did you try it?
xbrowse too slow
not run good I see all same records where I must insert it ?
xbrowse too slow
Anywhere before the browse. I don't know what you mean by "I see all the same records." Are you using a filter?
xbrowse too slow
no I see the same records I have 6135 record but if I set that command I see only one record * 6135 records Imust see perhaps I insert it after the xbrowse
xbrowse too slow
[quote:qeagld9z]one record * 6135 records[/quote:qeagld9z] I don't understand. Do you mean you see the same record repeated 6135 times?
xbrowse too slow
[img:1lublxlz]https&#58;//i&#46;postimg&#46;cc/5tjBzX0G/yes&#46;png[/img:1lublxlz] [b:1lublxlz] I put it after I open the archive[/b:1lublxlz]
xbrowse too slow
Are you loading the database into an array or something? Turning off the buffer should have no effect on the display other than speeding it up.
xbrowse too slow
oLotto:= TDatabase():Open( , cDir+"Lotto", "DBFCDX", .T. ) oLotto:setorder(nOrder) oLotto:gotop() oLotto:lbuffer:=.f.
xbrowse too slow
Did you do: oBrw:setoDbf(oLotto) Without that the database doesn't skip to the next record.
xbrowse too slow
nages sad me to erase this command
xbrowse too slow
I don't know why. Put it back in and try it.
xbrowse too slow
Application =========== Path and name: C:\Work\Prg\lotto\SuperLotto.Exe (32 bits) Size: 8,185,856 bytes Compiler version: Harbour 3.2.0dev (r1904111533) FiveWin version: FWH 19.05 C compiler version: Borland/Embarcadero C++ 7.0 (32-bit) Windows version: 6.2, Build 9200 Time from start: 0 hours 0 mins 24 secs Error occurred at: 18-09-2019, 10:05:37 Error description: Error BASE/1004 Message not found: TXBROWSE:SETTODBF Stack Calls =========== Called from: .\source\function\HARBOUR.PRG => _CLSSETERROR( 247 ) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETTODBF( 10879 ) Called from: source\PLotto.prg => ESTRATTI( 151 )
xbrowse too slow
It is not settodbf(). There is only one T.
xbrowse too slow
sorry I see the same [b:3lx5s0qx]Please see it [/b:3lx5s0qx] [img:3lx5s0qx]https&#58;//s0&#46;gifyu&#46;com/images/error_james45a386436492240f&#46;gif[/img:3lx5s0qx]
xbrowse too slow
Silvio, Well, I see in your source that you are using the XBrowse definition clause "DATASOURCE" which I have never seen before. Apparently this does the same thing that oBrw:SetoDBF() does, so you don't need that. Take it back out. I also see that in your first post, the database was skipping as it should. Turning off the buffer should not affect skipping the records, so I am guessing that this is a TDatabase bug. I suggest you contact Nages about it.
xbrowse too slow
Silvio, OK, I did some testing and I have found that the browse reads the buffer, so if you turn the buffer off, you always get the last read record which is the one last read before the buffer was turned off (the first record). I remember being able to turn off the buffer some time ago, but perhaps it was only when using the database directly instead of a database object.
xbrowse too slow
Ok, my mistake. I was right AND I was wrong. You can turn off buffering, but not by changing the class variable lBuffer directly. You must do it this way: oDBF:setBuffer(.F.) Technically, lBuffer should be a hidden variable that cannot be changed by the programmer. OOP languages like Smalltalk, do not allow any class variables to be changed directly, you must do it using a method. And this is why.
xbrowse too slow
[quote="James Bott":28eihd0r]Silvio, I also see that in your first post, the database was skipping as it should. Turning off the buffer should not affect skipping the records, so I am guessing that this is a TDatabase bug. I suggest you contact Nages about it.[/quote:28eihd0r] I tried also with tdata it's the same
xbrowse too slow
[code=fw:8es3u31b]<div class="fw" id="{CB}" style="font-family: monospace;">oLotto:= TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , cDir+<span style="color: #ff0000;">"Lotto"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />oLotto:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span>nOrder<span style="color: #000000;">&#41;</span><br />oLotto:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:8es3u31b] You should [b:8es3u31b]not[/b:8es3u31b] be opening a database this way. You should always use a class. This encapsulates the opening into one place so if you want to change the database filename (including path), the current index, sharing, original set order, etc., you only have to change it in one place. This reduces the chance of bugs, makes writing code using the class easier, etc. oLotto := TLotto():New() Short, and easy to read. [b:8es3u31b]Write each piece of code only once.[/b:8es3u31b]
xbrowse too slow
[quote="James Bott":2x0abql2][code=fw:2x0abql2]<div class="fw" id="{CB}" style="font-family: monospace;">oLotto:= TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> , cDir+<span style="color: #ff0000;">"Lotto"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br />oLotto:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span>nOrder<span style="color: #000000;">&#41;</span><br />oLotto:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:2x0abql2] You should [b:2x0abql2]not[/b:2x0abql2] be opening a database this way. You should always use a class. This encapsulates the opening into one place so if you want to change the database filename (including path), the current index, sharing, original set order, etc., you only have to change it in one place. This reduces the chance of bugs, makes writing code using the class easier, etc. oLotto := TLotto():New() Short, and easy to read. [b:2x0abql2]Write each piece of code only once.[/b:2x0abql2][/quote:2x0abql2] I know it on gif you can see is a tdatabase version on this app I use only two archives I tried also with [b:2x0abql2]your tdata[/b:2x0abql2] and I set before the archive as you teach me with [code=fw:2x0abql2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">CLASS</span> TXData <span style="color: #0000ff;">from</span> TNextID<br />   <span style="color: #B900B9;">//DATA cPath init cFilePath(GetModuleFileName( GetInstance() ))  + "Data\"  </span><br />  <span style="color: #00C800;">DATA</span> cPath <span style="color: #0000ff;">init</span> oApp:<span style="color: #000000;">cDbfPath</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">CLASS</span> TLotto <span style="color: #0000ff;">from</span> TXData<br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> lShared <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TLotto<br />   <span style="color: #00C800;">Default</span> lShared := .t.<br />   ::<span style="color: #00C800;">super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>,::<span style="color: #000000;">cPath</span> + <span style="color: #ff0000;">"Lotto"</span> ,, lShared<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">use</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">setOrder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /> </div>[/code:2x0abql2] and the I open the archive with [code=fw:2x0abql2]<div class="fw" id="{CB}" style="font-family: monospace;">oLotto :=TLotto:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oLotto:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /> oLotto:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:2x0abql2] seems to be really slow: - when I scroll through all the records or by pages - when I go to print a record and refresh the xbrowse (doing also setfocus) - when I insert a record and return to xbrowse (refresh and setfocus) maybe it's my impression can I send you the archive?
xbrowse too slow
[quote:16ye64iz]seems to be really slow: - when I scroll through all the records or by pages[/quote:16ye64iz] Are you now using oLotto:setBuffer(.F.)? [quote:16ye64iz]- when I go to print a record and refresh the xbrowse (doing also setfocus)[/quote:16ye64iz] Why are you refreshing the browse after printing? [quote:16ye64iz]- when I insert a record and return to xbrowse (refresh and setfocus)[/quote:16ye64iz] This should take just a second or less. Yes, send me your code.
xbrowse too slow
I just tested a database of 26,000 records. With, or without, buffering it is quite fast--about 1 full screen per second (on a local drive). If yours is slower, it is due to other routines you are calling from TXBrowse, not TXBrowse itself. I'm not sure why anyone would want to browse a large database anyway. Filters and/or searches would much faster.
xbrowse too slow
[quote="James Bott":k0ns30yg] If yours is slower, it is due to other routines you are calling from TXBrowse, not TXBrowse itself. I'm not sure why anyone would want to browse a large database anyway. Filters and/or searches would much faster.[/quote:k0ns30yg] I'm not even calling routines see on your email I send you also the big dbf certainly I will use filters for searches but the problem in addition to scrolling through the archive, when I insert or when I print later in the cooling takes a while it's is alottery numbers from 1939 year to our days
xbrowse too slow
Silvio, OK, I got your code (or partial code), and I can confirm that it is not the xbrowse that is slowing things down, it is all your other code. In order to find which section or sections are slowing it down the most, you need to log the elapsed time it takes to run each section of code. Then for the slowest code, you have to either decide to eliminate it or reprogram it another faster way. You might also consider that you are giving the user way too much data. It appears that you are showing 52 columns on just the first folder. 52 fields times 6135 records is 319,020 pieces of information. How does anyone evaluate 319,020 pieces of information in their head? Generally, we try to reduce the amount of information that a user manipulates, not just give them everything. Many years ago, one of my first clients was a wholesaler. He asked me for a printout of all the sales for the day. I told him that would be about 100 pages, then I asked what did he want it for? He said he wanted to find the best and worst selling items. So, I recommended a report just showing the 15 best and 15 worst selling items, and that would be a one page report. He loved it. [His company grew so much in the next five years, that he sold out and retired]. Maybe you should re-think the design of your software.
xbrowse too slow
[quote:3i3qzq5x]but the problem in addition to scrolling through the archive, when I insert or when I print later in the cooling takes a while[/quote:3i3qzq5x] I assume by "insert" you mean add? I don't understand why this would affect the current browse at all. Unless you are jumping to the newly added record, which would then only have to display one screenful of data. Also, I don't see why printing would have any effect on the browse. You print from another routine and then return to the same browse that you were already looking at. No refresh of the browse required.
xbrowse too slow
[quote:qth7e4cm] it is all your other code[/quote:qth7e4cm] I don't understand what you're talking about&#058; [img:qth7e4cm]https&#58;//i&#46;postimg&#46;cc/L8ckPBPj/f&#46;jpg[/img:qth7e4cm] as you can see I have a main window [b:qth7e4cm]oWndMain[/b:qth7e4cm] on which I create a dialog [b:qth7e4cm]oApp (): oDlg [/b:qth7e4cm]which is made with .nor. 4 On this oApp (): oDlg on the left I create an explorerbar control [b:qth7e4cm]oExBar[/b:qth7e4cm] for a menu and on the right the xbrowse control [b:qth7e4cm]oApp():oGrid[/b:qth7e4cm] and under xbrowse I insert a tab control. oApp():otab What code are you talking about? [quote:qth7e4cm]Then for the slowest code, you have to either decide to eliminate it or reprogram it another faster way.[/quote:qth7e4cm] Dialog ? Explorerbar ? Tab? Xbrowse ? wich one ? I not have any other controls and codes [quote:qth7e4cm]You might also consider that you are giving the user way too much data. It appears that you are showing 52 columns on just the first folder. 52 fields times 6135 records is 319,020 pieces of information. How does anyone evaluate 319,020 pieces of information in their head? Generally, we try to reduce the amount of information that a user manipulates, not just give them everything.[/quote:qth7e4cm] [quote:qth7e4cm]Many years ago, one of my first clients was a wholesaler. He asked me for a printout of all the sales for the day. I told him that would be about 100 pages, then I asked what did he want it for? He said he wanted to find the best and worst selling items. So, I recommended a report just showing the 15 best and 15 worst selling items, and that would be a one page report. He loved it. [His company grew so much in the next five years, that he sold out and retired].[/quote:qth7e4cm] here we are not talking about articles nor wholesaler we do not say nonsense [quote:qth7e4cm]Maybe you should re-think the design of your software.[/quote:qth7e4cm] so you told me when from November 2018 I had to convert the program of the beaches: you made me change the whole program, you made me change all the archives then at the last I didn't know how to go on because I needed some particular and necessary information saved in fields that no longer existed and that you made me take away because in your opinion they were useless. You even criticized the system of tariffs, that is to say that the prices of umbrellas / sector and services were too big to create. You made me change the whole program coming to Psqua 2019 that I still hadn't finished the program and I hadn't solved anything. With your ideas I risked being beaten and lost a lot of money [quote:qth7e4cm]You print from another routine and then return to the same browse that you were already looking at. No refresh of the browse require[/quote:qth7e4cm] Don't say nonsense. I don't print from another routine I call the press from the explorerbar menu, I print and then refresh the xbrowse as I've always done I am curious to see how your application are made and try it on my computer, perhaps lacking in aesthetics like the one your friend Tim showed me, it is likely that in America you sell these types of programs like asses but in Italy you would not have sold an application. ....perhaps in Italy they are smarter or more demanding
xbrowse too slow
Apparently, you took my writing completely wrong. I was just pointing out that the browse itself is not slow. It takes only about 10 lines of code to create a browse, and regardless of the size of the database the browse displays a new screen in about a second (when you press the [Pg Dn] key). Is yours taking longer than a second? When I said it must be “your” other code, perhaps I should have said “the” other code. I mean that it could be the tabs, dialog, or Explorer bar that is affecting the speed or the perceived speed. Unless, perhaps, you meant that one second is “slow?” [quote:2flo19v3]You print from another routine and then return to the same browse that you were already looking at. No refresh of the browse required -James[/quote:2flo19v3] [quote:2flo19v3]Don't say nonsense. I don't print from another routine I call the press from the explorerbar menu, I print and then refresh the xbrowse as I've always done –Silvio[/quote:2flo19v3] Apparently you are doing the exactly what I said, calling the print routine from a button. The printing routine has nothing to do with the browse speed. However, the printing could take some time and if the user is waiting for it to complete, then the browse screen will be inactive while the printing is going on. This is not the fault of the browse, yet users will probably think it is. One solution is to display on the screen something indicating that printing is going on. This could be as simple as changing the cursor to the hourglass icon while printing. Question, is it you or your customers, that are saying the browse is too slow? [quote:2flo19v3]here we are not talking about articles nor wholesaler we do not say nonsense -Silvio[/quote:2flo19v3] I only mentioned that story to illustrate how less data can provide more information. This is definitely not “nonsense.” That wholesaler sold out to Whole Foods (net sales in 2017, 16 billion dollars), and Whole Foods was then purchased by Amazon. That all started with my software and the concept of providing less information which vastly increased sales. My point was that less is more. If your browse system is really too slow, then maybe you should consider exploring other options, such as only showing certain records, and/or fields, in the browse, instead of all records and all fields. I am just trying to point out other things that may contribute to the browse being slower than it normally would be. Some things, like printing, may be interpreted by users as the “browse is too slow” when actually it has nothing to do with the browse. If a simple browse (with no other code) is considered as too slow, then you have very limited options, maybe browse an array, add more RAM, get a faster CPU, and/or use a solid state drive. Or, just live with it. If the browse with the Explorer bar, tabs and dialog is too slow, then you could consider a different design to increase the speed. I am merely pointing out some issues that may be contributing factors with the speed or perceived speed issue.
xbrowse tool ( uwe )
Uwe I have been out of the FW community for quite some time so forgive me for asking if you have developed a xBrowse tool ? Thanks Rick Lipkin
xbrowse tool ( uwe )
Rick, You can Download from here : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/Brwtools5.zip">http://www.pflegeplus.com/fw_downloads/Brwtools5.zip</a><!-- m --> I' working on a Update : Added Multiline Headers, Cell Images and some more functions. But for the Moment, I'm still busy on the SButton-Tools including a complete Button-editor. After it is finished, I will carry on with the Update. The new Button-Painter ( SB-Buttons ) makes it possible, to create any Button You like. Show Button-Group on any Background, Set Size, Font and define Space between Buttons. Supports up to 3 Button-Textlines and 4 Button-Images. All predefined Styles : Crystal, W95, OFFICE, ROUND .... ) [img:3hzndxko]http&#58;//www&#46;pflegeplus&#46;com/pictures/newbt1&#46;jpg[/img:3hzndxko] Using adjusted JPG-Images : [img:3hzndxko]http&#58;//www&#46;pflegeplus&#46;com/pictures/newbt2&#46;jpg[/img:3hzndxko] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse tool ( uwe )
Thanks .. Rick
xbrowse trasparent
Dear nageswarao gunupudi , have you found an solution ?
xbrowse tree Help
I have abn dbf with two fields ( I must use this dbf for dewey catalog of Book ) dewey Cr 8 DEWDESCR cr 60 on dewey field I have a code sample 333.79 as you can see on this picture [img:28nwsv5c]http&#58;//www&#46;iispascalcomiforti&#46;it/wp-content/uploads/2017/01/dew&#46;jpg[/img:28nwsv5c] the master category must be 000 Generalità 100 Filosofia e psicologia 200 Religione 300 Scienze sociali 400 Linguaggio 500 Scienze naturali e matematica 600 Tecnologia (Scienze applicate) 700 Le arti 800 Letteratura e retorica 900 Geografia e storia how I can to create a xbrowse tree please I tried this small test but not run [code=fw:28nwsv5c]<div class="fw" id="{CB}" style="font-family: monospace;"><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 />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBrw<br />   <span style="color: #00C800;">local</span> oTree<br /><br /><br />   oTree    := MakeTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><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;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">350</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE oTree CELL LINES NOBORDER<br /><br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> FWDArrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, FwRArrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\1</span>6x16<span style="color: #000000;">\n</span>ew2.bmp"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">nStretchCol</span>  := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   oTree:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MakeTree<br /><br />&nbsp; &nbsp;field DEWEY,DEWDESCR<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oTree, n<br /><br />&nbsp; &nbsp;USE DEWEY <span style="color: #00C800;">NEW</span> SHARED<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>DEWEY<span style="color: #000000;">&#41;</span> TAG DEWEY <span style="color: #0000ff;">TO</span> TMP MEMORY<br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;TREE oTree<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n &nbsp; &nbsp; := DEWEY<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TREEITEM <span style="color: #000000;">&#40;</span>n<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" - "</span>+DEWDESCR<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TREE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> DEWEY = n .and. ! eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TREEITEM DEWDESCR<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SKIP<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ENDTREE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp;ENDTREE<br /><br />&nbsp; &nbsp;oTree:<span style="color: #000000;">OpenAll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> oTree<br /><br /><br /><br /><br /> </div>[/code:28nwsv5c]
xbrowse tree Help
any solution please ?
xbrowse tree Help
pls Mr Nages can you help me . thanks
xbrowse tree Help
Mr Silvio Please wait But I remember providing solutions to you on similar requirements earlier too in the forums. I will provide solution now also, but please wait.
xbrowse tree Help
Sorry Mr Rao But I not remember it I used that archive with tree normal (not fwh) on fwh tre I have some problems and I decide to use xbrowse to show it because there are many records into
xbrowse tree ayuda (SOLUCIONADO)
Buenas tardes amigos del foro estoy iniciandome con xbrowse tree lo hago directamente con la base de datos y necesito cargarlo de acuerdo a una fecha la misma que puede ir variando y voy refrescando el Browse pero cuando cambio la fecha y mando a buscar y refrescar me crea dos columnas con el tritulo item las mismas que estan repetidas , la primera imagen es como sale al iniciar el browse y la segunda como cambia al mandar buscar. <!-- m --><a class="postlink" href="http://img829.imageshack.us/i/imagen1a.png/">http://img829.imageshack.us/i/imagen1a.png/</a><!-- m --> <!-- m --><a class="postlink" href="http://img843.imageshack.us/i/imagen2u.png/">http://img843.imageshack.us/i/imagen2u.png/</a><!-- m --> adjunto el codigo FUNCTION consulta_cheques1(oWnd) local oDlg, oBrw, oCol,oBmp,oChild local nFor,ocol1,ocol2,oBtn,calias,oFont,oFont1 local aGrad := {{ 0.50, CLR_RED, CLR_YELLOW }, { 0.50, CLR_YELLOW, CLR_RED }} local oBar,ntotal local cfecini := date() ntotal := 0.00 set century on SET EPOCH TO 1960 SET DATE FORMAT TO 'YYYY/MM/DD' DEFINE FONT oFont NAME "Arial" SIZE 0, -11 BOLD // ITALIC DEFINE FONT oFont1 NAME "Arial" SIZE 0, -14 BOLD ITALIC DEFINE WINDOW oChild TITLE "Consulta de Cheques Posfechados" MDICHILD ; FROM 0,0 TO 850,1250; //690,1025 COLOR "N/W" PIXEL ; border none nominimize nomaximize //prevent resizing nominimize DEFINE DIALOG oDlg RESOURCE "d_consulta_cheques1" of oChild REDEFINE DTPICKER cfecini ID 101 OF oDlg dbselectarea("tbancos") dbsetorder("ibancos") DBGOTOP() dbselectarea("tcheque") dbsetorder("icheque") DBGOTOP() set relation to tcheque->tccodban into tbancos *FASTEDIT := .T. oBrw = TXBrowse():New( oDlg ) REDEFINE XBROWSE oBrw ID 500 OF oDlg LINES CELL FOOTERS *oBrw:SetTree( nil, { "open", "close", "go" }) oBrw:SetTree( BuildTree(cfecini), { "open", "close", "go" }) ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 1 ] HEADER "Fecha"+CRLF+"Emision" ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 2 ] HEADER "Fecha"+CRLF+"Cobro" ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 3 ] PICTURE "99,999.99" HEADER "Valor" //+CRLF+"Cheque" ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 4 ] HEADER "Estado" ADD TO oBrw DATA oBrw:oTreeItem:Cargo[ 5 ] HEADER "Fecha"+CRLF+"Deposito" oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW oBrw:aCols[ 1 ]:cHeader = "Código & Nombres" oBrw:aCols[ 3 ]:cFooter = "Total :" * oBrw:MakeTotals(oCol) oBrw:Valor:nTotal := nTotal oDlg:oClient = oBrw * // Create ButtonBar * BtnBar( oBrw ) // Commn ButtonBar for all sample Browses DEFINE BUTTONBAR oBar SIZE 40, 40 OF oChild _3D 2007 DEFINE BUTTON OF oChild:oBar GROUP NOBORDER; TOOLTIP "Salir" ; ACTION (oDlg:end(),oChild:End()) FILENAME "\FWH\imagenes\quit.bmp"; MESSAGE "Salir del Sistema" DEFINE BUTTON OF oChild:oBar GROUP NOBORDER; TOOLTIP "Buscar" ; ACTION (oBrw:SetTree( nil, { "open", "close", "go" }),oBrw:SetTree( BuildTree(cfecini,oBrw), { "open", "close", "go" }),oBrw:refresh(.T.),oBrw:SetFocus()) FILENAME "\FWH\imagenes\buscar.bmp"; MESSAGE "Salir del Sistema" * ACTION (BuildTree(cfecini,oBrw),oBrw:SetTree( nil, { "open", "close", "go" }),oBrw:refresh(.T.),oBrw:SetFocus()) FILENAME "\FWH\imagenes\buscar.bmp"; ACTIVATE DIALOG oDlg nowait CENTERED ON INIT (Odlg:move(0,0)); VALID (!( GeTKeyState(27))) ACTIVATE WINDOW oChild ; ON INIT (oChild:paint(),oChild:setsize( oDlg:nwidth, oDlg:nheight)) ; VALID ( oChild := Nil, .t.) return nil static function BuildTree(cfecini,oBrw) local oTree, cState,dfecha_vence local condi1,condi2 memvar musuario dfecha_vence := cfecini *cstate := space(5) dbselectarea("tcheque") ordSetfocus("icheque1") dbgotop() DBSETFILTER( {||tcheque->tcfechafin == dfecha_vence },"tcheque->tcfechafin == dfecha_vence ") dbgotop() *if eof() * MsgAlert("No existe inforemacion para esta fecha",musuario) * return nil // oTree *endif *condi1 := dfecha_vence *condi2 := dfecha_vence *tcheque->(OrdScope(0,condi1)) *tcheque->(OrdScope(1,condi2)) *browse() *?? oBrw *oBrw:SetTree( nil, { "open", "close", "go" }) if !eof() TREE oTree while ! Eof() if Empty( cState ) _TreeItem( tcheque->cl_cod+" "+tcheque->cl_razon):Cargo := { Space( 10 ), Space( 10 ),0.00,space(12),space(10) } TREE cState = tcheque->cl_cod else if cState != tcheque->cl_cod ENDTREE cState = tcheque->cl_cod _TreeItem( tcheque->cl_cod+" "+tcheque->cl_razon ):Cargo := { Space( 10 ), Space( 10 ),0.00,space(12),space(10) } TREE endif endif if tcheque->cl_cod == cState _TreeItem( tbancos->tbdesc ):Cargo := { tcheque->tcfechaini , tcheque->tcfechafin,tcheque->tcvalor,if(tcheque->tcdeposita=.T.,"Depositado","Pendiente"),tcheque->tcfecdepos } endif SKIP enddo ENDTREE ENDTREE gO TOP else TREE oTree if Empty( cState ) _TreeItem( cstate ):cargo:= { Space( 10 ), Space( 10 ),0.00,space(12),space(10) } TREE endif _TreeItem( cstate ):cargo:= { Space( 10 ), Space( 10 ),0.00,space(12),space(10) } * ENDTREE ENDTREE endif *oBrw:refresh() * *tcheque->(OrdScope(0,nil)) *tcheque->(OrdScope(1,nil)) cstate := space(5) dbsetfilter() return oTree Voy a seguir intentando si alguien sabe donde me equivoco por favor deme una ayudita.. Saludos
xbrowse tree ayuda (SOLUCIONADO)
Si solucionado, gracias por la ayuda a Marcelo Jingo En este foro siempre hay alguien que nos da una mano Esta era la solucion IF len(obrwx:acols)>0 oBrwx:delcol(1) ENDIF
xbrowse tree con setcheck recuperar contenido rama registro
Hola buenas noches para todos Estoy intentando crear un tree desde la base de datos, para luego mostrarla en un xbrowse, recuperar la información y actualizar el estado al momento de hacer doble click sobre el setcheck, tanto el en xbrowse como en la base de datos. Tome este ejemplo, pero no se como hacer para recuperar el valor de la rama del tree (o registro de xbrowse) al momento de hacer doble click, para luego proceder a hacer la actualización en la base de datos refrescar el xbrowse. Vaya si es difícil esto de los tree <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> [code=fw:1wyneffl]<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: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oCn, oRs, oTree, tmp<br />   <span style="color: #00C800;">local</span> oDlg, oBrw<br /><br />    <span style="color: #00C800;">Local</span> cbCambioEstado := <|x,oBrw,n|<br />            oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"married"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span> := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>x,.T.,.F.<span style="color: #000000;">&#41;</span><br />            oRs:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />        ><br /><br />   oCn   := FW_OpenAdoConnection<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"xbrtest.mdb"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> oCn == <span style="color: #00C800;">nil</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br />   oRs   := FW_OpenRecordSet<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"SELECT * FROM CUSTOMER ORDER BY STATE,CITY,FIRST"</span> <span style="color: #000000;">&#41;</span><br /><br />   oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   TREE oTree<br />      <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !oRs:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         TREEITEM oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"state"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> ;<br />            CARGO <span style="color: #000000;">&#123;</span> uValBlank<span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"first"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>, uValBlank<span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"salary"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span>,;<br />                    , uValBlank<span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"married"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />         tmp := oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"state"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />         TREE<br />         <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !oRs:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"state"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> == tmp<br />            TREEITEM oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"city"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> CARGO <span style="color: #000000;">&#123;</span> oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"first"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"salary"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>,;<br />                , uValBlank<span style="color: #000000;">&#40;</span> oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"married"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />            oRs:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">enddo</span><br />         ENDTREE<br />      <span style="color: #00C800;">enddo</span><br />   ENDTREE<br />   oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oTree:<span style="color: #000000;">OpenAll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <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;">550</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br />   @ <span style="color: #000000;">20</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 oTree 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;">"STATE>CITY"</span>, <span style="color: #ff0000;">"FIRST"</span>, <span style="color: #ff0000;">"SALARY"</span>,<span style="color: #ff0000;">"MARRIED"</span> ;<br />      CELL LINES NOBORDER<br />    <br />    WITH OBJECT oBrw<br />      :<span style="color: #000000;">bLDblClick</span>   := <span style="color: #000000;">&#123;</span>|nRow, nCol| <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">//Como recupero los valores del registro?</span><br />    END<br /><br />    WITH OBJECT oBrw<br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> oRsPrm:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"married"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> == .T. , .T. , .F. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cDataType</span>  := <span style="color: #ff0000;">"L"</span><br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOnPostEdit</span>    := <span style="color: #000000;">&#123;</span> | o, x, n | EVAL<span style="color: #000000;">&#40;</span>cbCambioEstado,x,oBrw,n<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>       <br />    END   <br />      <br /><br />   oBrw:<span style="color: #000000;">lDisplayZeros</span> := .t.<br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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><br /> </div>[/code:1wyneffl] [img:1wyneffl]https&#58;//hymplus&#46;com/forofw/setcheck&#46;png[/img:1wyneffl]
xbrowse tree con setcheck recuperar contenido rama registro
Bueno ya lo hice funcionar, aun que no he comprendido del todo como funciona, sobre todo el setcheck() y la posición de la columna del CARGO dentro del oTree <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> Seguiré estudiando y publicare los avances, siempre es complejo el manejo de estos tree [img:21jgjnf6]https&#58;//hymplus&#46;com/forofw/setcheck2&#46;png[/img:21jgjnf6] [code=fw:21jgjnf6]<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: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aData, oTree<br />   <span style="color: #00C800;">local</span> oDlg, oFont, oBrw<br /><br />    <span style="color: #00C800;">Local</span> cbCambioEstado := <|x|<br />            oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := x<br />            oBrw:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        ><br /><br />   aData    := ;<br />   <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Facturas"</span>, <span style="color: #000000;">00</span>,.T.  <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Pedidos"</span>, <span style="color: #000000;">00</span>,.F. <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Remsiones"</span>, <span style="color: #000000;">00</span>,.F. <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Notas"</span>, <span style="color: #000000;">02</span>,.F. <span style="color: #000000;">&#125;</span> ;<br />   <span style="color: #000000;">&#125;</span><br /><br />   aData2    := ;<br />   <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Agregar "</span>, <span style="color: #000000;">01</span>,.T. <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Modificar "</span>, <span style="color: #000000;">02</span>,.T. <span style="color: #000000;">&#125;</span> ;<br />   <span style="color: #000000;">&#125;</span><br /><br />    <br />    TREE oTree<br />    <span style="color: #00C800;">FOR</span> r:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> len<span style="color: #000000;">&#40;</span>aData<span style="color: #000000;">&#41;</span><br />        TREEITEM aData<span style="color: #000000;">&#91;</span>r<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> CARGO <span style="color: #000000;">&#123;</span>  aData<span style="color: #000000;">&#91;</span>r<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> , aData<span style="color: #000000;">&#91;</span>r<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#125;</span>      <br />        TREE<br />        <span style="color: #00C800;">FOR</span> t:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> len<span style="color: #000000;">&#40;</span>aData2<span style="color: #000000;">&#41;</span><br />            TREEITEM aData2<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> CARGO <span style="color: #000000;">&#123;</span> aData2<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> , aData2<span style="color: #000000;">&#91;</span>t<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>  <span style="color: #000000;">&#125;</span><br />        <span style="color: #00C800;">NEXT</span>  <br />        ENDTREE<br />    <span style="color: #00C800;">NEXT</span>    <br />    ENDTREE<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;">-15</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">450</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @ <span style="color: #000000;">20</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 oTree ;<br />      COLUMNS <span style="color: #000000;">2</span> ;<br />      HEADERS <span style="color: #ff0000;">"ITEM"</span>, <span style="color: #ff0000;">"AUTO"</span>;<br />      CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">lDisplayZeros</span> := .f.<br />        :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddBitmap</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> FWDArrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, FWRArrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, GetTreeBmps<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />        <br />        :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cDataType</span>  := <span style="color: #ff0000;">"L"</span><br />        :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> := EDIT_GET<br />        :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOnPostEdit</span>    := <span style="color: #000000;">&#123;</span> | o, x, n | EVAL<span style="color: #000000;">&#40;</span>cbCambioEstado,x<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>      <br /><br />        :<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">nLevel</span> == <span style="color: #000000;">1</span>, CLR_YELLOW, CLR_WHITE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      <br />        :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br />    oTree:<span style="color: #000000;">OpenAll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</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 /> <br /> </div>[/code:21jgjnf6]
xbrowse tree con setcheck recuperar contenido rama registro
Leandro, muy bien! gracias por compartirlo
xbrowse value of cell is nil
To All I have a recordset where the field "lastlog" ( Last Login ) could be nil .. instead of xBrowse showing the cell value as nil I would prefer "00/00/0000" ... here is the code : [code=fw:2qw4pgu8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span> oICO <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SCANNER"</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oUser                        ;<br />      <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">25</span>,<span style="color: #000000;">65</span>                    ;<br />      <span style="color: #0000ff;">of</span> oWndMDI                           ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"USERINFO Administrative Browse"</span> ;<br />      <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span>oRsUser<span style="color: #000000;">&#41;</span>              ;<br />      <span style="color: #0000ff;">ICON</span> oICO ;<br />      NOMINIMIZE                           ;<br />      NOZOOM                               ;<br />      <span style="color: #0000ff;">MDICHILD</span><br /><br />@ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">xBROWSE</span> oBrow <span style="color: #0000ff;">of</span> oUser              ;<br />       RECORDSET oRsUser                   ;<br />       COLUMNS <span style="color: #ff0000;">"USERID"</span>,                   ;<br />               <span style="color: #ff0000;">"READ"</span>,                     ;<br />               <span style="color: #ff0000;">"WRITE"</span>,                    ;<br />               <span style="color: #ff0000;">"MGR"</span>,                      ;<br />               <span style="color: #ff0000;">"SUPER"</span>,                    ;<br />               <span style="color: #ff0000;">"lastlog"</span>                   ;<br />       COLSIZES <span style="color: #000000;">90</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">100</span>         ;<br />       HEADERS <span style="color: #ff0000;">"Userid"</span>,                   ;<br />               <span style="color: #ff0000;">"Read"</span>,                     ;<br />               <span style="color: #ff0000;">"Write"</span>,                    ;<br />               <span style="color: #ff0000;">"ProjMgr"</span>,                  ;<br />               <span style="color: #ff0000;">"Super"</span>,                    ;<br />               <span style="color: #ff0000;">"Last Login"</span>                ;<br />       AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br />       oUSER:<span style="color: #000000;">oClient</span> := oBrow<br />       oBrow:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> |nRow,nCol | _Userview<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"V"</span>, oRsUser <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />       oBrow:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>    <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oUser           ;<br />    <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span><span style="color: #000000;">&#40;</span> oBrow:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span>;<br />    <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> IIF<span style="color: #000000;">&#40;</span> !lOK, UserClose<span style="color: #000000;">&#40;</span>.T., oRsUser<span style="color: #000000;">&#41;</span>, .F. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2qw4pgu8] [url=http&#58;//img440&#46;imageshack&#46;us/i/userbrow&#46;jpg/:2qw4pgu8][img:2qw4pgu8]http&#58;//img440&#46;imageshack&#46;us/img440/6/userbrow&#46;jpg[/img:2qw4pgu8][/url:2qw4pgu8]
xbrowse value of cell is nil
Rick, I don't know if this will work with xBrowse and/or a recordset, but I have just used an if() function instead of a fieldname with TWBrowse. Something like: if(lastlog=nil, "00/00/0000", dtoc( lastlog ) ) James
xbrowse value of cell is nil
By default, XBrowse constructs these codeblocks [code=fw:3kdo789m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"lastlog"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">bStrData</span>    := <span style="color: #000000;">&#123;</span> || cValToStr<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span>, oCol:<span style="color: #000000;">cEditPicture</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:3kdo789m] [i:3kdo789m]Note: The real codeblock constructed by XBrowse is more complex than shown above, because it includes check for empty recordsets also. But that is not relevant now, if we know that this present recordset is never empty [/i:3kdo789m] We can override these codeblocks in our program: Before oBrw:CreateFromCode(), insert: [code=fw:3kdo789m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bEditValue</span>  := <span style="color: #000000;">&#123;</span> || IfNil<span style="color: #000000;">&#40;</span> oRsUser:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"lastlog"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, CToD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:3kdo789m] In this case Null Dates are shown as blank dates " / / ". [i:3kdo789m]IfNil( a, b ) is FWH function similar to IFNULL, ISNULL, NVL in various SQL syntax. This is a replacement for If( a == nil, b, a ) but more useful. IfNil(...) can have more than 2 arguments. IfNil( a,b,c,d,e....) returns the first non-nil argument like COALESCE(). I am not sure if IfNil(..) function is available in your version. If not, you may use If( a == nil, b, a ).[/i:3kdo789m] If we want to show "00/00/000" instead of " / / " instead of overriding bEditValue, we can override bStrData: Insert this line instead of the above: [code=fw:3kdo789m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span> == <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"00/00/0000"</span>, cValToStr<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span>, oCol:<span style="color: #000000;">cEditPicture</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:3kdo789m] It goes without saying that before this line you should assign the value to oCol as oCol := oBrw:aCols[ 6 ]
xbrowse value of cell is nil
Rao I am using an older version of FWH 910 and the ifnil() function does not exist .. I got the remarked out code to work but your other suggestion comes back with undefined oCol .. [code=fw:48azqcn9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oCol := oBrow:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span><br />      * oCol:<span style="color: #000000;">bEditValue</span>  := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oRsUser:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"lastlog"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> == <span style="color: #00C800;">nil</span>, ctod<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>, oRsUser:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"lastlog"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #B900B9;">// this works</span><br />       oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span> == <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"00/00/0000"</span>, cValToStr<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">Value</span>, oCol:<span style="color: #000000;">cEditPicture</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />       oBrow:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:48azqcn9] [code=fw:48azqcn9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\FOX\DHEC\PMOSQL\pmow32.Exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">2</span>,<span style="color: #000000;">492</span>,<span style="color: #000000;">928</span> bytes<br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">6</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">09</span>/<span style="color: #000000;">22</span>/<span style="color: #000000;">2010</span>, <span style="color: #000000;">11</span>:<span style="color: #000000;">21</span>:<span style="color: #000000;">30</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1003</span>  Variable does not exist: <span style="color: #000000;">OCOL</span><br />   Args:<br /><br /><span style="color: #000000;">Stack</span> Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">USERBROW</span>.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>_USERBROW<span style="color: #000000;">&#40;</span><span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBRWCOLUMN:<span style="color: #000000;">PAINTDATA</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">8407</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #0000ff;">PAINT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1333</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">990</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1439</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">10158</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">3347</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOXINDIRECT<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">273</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\<span style="color: #00C800;">function</span>\ERRSYSW.PRG => ERRORDIALOG<span style="color: #000000;">&#40;</span><span style="color: #000000;">343</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\<span style="color: #00C800;">function</span>\ERRSYSW.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>ERRORSYS<span style="color: #000000;">&#40;</span><span style="color: #000000;">27</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">USERBROW</span>.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>_USERBROW<span style="color: #000000;">&#40;</span><span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBRWCOLUMN:<span style="color: #000000;">PAINTDATA</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">8407</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #0000ff;">PAINT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1333</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">990</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1439</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">10158</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">3347</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => DIALOGBOXINDIRECT<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">273</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\<span style="color: #00C800;">function</span>\ERRSYSW.PRG => ERRORDIALOG<span style="color: #000000;">&#40;</span><span style="color: #000000;">343</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\<span style="color: #00C800;">function</span>\ERRSYSW.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>ERRORSYS<span style="color: #000000;">&#40;</span><span style="color: #000000;">27</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">USERBROW</span>.PRG => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>_USERBROW<span style="color: #000000;">&#40;</span><span style="color: #000000;">80</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBRWCOLUMN:<span style="color: #000000;">PAINTDATA</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">8407</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #0000ff;">PAINT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1333</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #00C800;">DISPLAY</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">990</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1439</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">10158</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">&#40;</span><span style="color: #000000;">3347</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>:  => WINRUN<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TMDIFRAME:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">966</span><span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">MAIN</span>.PRG => MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">410</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:48azqcn9]
xbrowse value of cell is nil
[code=fw:1x3z7h00]<div class="fw" id="{CB}" style="font-family: monospace;">oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> |x| x := oRsUser:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"lastlog"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'00/00/0000'</span>,DToC<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:1x3z7h00]
xbrowse value of cell is nil
Rao Thank you .. got it to work with your last suggestion!! Rick Lipkin
xbrowse vertical line thickness
hi How can I change thickness or colors of vertical lines in some columns in xBrowse ? [img:1yord9we]https&#58;//i&#46;imgur&#46;com/7sTv3IE&#46;jpg[/img:1yord9we] thanks
xbrowse vertical line thickness
[code=fw:uhf64b6o]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; aData := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #000000;">9</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">11</span>, <span style="color: #000000;">12</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">400</span>,<span style="color: #000000;">170</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br />&nbsp; &nbsp;@ <span style="color: #000000;">20</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 />&nbsp; &nbsp; &nbsp; DATASOURCE aData <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;hPen &nbsp;:= CreatePen<span style="color: #000000;">&#40;</span> PS_SOLID, <span style="color: #000000;">2</span>, CLR_HRED <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">hColPen</span> &nbsp;:= hPen<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">hColPen</span> &nbsp;:= hPen<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> hPen <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:uhf64b6o]
xbrowse vertical line thickness
perfect thank you Mr Rao
xbrowse vertical line thickness
The problem I see is that when I navigate through the xbrowse the thickness is lost. Compiled with FWH1701 and Harbor 3.2 regards
xbrowse vertical line thickness
I noticed the same ( FWH_17_12 ) [quote:fpak82pd]The problem I see is that when I navigate through the xbrowse the thickness is lost. Compiled with FWH1701 and Harbor 3.2[/quote:fpak82pd] [img:fpak82pd]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/xbrwline1&#46;jpg[/img:fpak82pd] regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xbrowse vertical line thickness
We need to fix this. Till then, please use different color but not different thickness.
xbrowse vertical line thickness
damiano, i not understood what need it ...
xbrowse with array
[img:2rbx85nj]https&#58;//i&#46;postimg&#46;cc/kMHKNR3x/kk&#46;png[/img:2rbx85nj] What's happened ? I converte a dbf into array and then I made [code=fw:2rbx85nj]<div class="fw" id="{CB}" style="font-family: monospace;"> @<span style="color: #000000;">40</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-2</span>,<span style="color: #000000;">-2</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DATASOURCE aData COLUMNS aBrowse</div>[/code:2rbx85nj] the array abrowse is.. [code=fw:2rbx85nj]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">local</span> aBrowse &nbsp; := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DATA"</span>, &nbsp; &nbsp; &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Data "</span><span style="color: #000000;">&#41;</span>,, &nbsp; &nbsp; <span style="color: #000000;">80</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CONCORSO"</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Concorso"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">40</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"BA1"</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,; &nbsp; &nbsp; <span style="color: #B900B9;">//3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"BA2"</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"BA3"</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"3"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;<br /><br />......<br /><br />&nbsp;</div>[/code:2rbx85nj] How I can make to load all field of array (57) ?
xbrowse with array
[code=fw:2vxvreyp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> aBrowse &nbsp; := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>, &nbsp; &nbsp; &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Data "</span><span style="color: #000000;">&#41;</span>,, &nbsp; &nbsp; <span style="color: #000000;">80</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Concorso"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">40</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,; &nbsp; &nbsp; <span style="color: #B900B9;">//3</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">5</span>, &nbsp; &nbsp;i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"3"</span><span style="color: #000000;">&#41;</span>,, &nbsp;<span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;<br />&nbsp;</div>[/code:2vxvreyp]
xbrowse with array
[quote="nageswaragunupudi":w7nny6qd][code=fw:w7nny6qd]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">local</span> aBrowse   := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1</span>,        i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Data "</span><span style="color: #000000;">&#41;</span>,,     <span style="color: #000000;">80</span>, <span style="color: #000000;">&#125;</span>,;<br />                    <span style="color: #000000;">&#123;</span> <span style="color: #000000;">2</span>,    i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Concorso"</span><span style="color: #000000;">&#41;</span>,,  <span style="color: #000000;">40</span>, <span style="color: #000000;">&#125;</span>,;<br />                    <span style="color: #000000;">&#123;</span> <span style="color: #000000;">3</span>,    i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">&#41;</span>,,  <span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;     <span style="color: #B900B9;">//3</span><br />                    <span style="color: #000000;">&#123;</span> <span style="color: #000000;">4</span>,    i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">&#41;</span>,,  <span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;<br />                    <span style="color: #000000;">&#123;</span> <span style="color: #000000;">5</span>,    i18n<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"3"</span><span style="color: #000000;">&#41;</span>,,  <span style="color: #000000;">30</span>, <span style="color: #000000;">&#125;</span>,;<br /> </div>[/code:w7nny6qd][/quote:w7nny6qd] I wanted to see if maybe the xbrowse is faster if I convert the dbf to array because on my computers I have the same problem (asus Rog with 8GBRam without ssd and Lenovo Miix320 with 4GBram without ssd )
xbrowse with bitmap
Hi I have a xbrowse with array FOR .... AADD( VETEMP, { oArqBol:CGCCLI, oArqBol:NOME, oArqBol:BOLETO, oArqBol:BRUTO, Lower(oArqAsoc:EMAIL)}) oBrw:SetArray( VETEMP ) oBrw:nHeaderHeight :=30 oBrw:nStretchCol := STRETCHCOL_LAST oBrw:GoBottom() oBrw:Refresh() SysRefresh() NEXT How I can put a resource bitmap in last column when i add array items? like this AADD( VETEMP, { oArqBol:CGCCLI, oArqBol:NOME, oArqBol:BOLETO, oArqBol:BRUTO, Lower(oArqAsoc:EMAIL), ------HERE I WANT TO PUT A BITMAP RESOURCE---------}) Thanks in advance.
xbrowse with bitmap
Wanderson, olhe se te ajuda: oBrowse:AddCol( ) oBrowse:aCols[3]:AddResource( 'IMAGEM1' ) oBrowse:aCols[3]:AddResource( 'IMAGEM2' ) oBrowse:aCols[3]:bBmpData := {|| IIf( Empty( tabela->teste ), 1, 2 ) } oBrowse:aCols[3]:lBmpStretch := .f. oBrowse:aCols[3]:lBmpTransparent := .t. oBrowse:aCols[3]:nDataBmpAlign := AL_CENTER oBrowse:aCols[3]:nHeadStrAlign := AL_CENTER oBrowse:aCols[3]:cHeader := 'INSS' oBrowse:aCols[3]:nWidth := 60
xbrowse with bitmap
[quote="SGS":2ct0kksu]Wanderson, olhe se te ajuda: oBrowse:AddCol( ) oBrowse:aCols[3]:AddResource( 'IMAGEM1' ) oBrowse:aCols[3]:AddResource( 'IMAGEM2' ) oBrowse:aCols[3]:bBmpData := {|| IIf( Empty( tabela->teste ), 1, 2 ) } oBrowse:aCols[3]:lBmpStretch := .f. oBrowse:aCols[3]:lBmpTransparent := .t. oBrowse:aCols[3]:nDataBmpAlign := AL_CENTER oBrowse:aCols[3]:nHeadStrAlign := AL_CENTER oBrowse:aCols[3]:cHeader := 'INSS' oBrowse:aCols[3]:nWidth := 60[/quote:2ct0kksu] Olá obrigado pela resposta mas neste caso a imagem já aparece quando defino as colunas do xbrowse, no meu caso quando defino não especifico nenhum conteúdo, só depois em determina circunstância é que eu alimento um array com os dados aí dou um refresh no xbrowse, neste caso precisaria de colocar o bmp na última coluna do array pra quando der o oBrw:SetArray( MEUARRAY ) ele já mostrar os dados e o bitmap. Att. Wanderson.
xbrowse with double row
hi, I have a table with these fields: CLIENTE, ARTICOLO, PREFISSO, ORDINE, DATA , QUANTITA and I would like to get this xbrowse: [img:p8bv0a75]https&#58;//i&#46;imgur&#46;com/rLsNm3Q&#46;jpg[/img:p8bv0a75] any help? thanks
xbrowse with double row
I found this in my notes, apparently from an old forum message. I don't remember if I ever tried it. [quote:23kzow82]To get multiple lines per record: oCol:bStrData := { || oCust:name + CRLF + oCust:street } oBrw:nDataLines := 2 oBrw:nRowHeight := 35 // optional. Automatic, but you may enlarge this if you like xBrowse will also wordwrap at spaces IF nDataLines and nRowHeight are set to allow it.[/quote:23kzow82]
xbrowse with double row
James, That has always worked for me.
xbrowse with double row
thank you, when I return to the office I will try.
xbrowse with trees (bug?)
To demonstrate what I understand to be a bug in xbrowse introduced during 2014, I wrote this self-contained reduced sample code. It works perfectly when compiled with fw 2012 but it breaks with fw 2014_06 when clicking on the square button of a leaf cell "AmtPaid". Is there a fix? [code=fw:3od3bso3]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><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;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Id 1"</span>, <span style="color: #000000;">&#123;</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;">&#125;</span>,;<br />                          <span style="color: #000000;">&#123;</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;">&#125;</span> <span style="color: #000000;">&#125;</span>,;<br />                   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Id 2"</span>, <span style="color: #000000;">&#123;</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;">&#125;</span>,;<br />                          <span style="color: #000000;">&#123;</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;">&#125;</span> <span style="color: #000000;">&#125;</span>,;<br />                   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Id 3"</span>, <span style="color: #000000;">&#123;</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;">&#125;</span>,;<br />                          <span style="color: #000000;">&#123;</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;">&#125;</span> <span style="color: #000000;">&#125;</span>,;<br />                   <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Id 4"</span>, <span style="color: #000000;">&#123;</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;">&#125;</span>,;<br />                          <span style="color: #000000;">&#123;</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;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">FUNCTION</span> start<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">LOCAL</span> oApp := TApp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   oApp:<span style="color: #000000;">CreateTree</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oApp:<span style="color: #0000ff;">Init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   <span style="color: #00C800;">METHOD</span> CreateTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> SubTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">METHOD</span> ReCalculate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> ReCalculateCompleteTree<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">METHOD</span> PayEachLeaf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span> ::<span style="color: #000000;">oTree</span> <span style="color: #000000;">&#41;</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;">&#91;</span> _PAID <span style="color: #000000;">&#93;</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;">&#91;</span> _EXPECTED <span style="color: #000000;">&#93;</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;">&#91;</span> _PENDING <span style="color: #000000;">&#93;</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;">&#123;</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;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span>:= x , ::<span style="color: #000000;">ReCalculate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      :<span style="color: #000000;">nEditType</span> := EDIT_GET_BUTTON<br /><br />      :<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span> |R, C, o, K| ;<br />               <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</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;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                  iif<span style="color: #000000;">&#40;</span> EMPTY<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>,;<br />                     ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span> := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _EXPECTED <span style="color: #000000;">&#93;</span>,;<br />                     ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0.00</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />               ::<span style="color: #000000;">ReCalculate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   <br />      <br />   END <br /><br />   AEVAL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">oDataFont</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</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;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   AEVAL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</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;">&#125;</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br /><br />   ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span> aItem<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//each oItem is type TTreeItem</span><br /><br />      oItem:<span style="color: #000000;">Cargo</span> := <span style="color: #000000;">&#123;</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;">&#125;</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;">&#123;</span> |o| o:<span style="color: #000000;">SetTree</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">SubTree</span><span style="color: #000000;">&#40;</span> o <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, o:<span style="color: #000000;">bAction</span> := <span style="color: #00C800;">Nil</span> <span style="color: #000000;">&#125;</span><br /><br />      EVAL<span style="color: #000000;">&#40;</span> oItem:<span style="color: #000000;">bAction</span>, oItem <span style="color: #000000;">&#41;</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;">&#40;</span> oParent <span style="color: #000000;">&#41;</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;">&#40;</span> oParent:<span style="color: #000000;">cPrompt</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> nAt := aSCAN<span style="color: #000000;">&#40;</span> aItems, <span style="color: #000000;">&#123;</span> |e| e<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == cId <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</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;">&#91;</span> nAt <span style="color: #000000;">&#93;</span><br /><br />      <span style="color: #00C800;">IF</span> VALTYPE<span style="color: #000000;">&#40;</span> aItem <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">"A"</span>    ;LOOP   ;ENDIF <br /><br />      TREEITEM oItem <span style="color: #0000ff;">PROMPT</span> aItem<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</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;">&#123;</span> aItem<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, aItem<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> , aItem<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#91;</span> _PAID <span style="color: #000000;">&#93;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span> := IIF<span style="color: #000000;">&#40;</span> nPaid == <span style="color: #000000;">0.00</span>, oItem:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _EXPECTED <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">0.00</span> <span style="color: #000000;">&#41;</span><br />      oItem := oItem:<span style="color: #000000;">GetNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span> oBranch <span style="color: #000000;">&#41;</span> <br />      oBranch := oBranch:<span style="color: #000000;">GetNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span> oItem <span style="color: #000000;">&#41;</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;">&#40;</span><span style="color: #000000;">&#41;</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;">&#123;</span> | o | nTotExp    += o:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _EXPECTED <span style="color: #000000;">&#93;</span>,;<br />                         nTotPend   += o:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PENDING <span style="color: #000000;">&#93;</span>,;<br />                         nTotPaid   += o:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br /><br />   <br /><br />   oParent := IIF<span style="color: #000000;">&#40;</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;">&#40;</span><span style="color: #000000;">&#41;</span>, oItem <span style="color: #000000;">&#41;</span><br />   oParent:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBranch := oParent:<span style="color: #000000;">GetNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">&#40;</span> bAddTotals, oBranch <span style="color: #000000;">&#41;</span>      <br />      oBranch := oBranch:<span style="color: #000000;">GetNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   END <br /><br />   oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _EXPECTED <span style="color: #000000;">&#93;</span> := nTotExp<br />   oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span>     := nTotPaid<br /><br />   oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PENDING <span style="color: #000000;">&#93;</span> := oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _EXPECTED <span style="color: #000000;">&#93;</span> - oParent:<span style="color: #000000;">Cargo</span><span style="color: #000000;">&#91;</span> _PAID <span style="color: #000000;">&#93;</span> <br /><br />   ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />   EVAL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">bBookmark</span>, nAt <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <br /> <br /> </div>[/code:3od3bso3]