topic
stringlengths
1
63
text
stringlengths
1
577k
xbrowse record display
Hi All I have a xbrowse that has more records that can be displayed but the bottom line of the view looks like a blank record even though there are records below - is there a way overcome this - so the browse is full of records. cheers Colin
xbrowse record display
When the vertical size of the browse data area is not integral multiple of number of rows that can be displayed and the row height, there is a small gap at the bottom that can not be filled with data. If we want the displayed rows to snugly cover the total area, there are two alternative approaches. Alternative-1: While defining the browse, manually assign nHeaderHeight, nFooterHeight and nRowHeight. Define the height of the browse as nHeaderHeight + nFooterHeight + numrows * nRowHeight + ( exact space if needed depending on whether the style of Browse has WS_BORDER or not ). Alternative-2: Define the browse as usual. Immediately after the browse is initiated, calculate the gap at the bottom and (a) add the gap to header and footer equally or (b) reduced the height of the browse. You can use this code: [code=fw:21g7d1kg]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; oDlg:<span style="color: #000000;">bStart</span> := <span style="color: #000000;">&#123;</span> || AdjustBrwHeoght<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:21g7d1kg] function: [code=fw:21g7d1kg]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AdjustBrwHeoght<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nGap &nbsp;:= oBrw:<span style="color: #000000;">BrwHeight</span> - <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowHeight</span> * <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">RowCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> - ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">lHeader</span>, oBrw:<span style="color: #000000;">nHeaderHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> - ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">lFooter</span>, oBrw:<span style="color: #000000;">nFooterHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">lFooter</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">nFooterHeight</span> &nbsp; += Int<span style="color: #000000;">&#40;</span> nGap / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nGap &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -= Int<span style="color: #000000;">&#40;</span> nGap / <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">lHeader</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">nHeaderHeight</span> &nbsp; += nGap<br />&nbsp; &nbsp; &nbsp; nGap &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nGap > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">nHeight</span> &nbsp; &nbsp; &nbsp; &nbsp; -= nGap<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;obrw:<span style="color: #0000ff;">refresh</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 />&nbsp;</div>[/code:21g7d1kg] You can modify the logic to your aesthetic taste.
xbrowse record display
Mr Rao Thanks for your reply - this fixed the issue - now looks a lot better. Cheers Colin
xbrowse record display
Dear RAO, I think it's better if we determine if elements/records are greater than xbrowse can display then use AdjustBrwHeight( oBrw ) otherwise no adjustment since all elements/records are displayed. Regards, Frances
xbrowse record display
[quote="fraxzi":341qzhua]Dear RAO, I think it's better if we determine if elements/records are greater than xbrowse can display then use AdjustBrwHeight( oBrw ) otherwise no adjustment since all elements/records are displayed. Regards, Frances[/quote:341qzhua] Yes. My answer was specific to Mr. Haig's requirement. He said in his case rows were more than the display
xbrowse record display
[quote="nageswaragunupudi":uqayds9d][quote="fraxzi":uqayds9d]Dear RAO, I think it's better if we determine if elements/records are greater than xbrowse can display then use AdjustBrwHeight( oBrw ) otherwise no adjustment since all elements/records are displayed. Regards, Frances[/quote:uqayds9d] Yes. My answer was specific to Mr. Haig's requirement. He said in his case rows were more than the display[/quote:uqayds9d] Dear RAO, I was affected.. LOL! This is also my case but did not bother until I read this topic. Regards, Frances
xbrowse record selector column
se puede cambiar el color de la columna del record selector del xbrowse? como? Gracias
xbrowse record selector column
Paco, intenta con: [code=fw:1xl8uau3]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; oBrw:<span style="color: #000000;">nRecSelColor</span> := <span style="color: #000000;">16777215</span><br />&nbsp;</div>[/code:1xl8uau3]
xbrowse record selector column
Bien !! en toda la columna de los registros, pero sabes, la cabecera del record selector no cambia de color, esa como se cambia de color? Gracias Saludos
xbrowse record selector column
Paco, asi lo hago, cuando cambio todos los colores del browse. Espero sirva de guia para tu implementacion. [code=fw:1lwoi05j]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//------------------------------</span><br /><span style="color: #00C800;">Function</span> Color_oBrw<span style="color: #000000;">&#40;</span>oBrw,cColor<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> aGradBarSelFocus := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">0.65</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">212</span>,<span style="color: #000000;">146</span>,<span style="color: #000000;">69</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">218</span>,<span style="color: #000000;">215</span>,<span style="color: #000000;">117</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span><span style="color: #000000;">0.35</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">218</span>,<span style="color: #000000;">215</span>,<span style="color: #000000;">117</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">159</span>,<span style="color: #000000;">140</span>,<span style="color: #000000;">154</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">local</span> aGradBarSel:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">108</span>,<span style="color: #000000;">125</span>,<span style="color: #000000;">184</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">DEFAULT</span> cColor := <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">IF</span> !cColor = <span style="color: #00C800;">NIL</span><br />&nbsp; <span style="color: #00C800;">if</span> cColor = <span style="color: #ff0000;">"PLATA"</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrGrad</span> := &nbsp;<span style="color: #000000;">&#123;</span> | lInvert | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lInvert, ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.30</span>,<span style="color: #000000;">12961221</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.30</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">12961221</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">9363707</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">9363707</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">nRecSelColor</span> := <span style="color: #000000;">16777215</span> &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//aqui le pongo el color de fondo del header.</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrHeader</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">16777215</span>, <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> &nbsp; &nbsp; <span style="color: #B900B9;">//aqui</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrFooter</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; elseif cColor = <span style="color: #ff0000;">"XXXXX"</span><br />&nbsp; &nbsp; ...<br />&nbsp; <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span></div>[/code:1lwoi05j]
xbrowse record selector column
listo Gracias, Saludos
xbrowse recuperar el aArrayData despues de modificar?
Buenas,. Mi ingenieria de la cabeza hizo esto: [code=fw:rp352q3l]<div class="fw" id="{CB}" style="font-family: monospace;">  ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">setarray</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aDatos</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:rp352q3l] y en un método aparte necesito hacer una inserción de columna en el xbrowse, y lo logre haciendo esto: [code=fw:rp352q3l]<div class="fw" id="{CB}" style="font-family: monospace;"> <br />      AEval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDatos</span>, <span style="color: #000000;">&#123;</span> | a, n | AAdd<span style="color: #000000;">&#40;</span> a, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      ...<br /><br />&nbsp; &nbsp; &nbsp; WITH OBJECT ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">InsCol</span><span style="color: #000000;">&#40;</span> nCol <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">cHeader</span>       := ::<span style="color: #000000;">aDatosDividir</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">03</span> <span style="color: #000000;">&#93;</span><br />         :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">80</span><br />         :<span style="color: #000000;">bStrData</span> := ;<br />                      <span style="color: #000000;">&#123;</span> | a, xAt, cAuxiliar | cAuxiliar := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>, nCol <span style="color: #000000;">&#93;</span>, ;<br />                        xAt := <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDatosDividir</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">02</span> <span style="color: #000000;">&#93;</span>, cAuxiliar <span style="color: #000000;">&#41;</span>, ;<br />                        cAuxiliar := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cAuxiliar, <span style="color: #000000;">1</span>, xAt <span style="color: #000000;">&#41;</span> ;<br />                      <span style="color: #000000;">&#125;</span><br />      END<br /><br />      WITH OBJECT ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>ncol<span style="color: #000000;">+1</span><span style="color: #000000;">&#93;</span><br />         :<span style="color: #000000;">bStrData</span> := ;<br />                      <span style="color: #000000;">&#123;</span> | a, xAt, cAuxiliar | cAuxiliar := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>, nCol <span style="color: #000000;">&#93;</span>, ;<br />                        xAt := <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDatosDividir</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">02</span> <span style="color: #000000;">&#93;</span>, cAuxiliar <span style="color: #000000;">&#41;</span>, ;<br />                        cAuxiliar := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cAuxiliar, xAt+Len<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aDatosDividir</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">02</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />                      <span style="color: #000000;">&#125;</span><br />      END<br /> </div>[/code:rp352q3l] Pero... cuando quiero ver el contenido de ::oBrw:aArrayData los valores que aparecen en el xbrowse no existen en la columna, solo existen "visualmente" porque me esta pasando esto? gracias.
xbrowse recuperar el aArrayData despues de modificar?
Entiendo que tendrías que modificar ::oBrw:aArrayData para que los cambios no solo se realicen en el browse
xbrowse recuperar el aArrayData despues de modificar?
asi es! gracias.
xbrowse refresh
Hi I have a array xbrowse but If add a first record the xbrowse still empty, but if i move the mouse in xbrowse area the record show. This is my code: AADD( VetItem, { Cod_Pro , Nom_Pro, oArqItem:UNIDADE , Qtd_Pro, Tip_Ava, oArqItem:VALORUN, oArqItem:VALIDADE, oArqItem:EAN, Num_Not }) oBrw:SetArray( VetItem) oBrw:nHeaderHeight :=30 oBrw:nStretchCol := STRETCHCOL_LAST oBrw:GoBottom() oBrw:Refresh() xSetFocus(oBrw) Any sugestion? Thanks in advance. Wanderson.
xbrowse refresh
Intenta en este orden, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> [code=fw:1awm0mgv]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">nHeaderHeight</span> :=<span style="color: #000000;">30</span><br />oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /><br />oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> VetItem<span style="color: #000000;">&#41;</span><br /><br />oBrw:<span style="color: #000000;">GoBottom</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 />xSetFocus<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br /> </div>[/code:1awm0mgv]
xbrowse refresh
[quote="joseluisysturiz":2klizagq]Intenta en este orden, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> [code=fw:2klizagq]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">nHeaderHeight</span> :=<span style="color: #000000;">30</span><br />oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /><br />oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> VetItem<span style="color: #000000;">&#41;</span><br /><br />oBrw:<span style="color: #000000;">GoBottom</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 />xSetFocus<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br /> </div>[/code:2klizagq][/quote:2klizagq] Perfect! Thank you very much!
xbrowse refresh with new recordset
Hello, I'm converting a dialog with 2 listbox to xbrowse The two browses are browsing a recordset. When the first one is change, I update the second recordset (not a filter, but running a new guery) and do a refresh() With the listbox this is working fine, but with xbrowse it doesn't work. If the second browse is showing only one record after calling the dialog, if keeps on displaying only one record, even when I change the first one. The data of the first line is updated, but not the number of fields <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I already tried to so a setado(oRs) again with the new recordset, but that doesn't work.
xbrowse refresh with new recordset
Marc I think I understand what you are doing .. and what is interesting about xBrowse .. is that you can oRs2:Close() the recordset ( without destroying oLbx2 ) and then re-open\create the oRs2 recordset again with a new query which will probably capture your new records .. as long as the same query and fields are used and re-associated with the same oLbx2 xBrowse .. here is the pseudo code : Create recordset oRs1 for the first xBrowse oLbx1 Create recordset oRs2... "Select Field1,Field2,Field3 where <some condition>" that ties back to the first recordset and xBrowse oLbx2 xbrowse 1 .. creates a new record oRs2:CLose() Re-create the same oRs2 recordset but now sql picks up the new record in your query oRs2.... "Select Field1,Field2,Field3 where <some condition>" that ties back to the first recordset oLbx2:ReFresh() .. using the same oRs2 value .. What this code attempts to do is like a oRs2:ReQuery() , but you are actually closing the second recordset oRs2 and then re-creating the same recordset oRs2 which should return the results of the new row created in your first browse.. So why not just use oRs2:ReQuery() then oLbx2:ReFresh() .... sometimes that works and other times it does not based on how quickly the Sql Database can cache its new rows. When you issue a new query using the same oRs2 conditions .. generally the database will return the new appended row based on the parameters of the conditions of the first listbox. Hope that made sense and I understood your question. Rick Lipkin
xbrowse refresh with new recordset
Is this master-child browse? oBrw2:oRs:Close() oBrw2:oRs := FW_OpenRecordSet( <NewQuery> ) oBrw2:GoTop() oBrw2:Refresh() Note: You can also consider Data Shaping for master-child browses
xbrowse refresh with new recordset
Thank you Rao, Now it's working. My recordset is called 'oRSBlocks' So I had to do: [code=fw:qa0hwqlj]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw2:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRSBlocks := haalC300CMBlocks<span style="color: #000000;">&#40;</span>vCM<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Function that return new recordset</span><br />oBrw2:<span style="color: #000000;">oRs</span> := oRSBlocks<br />oBrw2:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />oBrw2:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp;</div>[/code:qa0hwqlj] Rick, I can't do a requery(), because it's another query, but with the same returned fieldnames. When I first did a oRs2:close(), before reading the new query, I had an error. So I did [code=fw:qa0hwqlj]<div class="fw" id="{CB}" style="font-family: monospace;">oRs2 = haalC300CMBlocks<span style="color: #000000;">&#40;</span>vCM<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//Function that return new recordset</span><br />oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:qa0hwqlj] without closing it, but with bad result <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
xbrowse refresh with new recordset
The problem was not with closing or not closing. You assigned new recordset object to oRs2 But oBrw:oRs was still pointing to the old recordset. In my suggestion, you are now assigning the new recordset to oBrw:oRs. This makes it work.
xbrowse refresh with new recordset
Hello, i have a problem The idea is to type the code by hand or from a listbox, and update the description column for this use the codeblock Helppre() ----------- oLbxp:aCols[ 5 ]:nEditType := EDIT_GET_BUTTON // // oLbxp:aCols[ 5 ]:bEditBlock := {||HelpcPres(oLbxp)} oLbxp:aCols[ 5 ]:bEditBlock := {||(if(Helppre(),VolHpre(.t.),VolHpre(.f.)),.t.)} --------------------------- Pressing the button displays the browse to select code, return it and put the description column 7 if I put this code in the VOLPRE functions, not updated anything If lVol oLbxp:aCols[ 5 ]:Value := cpres->pr_codi oLbxp:aCols[ 7 ]:Value := cpres->pr_desc Else if I put this other code (I have seen it is not advisable to use it) but updated code and description of the two lines If lVol oLbxp:aCols[ 5 ]:bStrData := cpres->pr_codi oLbxp:aCols[ 7 ]:bStrData := cpres->pr_desc Else [code=fw:2btli5b4]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> Lineas<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> codpre :=<span style="color: #ff0000;">"  "</span><br />   XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">&#41;</span><br />   <br />       DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"pliva"</span><span style="color: #000000;">&#41;</span><br />       pliva-><span style="color: #000000;">&#40;</span>DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />       DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bliva"</span><span style="color: #000000;">&#41;</span><br />       bliva-><span style="color: #000000;">&#40;</span>ORDSETFOCUS<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"obra"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDDAbmLins <span style="color: #0000ff;">OF</span> oWndIva <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"IVA_LINS"</span><br />          <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oLbx <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDDAbmlins;<br />             HEADERS <span style="color: #ff0000;">"N.Obra"</span>,<span style="color: #ff0000;">"Asiento"</span>,<span style="color: #ff0000;">"Fecha"</span>,<span style="color: #ff0000;">"Cuenta"</span>,<span style="color: #ff0000;">"Cpto."</span>,<span style="color: #ff0000;">"Descripcion"</span>,<span style="color: #ff0000;">"Base"</span>,<span style="color: #ff0000;">"Tipo"</span>;<br />             COLUMNS <span style="color: #ff0000;">"Obra"</span>, <span style="color: #ff0000;">"Asiento"</span>, <span style="color: #ff0000;">"fecha"</span>,<span style="color: #ff0000;">"Cuenta"</span>,<span style="color: #ff0000;">"Concepto"</span>,<span style="color: #ff0000;">"Descrip"</span>,<span style="color: #ff0000;">"Base"</span>,<span style="color: #ff0000;">"tipo"</span> ;<br />             SIZES <span style="color: #000000;">50</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">65</span>,<span style="color: #000000;">55</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">210</span>,<span style="color: #000000;">90</span>,<span style="color: #000000;">33</span>;<br />                  <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bliva"</span><span style="color: #000000;">&#41;</span>;<br />                  <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span>Toma_Lin<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,PonerScope<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bliva"</span>,<span style="color: #ff0000;">"Pliva"</span>,oLbxp<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />          olBx:<span style="color: #000000;">lHScroll</span>:=.F.  <span style="color: #B900B9;">//windows style en el recurso = 0x50210000 en .f. no funciona</span><br /><br />          <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oLbxp <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">OF</span> oDDAbmlinp;<br />             HEADERS <span style="color: #ff0000;">"N.Obra"</span>,<span style="color: #ff0000;">"Asiento"</span>,<span style="color: #ff0000;">"Fecha"</span>,<span style="color: #ff0000;">"Cuenta"</span>,<span style="color: #ff0000;">"Prespto."</span>,<span style="color: #ff0000;">"Natu"</span>,<span style="color: #ff0000;">"Descripcion"</span>,<span style="color: #ff0000;">"Importe"</span>;<br />             COLUMNS <span style="color: #ff0000;">"PL_OBRA"</span>, <span style="color: #ff0000;">"PL_NUMASI"</span>, <span style="color: #ff0000;">"PL_FECHA"</span>,<span style="color: #ff0000;">"PL_CUENTA"</span>,<span style="color: #ff0000;">"PL_PRES"</span>,<span style="color: #ff0000;">"PL_NATU"</span>,<span style="color: #ff0000;">"PL_DESC"</span>,<span style="color: #ff0000;">"PL_IMPORT"</span> ;<br />             SIZES <span style="color: #000000;">50</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">55</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">210</span>,<span style="color: #000000;">85</span>;<br />             AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> FASTEDIT LINES CELL FOOTERS;<br />                  <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"pliva"</span>;<br />                  <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span>oLbxp:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oLbxp:<span style="color: #0000ff;">refresh</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />               oLbxp:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span>   := EDIT_GET_BUTTON <br /><span style="color: #B900B9;">//             oLbxp:aCols[ 5 ]:bEditBlock  := {||HelpcPres(oLbxp)}</span><br />               oLbxp:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditBlock</span>  := <span style="color: #000000;">&#123;</span>||<span style="color: #000000;">&#40;</span><span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>Helppre<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,VolHpre<span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span>,VolHpre<span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />               oLbxp:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span>   := EDIT_GET<br />             oLbxp:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDDAbmLins <span style="color: #0000ff;">NOWAIT</span>;<br />            <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oLbx:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,PonerScope<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bliva"</span>,<span style="color: #ff0000;">"pliva"</span>,oLbxp<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />       DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"bliva"</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: #B900B9;">//----------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> VolHpre<span style="color: #000000;">&#40;</span>lVol<span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">If</span> lVol<br />      oLbxp:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> := cpres->pr_codi<br />      oLbxp:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> := cpres->pr_desc<br />    <span style="color: #00C800;">Else</span><br />      oLbxp:<span style="color: #000000;">gotocol</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">EndIf</span><br />    oLbxp:<span style="color: #000000;">gotocol</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br />    DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"pliva"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:2btli5b4] [img:2btli5b4]http&#58;//i&#46;imgur&#46;com/8JVgnAh&#46;png[/img:2btli5b4] the code for Helppre(), thir work fine in other cases [code=fw:2btli5b4]<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;">Static</span> lSel,oDlg, oLbxhpPre<br /><br /><span style="color: #00C800;">FUNCTION</span> HelpPre<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cPres"</span><span style="color: #000000;">&#41;</span><br />       lSel:=.F.<br />       SetKey_Hlp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HLP1"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Ayuda Conceptos Presupuestarios"</span><br /><br />         <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oLbxhpPre <span style="color: #0000ff;">ID</span> <span style="color: #000000;">110</span> <span style="color: #0000ff;">OF</span> oDlg;<br />             HEADERS <span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Naturaleza"</span>,<span style="color: #ff0000;">"Descripcion"</span>;<br />             COLUMNS <span style="color: #ff0000;">"pr_codi"</span>, <span style="color: #ff0000;">"pr_natu"</span>, <span style="color: #ff0000;">"pr_desc"</span>;<br />             SIZES <span style="color: #000000;">50</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">210</span>;<br />         AUTOSORT FOOTERS LINES CELL ;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">LEFT</span> DBLCLICK <span style="color: #000000;">&#40;</span>lSel:=.T.,oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>; <br />         <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"cPres"</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;">ON</span> <span style="color: #0000ff;">INIT</span> olbxhpPre:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />           <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>DelKey_Hlp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> lSel<br /><br /><span style="color: #B900B9;">//------------------------------------//</span><br /><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> SetKey_Hlp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       SET KEY VK_RETURN <span style="color: #0000ff;">TO</span> Hlp_Ok<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 /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> Hlp_OK<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       lSel:=.t.<br />       oDlg:<span style="color: #000000;">End</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 /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> DelKey_Hlp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       SET KEY VK_RETURN <span style="color: #0000ff;">TO</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2btli5b4]
xbrowse refresh with new recordset
bStrData expects a codeblock, try this: oLbxp:aCols[ 5 ]:bStrData := { || cpres->pr_codi } oLbxp:aCols[ 7 ]:bStrData := { || cpres->pr_desc }
xbrowse refresh with new recordset
Ok, gracias Antonio, funciona
xbrowse report & Preview style
[img:1yq2uepl]https&#58;//i&#46;postimg&#46;cc/j5KSsXMV/lk&#46;png[/img:1yq2uepl] to make fast I made oThis:oLbx:report() But if I wish print al so the lines ? (Horizontal e and vertical separators) How I can do ? I notice on Windows 10 the style of Preview bar is not for Windows 10 but it is also 2007 style, how change it ?
xbrowse report & Preview style
Dear Silvio, For the first question: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15578&start=0&hilit=xbrowse+preview+bsetup">viewtopic.php?f=3&t=15578&start=0&hilit=xbrowse+preview+bsetup</a><!-- l -->
xbrowse report & Preview style
[quote="Antonio Linares":hyrh2zt6]Dear Silvio, For the first question: <!-- m --><a class="postlink" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15578&start=0&hilit=xbrowse+preview+bsetup">http://forums.fivetechsupport.com/viewt ... iew+bsetup</a><!-- m -->[/quote:hyrh2zt6] Antonio, I Tried with local bSetUp := {|oRep| oRep:CellView()} @ 100,10 BUTTON oBtnPrint PROMPT "Stampa" of oDlg; SIZE 80,22 ; ACTION oBrw:Report( cTitle, .t., , bSetUp ) but I see only the horizontal lines sample: or local bSetUp := {|oRep, oBrw, n| RepSetUp( oRep, oBrw, n )} static function RepSetUp( oRep, oBrw, n ) oRep:lJoin := .t. oRep:lSeparator := .t. oRep:lBoxOnTotal := .t. AEval(oRep:aColumns, {|o| o:lGrid := .t.} ) return nil [img:hyrh2zt6]https&#58;//i&#46;postimg&#46;cc/VvsQCnns/h&#46;png[/img:hyrh2zt6] I not see vertical lines
xbrowse report & Preview style
[code=fw:3t5gz6ny]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; bSetUp &nbsp; := < |oRep, Brw, n |<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> n == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #000000;">CellView</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; ><br /><br />oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> cTitle, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, bSetup <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:3t5gz6ny]
xbrowse report & Preview style
[code=fw:26lnm1f3]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; bSetUp &nbsp; := < |oRep, Brw, n |<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> n == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #000000;">CellView</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; ><br /><br />oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> cTitle, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, bSetup <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:26lnm1f3]
xbrowse report & Preview style
[quote="nageswaragunupudi":jgx5n2et][code=fw:jgx5n2et]<div class="fw" id="{CB}" style="font-family: monospace;">   bSetUp   := < |oRep, Brw, n |<br />      <span style="color: #00C800;">if</span> n == <span style="color: #000000;">2</span><br />         oRep:<span style="color: #000000;">CellView</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 />      <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">return</span> <span style="color: #000000;">2</span><br />      ><br /><br />oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> cTitle, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, bSetup <span style="color: #000000;">&#41;</span><br /> </div>[/code:jgx5n2et][/quote:jgx5n2et] thanks what you mean for n? look the image [img:jgx5n2et]https&#58;//i&#46;postimg&#46;cc/bJwB5SML/jjjjj&#46;jpg[/img:jgx5n2et] 1. the multiheader non have the line 2. there are blank pages every page created in all 7 pages of which three are blank 3.on Pdf there are not blank page, there are only 4 pages but the number of page are 1,3,5,7 I sent you the pdf
xbrowse report setup
to make a report I use easy [b:1jr1bhkh]oBrw:Report("Stampa elenco", nil, nil, bSetup)[/b:1jr1bhkh] where bSetup is [code=fw:1jr1bhkh]<div class="fw" id="{CB}" style="font-family: monospace;">bSetUp   := < |oRep, Brw, n |<br />      <span style="color: #00C800;">if</span> n == <span style="color: #000000;">2</span><br />         oRep:<span style="color: #000000;">CellView</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 />      <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">return</span> <span style="color: #000000;">2</span><br />      ></div>[/code:1jr1bhkh] If I wish add fonts ? If I wish add aGroupby ? If I wish add a transparent image on background ? how I can do ? I tried with (but not run ) bSetUp := < |oRep, Brw, n | [b:1jr1bhkh] bImage := {|oRep| oRep:SayBitmap(0.5, 7, "NEW_REC")} bStart := {|oRep| oRep:bStartPage := bImage}[/b:1jr1bhkh] if n == 2 oRep:CellView() return nil endif return 2 >
xbrowse required bug fixes !
Another bug fixed: [code=fw:1ckpxpw2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrwColumn<br /><br />...<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aBitmaps</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; PalBmpFree<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aBitmaps</span><span style="color: #000000;">&#91;</span> nFor, BITMAP_HANDLE <span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">aBitmaps</span><span style="color: #000000;">&#91;</span> nFor, BITMAP_PALETTE <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:1ckpxpw2]
xbrowse required bug fixes !
After testing the code that we have published here: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15935">viewtopic.php?f=3&t=15935</a><!-- l --> we have detected some errors in Class TXBrowse that must be fixed: 1) Method End() has to be renamed as Destroy(). It was wrong. And finally call return Super:Destroy() 2) This code is needed in Method CreateButtons() before the @ ..., ... : [code=fw:3u9zme9p]<div class="fw" id="{CB}" style="font-family: monospace;"> <br />      <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oBtnList</span> != <span style="color: #00C800;">nil</span><br />         ::<span style="color: #000000;">oBtnList</span>:<span style="color: #000000;">End</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;">if</span> ::<span style="color: #000000;">oBtnElip</span> != <span style="color: #00C800;">nil</span><br />         ::<span style="color: #000000;">oBtnElip</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span>  <br /> </div>[/code:3u9zme9p] 3) In function function TXBrows() the browse is not destroyed: [code=fw:3u9zme9p]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> bChild <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'B'</span><br />      bXBr:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      bXBr := bChild<br />   <span style="color: #00C800;">endif</span><br /> </div>[/code:3u9zme9p] 4) PalBmpFree() is not properly working. This function should be added: [code=fw:3u9zme9p]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00C800;">function</span> PalBmpFree<span style="color: #000000;">&#40;</span> hBmp, hPal <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> hBmp <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DeleteObject<span style="color: #000000;">&#40;</span> hPal <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:3u9zme9p]
xbrowse required bug fixes !
Hello Antonio, what version of xBrowse is affected ? Thanks in advance Otto
xbrowse required bug fixes !
Otto, The Method End(), that must be Destroy(), affects to all xbrowse versions. The PalBmpFree() may also affect to all xbrowse versions. The others two, can't say the exact version right now. Better look in your xbrowse.prg code for those sections. Thanks,
xbrowse required bug fixes !
Good <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
xbrowse required bug fixes !
Antonio, do you plan to release 9.06 before the month end ? (I'd prefer having the bugfixes already included in the standard lib rather than including another obj) Thanks, Davide
xbrowse required bug fixes !
Davide, We are working hard to deliver 9.06 before end of this month. But we can't promise it yet <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse reset incr.-seekstring on btn-action ?
Hello, I want to clear a xbrowse incr.-seekstring on button-action and go to browser-top, but it doesn't work : I can clear the seek but after that, it is not possible to seek again. Going to browser-top doesn't work. 1. incr. seek 2. change values 3. save 4. reset seek-string ( on save-button or using the extra button ) 5. browser go top [color=#008000:2fmtduyd][b:2fmtduyd]WITH OBJECT oBrw1 :lIncrFilter := .t. :lSeekWild := .t. cSeek := "", oBrw1:oSeek:Refresh() } END[/b:2fmtduyd][/color:2fmtduyd] [color=#008040:2fmtduyd][b:2fmtduyd]REDEFINE SAY oBrw1:oSeek PROMPT oBrw1:cSeek ID 920 OF oDlg1 PIXEL FONT oFontSmall oBrw1:oSeek:Setcolor( 0, 16777215 )[/b:2fmtduyd][/color:2fmtduyd] the button-action [color=#0000FF:2fmtduyd][b:2fmtduyd]ACTION ( DBGOTOP(), oBrw1:Refresh(),; oBrw1:cSeek := "", ; oBrw1:oSeek:Refresh() ) ;[/b:2fmtduyd][/color:2fmtduyd] [img:2fmtduyd]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Incseek1&#46;jpg[/img:2fmtduyd] any idea ? best regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xbrowse reset incr.-seekstring on btn-action ?
[code=fw:3tuqq86l]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT oBrw<br />&nbsp; &nbsp;:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;:<span style="color: #000000;">lIncrFilter</span> := .t.<br />&nbsp; &nbsp;:<span style="color: #000000;">lSeekWild</span> := .t.<br />END</div>[/code:3tuqq86l]
xbrowse reset incr.-seekstring on btn-action ?
Mr.Rao, thank You very much for thr info. I found XBIncflt.prg in /samples and added buttons. It works like for the combos. [color=#0000FF:3h0oi73j][b:3h0oi73j]ACTION ( oBrw:Seek( "" ), oBrw:SetFocus() ) ;[/b:3h0oi73j][/color:3h0oi73j] [img:3h0oi73j]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Reset1&#46;jpg[/img:3h0oi73j] best regards Uwe <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
xbrowse row colours
Dear community, I have tried to give a row another colour and it worked with this code. [b:139b7gpy]oBrw:bClrStd := { || If( (cust->resstatus = "###Cancelled" .and. cust->guarancode = " "), { CLR_WHITE, CLR_RED }, { CLR_BLACK,CLR_WHITE } ) } //@IA 2020030[/b:139b7gpy] How can I integrate another colour for another request? /* oBrw:bClrStd := { || If( ((cust->resstatus = "Waitlisted" .or. cust->resstatus = "Reserved" ).and. cust->guarancode = " "), ; { CLR_WHITE, CLR_GREEN }, { CLR_BLACK,CLR_WHITE } ) } //@IA 20200301*/ Do I have to use elseif in the oBrw:bClrStd? If( (cust->resstatus = "###Cancelled" .and. cust->guarancode = " ") --> backgroundcolur should be red If( ((cust->resstatus = "Waitlisted" .or. cust->resstatus = "Reserved" ).and. cust->guarancode = " ") --> backgroundcolur should be green Thank you in advance and kind regards Iris
xbrowse row colours
Iris, if the condition to set the colors is very complicated, I advise you to use a function that returns the corresponding color array [code=fw:4ze8vlxa]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || MyColors<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />.../...<br /><br /><span style="color: #00C800;">Function</span> MyColors<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> aColors := <span style="color: #000000;">&#123;</span> , <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> <span style="color: #000000;">&#40;</span>cust->resstatus = <span style="color: #ff0000;">"###Cancelled"</span> .and. cust->guarancode = <span style="color: #ff0000;">" "</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aColors := <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_RED <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <other condition><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aColors := <span style="color: #000000;">&#123;</span> ...., &nbsp;..... <span style="color: #000000;">&#125;</span> &nbsp; &nbsp;etc.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aColors &nbsp;:= <span style="color: #000000;">&#123;</span> CLR_BLACK,CLR_WHITE <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;.../...<br /><br /><br /><span style="color: #00C800;">Return</span> aColors<br /><br />&nbsp;</div>[/code:4ze8vlxa]
xbrowse row colours
Thank you!
xbrowse row colours
I have just tried it, It worked perfectly, thank you, Cristobal!
xbrowse row colours
Dear Iris, another way is to define the codeblock like this: [quote:3swp7z9q] Extended literal code block. Syntax <| [<params,...>] | <programcode> > [/quote:3swp7z9q] [code=fw:3swp7z9q]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">bClrStd</span> := <||<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> aColors := <span style="color: #000000;">&#123;</span> , <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> <span style="color: #000000;">&#40;</span>cust->resstatus = <span style="color: #ff0000;">"###Cancelled"</span> .and. cust->guarancode = <span style="color: #ff0000;">" "</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;aColors := <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_RED <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <other condition><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aColors := <span style="color: #000000;">&#123;</span> ...., &nbsp;..... <span style="color: #000000;">&#125;</span> &nbsp; &nbsp;etc.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aColors &nbsp;:= <span style="color: #000000;">&#123;</span> CLR_BLACK,CLR_WHITE <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;.../...<br /><span style="color: #00C800;">Return</span> aColors<br />><br />&nbsp;</div>[/code:3swp7z9q]
xbrowse settings to ini file - TO Antonio
I saw your xbrowse sample test ( testxbr4.prg) I like it and inserted on my customer window your menu to set style of xbrowse and set the background images. When I close the application it not save all sets . I wish to save all the sets on file ini to restore it when the user return on the customer window. Have you an Idea to create it ? I made for ConfigMenu( oBrw ) [b:3jrnixj2] WritePProString(INIBROWSE,"Marquee",ltrim(str(oApp():oGrid:nMarqueeStyle)),oApp():cIniFile) ,; WritePProString(INIBROWSE,"RowLineStyle",ltrim(str(oApp():oGrid:nRowDividerStyle)),oApp():cIniFile) ,; WritePProString(INIBROWSE,"ColLineStyle",ltrim(str(oApp():oGrid:nColDividerStyle)),oApp():cIniFile) ,; WritePProString(INIBROWSE,"FontSize",str(oApp():oGrid:FontSize()),oApp():cIniFile) ,; WritePProString(INIBROWSE,"Stretch",ltrim(str(oApp():oGrid:nStretchCol)),oApp():cIniFile) ,; WritePProString(INIBROWSE,"NoFreeze",ltrim(str(oApp():oGrid:nFreeze)),oApp():cIniFile) , ; WritePProString(INIBROWSE,"BackGround",oApp():oGrid:oBrush:cBmp,oApp():cIniFile) , ; WritePProString(INIBROWSE,"BackMode",ltrim(str(oApp():oGrid:nBckMode)),oApp():cIniFile) , ; WritePProString(INIBROWSE,"l2007",IIF(oApp():oGrid:l2007,"1","0"),oApp():cIniFile) , ; WritePProString(INIBROWSE,"lFastEdit",IIF(oApp():oGrid:lFastEdit,"1","0"),oApp():cIniFile) , ;[/b:3jrnixj2] but it save on ini file only these variables Marquee=0 RowLineStyle=4 ColLineStyle=4 Stretch=-2 NoFreeze=0 BackMode=0 l2007=1 lFastEdit=0 it not save the font size why ? and I cannot save the name o the file of background and for BackMenu( oBrw ) I must save the image I set on background but I not Know how save it but I can save the type mode of this background with WritePProString(INIBROWSE,"BackMode",ltrim(str(oApp():oGrid:nBckMode)),oApp():cIniFile) , ; I try with WritePProString("Config","BackG",oApp():oGrid:oBrush:hBrush,oApp():cIniFile) , ; but it not save any string
xbrowse sin scrooll no entiendo como sacar el borde
hola. hice esto en el style del xbrowse utilizando peles: 0x50C00000 pero me hace un borde, yo necesito sacarle ese borde y que no aparezcan las barras de scrooll. no entiendo como son los estilos utilizando el pelles, donde hay info? gracias
xbrowse slow
Mr. Rao please help me, my xbrowse is slow on network. it contains only 12,000 registers, I note that is slow when I use : oBrw:lIncrFilter := .t. oBrw:lSeekWild := .t. oBrw:cFilterFld := "RUC" If I omitt these sentences, the movement into xbrowse is normal, but I want that xbrowse has search incremental I use CDX and DBf's I open all tables at the beginning of the program [code=fw:32gqhyn2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw                      ;<br />      <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"MCODI"</span>                           ;<br />      COLUMNS <span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Ng"</span>,<span style="color: #ff0000;">"RUC"</span>,<span style="color: #ff0000;">"Te"</span>,<span style="color: #ff0000;">"Di"</span>   ;<br />      FIELDSIZES <span style="color: #000000;">50</span>, <span style="color: #000000;">195</span>,<span style="color: #000000;">75</span>,<span style="color: #000000;">120</span>, <span style="color: #000000;">100</span>          ;<br />      HEADERS <span style="color: #ff0000;">"CODIGO"</span>                        ;<br />             ,<span style="color: #ff0000;">"RAZÓN SOCIAL"</span>                  ;<br />             ,<span style="color: #ff0000;">"NO. IDENT."</span>                    ;<br />             ,<span style="color: #ff0000;">"TELÉFONOS"</span>                     ;<br />             ,<span style="color: #ff0000;">"DIRECCIÓN"</span>                     ;<br />      <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4001</span> <span style="color: #0000ff;">OF</span> oDlg                         ;<br />      AUTOSORT                                ;<br />      LINES CELL <span style="color: #B900B9;">//;</span><br />      oBrw:<span style="color: #000000;">bKeyDown</span>   := <span style="color: #000000;">&#123;</span> |nKey| ProcMtn<span style="color: #000000;">&#40;</span>nKey, nTipo<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrw:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> || ProcMtn<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span>, nTipo <span style="color: #000000;">&#41;</span>     <span style="color: #000000;">&#125;</span><br />      oBrw:<span style="color: #000000;">nMarqueeStyle</span>    = MARQSTYLE_HIGHLROW<br />      oBrw:<span style="color: #000000;">lIncrFilter</span> := .t.<br />      oBrw:<span style="color: #000000;">lSeekWild</span> := .t.<br />      oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"RUC"</span>      <br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">VAR</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">204</span>,<span style="color: #000000;">204</span>,<span style="color: #000000;">102</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//COLOR CLR_HRED,CLR_YELLOW</span><br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:32gqhyn2]
xbrowse slow
Mr. Rao please help me, my xbrowse is slow on network. it contains only 12,000 registers, I note that is slow when I use : oBrw:lIncrFilter := .t. oBrw:lSeekWild := .t. oBrw:cFilterFld := "RUC" If I omitt these sentences, the movement into xbrowse is normal, but I want that xbrowse has search incremental I use CDX and DBf's I open all tables at the beginning of the program [code=fw:2zkgfqcn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw                      ;<br />      <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"MCODI"</span>                           ;<br />      COLUMNS <span style="color: #ff0000;">"Codigo"</span>,<span style="color: #ff0000;">"Ng"</span>,<span style="color: #ff0000;">"RUC"</span>,<span style="color: #ff0000;">"Te"</span>,<span style="color: #ff0000;">"Di"</span>   ;<br />      FIELDSIZES <span style="color: #000000;">50</span>, <span style="color: #000000;">195</span>,<span style="color: #000000;">75</span>,<span style="color: #000000;">120</span>, <span style="color: #000000;">100</span>          ;<br />      HEADERS <span style="color: #ff0000;">"CODIGO"</span>                        ;<br />             ,<span style="color: #ff0000;">"RAZÓN SOCIAL"</span>                  ;<br />             ,<span style="color: #ff0000;">"NO. IDENT."</span>                    ;<br />             ,<span style="color: #ff0000;">"TELÉFONOS"</span>                     ;<br />             ,<span style="color: #ff0000;">"DIRECCIÓN"</span>                     ;<br />      <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4001</span> <span style="color: #0000ff;">OF</span> oDlg                         ;<br />      AUTOSORT                                ;<br />      LINES CELL <span style="color: #B900B9;">//;</span><br />      oBrw:<span style="color: #000000;">bKeyDown</span>   := <span style="color: #000000;">&#123;</span> |nKey| ProcMtn<span style="color: #000000;">&#40;</span>nKey, nTipo<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      oBrw:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> || ProcMtn<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span>, nTipo <span style="color: #000000;">&#41;</span>     <span style="color: #000000;">&#125;</span><br />      oBrw:<span style="color: #000000;">nMarqueeStyle</span>    = MARQSTYLE_HIGHLROW<br />      oBrw:<span style="color: #000000;">lIncrFilter</span> := .t.<br />            oBrw:<span style="color: #000000;">lSeekWild</span> := .t.<br />            oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"RUC"</span>        <br />    <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">VAR</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">204</span>,<span style="color: #000000;">204</span>,<span style="color: #000000;">102</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//COLOR CLR_HRED,CLR_YELLOW</span><br />    <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">NOWAIT</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">setfocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:2zkgfqcn]
xbrowse slow
1.Please check if you have an index tag on UPPER(RUC) 2.May I see the index keys for all tags?
xbrowse slow
Sorry to jump in. I don't think that my xbrowse is slow, but it seems in this post that how the index is build could have affect on speed. Therefore here my index routine : [code=fw:uq9ridfs]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Reindex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  close master<br />  ferase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master.cdx"</span><span style="color: #000000;">&#41;</span><br />  use master <span style="color: #00C800;">NEW</span><br />  <span style="color: #0000ff;">select</span> master<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->code<span style="color: #000000;">&#41;</span> TAG code<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->lev_naam<span style="color: #000000;">&#41;</span> TAG levnaam<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->naam<span style="color: #000000;">&#41;</span> TAG naam<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->lev_ref<span style="color: #000000;">&#41;</span> TAG levref<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->fab_ref<span style="color: #000000;">&#41;</span> TAG fabref<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->fab_naam<span style="color: #000000;">&#41;</span> TAG fabnaam<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> master->selection TAG selected<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> str<span style="color: #000000;">&#40;</span>val<span style="color: #000000;">&#40;</span>master->pagina<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1000</span><span style="color: #000000;">&#41;</span> TAG pagina<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> master->cat_main+master->Cat_sub1 TAG cat<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> master->Cat_sub1+master->fab_naam TAG catsub<br /><br />  <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Reindex compleet"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:uq9ridfs] Is this code ok for Xbrowse performance ?
xbrowse slow
Marc Don't know if this will help, but I remember reading that the database pointer is stored in the index .. try to remove Master-> and just reference your fieldname .. As far as using Upper() .... I would go in to your table and replace all your primary keys with Replace all xxx with Upper( xxx ) .. try to keep your index keys free of pointers and function calls. Just my 2 cents worth.. Rick Lipkin
xbrowse slow
Rick, [quote:zh94y56w]As far as using Upper() .... I would go in to your table and replace all your primary keys with Replace all xxx with Upper( xxx ) .. try to keep your index keys free of pointers and function calls.[/quote:zh94y56w] Doing that, will have not the best effect in using the data in the application. Marc Venken would become MARC VENKEN and that is not ok for my use of the names. Thanks anyway...
xbrowse slow
[quote="Marc Venken":3mgvh609]Sorry to jump in. I don't think that my xbrowse is slow, but it seems in this post that how the index is build could have affect on speed. Therefore here my index routine : [code=fw:3mgvh609]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> Reindex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  close master<br />  ferase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master.cdx"</span><span style="color: #000000;">&#41;</span><br />  use master <span style="color: #00C800;">NEW</span><br />  <span style="color: #0000ff;">select</span> master<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->code<span style="color: #000000;">&#41;</span> TAG code<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->lev_naam<span style="color: #000000;">&#41;</span> TAG levnaam<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->naam<span style="color: #000000;">&#41;</span> TAG naam<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->lev_ref<span style="color: #000000;">&#41;</span> TAG levref<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->fab_ref<span style="color: #000000;">&#41;</span> TAG fabref<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> upper<span style="color: #000000;">&#40;</span>master->fab_naam<span style="color: #000000;">&#41;</span> TAG fabnaam<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> master->selection TAG selected<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> str<span style="color: #000000;">&#40;</span>val<span style="color: #000000;">&#40;</span>master->pagina<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1000</span><span style="color: #000000;">&#41;</span> TAG pagina<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> master->cat_main+master->Cat_sub1 TAG cat<br />  <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> master->Cat_sub1+master->fab_naam TAG catsub<br /><br />  <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Reindex compleet"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3mgvh609] Is this code ok for Xbrowse performance ?[/quote:3mgvh609] Very wrong practice to use table name as alias in the index expression. After building your index try to open the table with a different alias like this: [code=fw:3mgvh609]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE MASTER <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> MST SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br />SET ORDER <span style="color: #0000ff;">TO</span> TAG CODE<br /> </div>[/code:3mgvh609] You will get a runtime error complaining that the alias MASTER does not exist. This is the best way [code=fw:3mgvh609]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> BuildIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   field CODE, NAAM, ...........<br />   <br />   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span> CODE <span style="color: #000000;">&#41;</span> TAG CODE<br />   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> UPPER<span style="color: #000000;">&#40;</span> NAAM <span style="color: #000000;">&#41;</span> TAG NAAM<br />   ...<br />   ...<br /> </div>[/code:3mgvh609] You can also use FWH built in function FW_CdxCreate() This function creates index on any table for all fields. Character fields are indexed with UPPER function. In addition it also creates a tag INDEX ON DELETED() TAG DELETED In case you do not want index on all fields, but only on selected fields then you can use FW_CdxCreate( "CODE,NAAM,..." ) This is important because SET FILTER TO !DELETED() speeds up access of DBF having many deleted records and provides reliable results for OrdKeyNo() and OrdKeyCount()
xbrowse slow
[quote:18ef9b3x]Very wrong practice to use table name as alias in the index expression. After building your index try to open the table with a different alias like this: USE MASTER NEW ALIAS MST SHARED VIA "DBFCDX" SET ORDER TO TAG CODE You will get a runtime error complaining that the alias MASTER does not exist.[/quote:18ef9b3x] Yes. This is a important lesson i've learned now. I always did it wrong and yes I had that error. Always tried a work around because i din't knew. Thanks I have probably more wrong code <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> will update this one.
xbrowse slow
Dear Mr. Rao Now run perfect I had the index with Upper (may an insignificant thing costs a lot on network? ) Thanks
xbrowse slow
<!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=3&t=33776">viewtopic.php?f=3&t=33776</a><!-- l -->
xbrowse slow
[quote:g0deb2fe]I had the index with Upper (may an insignificant thing costs a lot on network? ) [/quote:g0deb2fe] Please keep index on UPPER(fieldname) ONLY. That is the only way to seek any value. - Create indexes without alias names. Please follow my example - Using FW_CdxCreate( [fieldslist] ) helps create good indexes - Creating index on "DELETED()" and then "SET FILTER TO !DELETED()" improves performance on dbfs having many deleted records. - On network, smaller index files improves performance.
xbrowse slow
Mr Rao: [color=#0040FF:sea31pi0]Yesterday the xbrowse worked fast after I delete the function UPPER as you suggested, but Today the xbrowse returned to work slow. The program show for moments the message: Application not responding [/color:sea31pi0] [color=#FF0080:sea31pi0] I don't understand, What is wrong? [/color:sea31pi0] this is my code for creating the index [code=fw:sea31pi0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />       FERASE<span style="color: #000000;">&#40;</span>cPathDBF+cSubCarp+<span style="color: #ff0000;">"MCODI"</span>+Exten<span style="color: #000000;">&#41;</span><br />       <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> VALTYPE<span style="color: #000000;">&#40;</span> AbreDbf<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"MCODI"</span>, .F., .F.,<span style="color: #ff0000;">"MCODI"</span> , cPathDBF+cSubCodi, , <span style="color: #ff0000;">"Clientes/Proveedores"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"O"</span><span style="color: #000000;">&#41;</span><br />         oS3:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Clientes / Proveedores"</span><span style="color: #000000;">&#41;</span><br />         IIF<span style="color: #000000;">&#40;</span>lPack,__dbPack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><br /><br />          <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> codigo               TAG <span style="color: #000000;">1</span><br />          <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> Ng                   TAG <span style="color: #000000;">2</span><br />          <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> ruc+CODUBI    TAG <span style="color: #000000;">3</span><br /><br /> </div>[/code:sea31pi0] - Create indexes without alias names. Please follow my example that is the way I create my indexes - Using FW_CdxCreate( [fieldslist] ) helps create good indexes Its not possible, I have fwh 13.01 - Creating index on "DELETED()" and then "SET FILTER TO !DELETED()" improves performance on dbfs having many deleted records. I will try that - On network, smaller index files improves performance. Build indexes with few fields, that's what you mean?
xbrowse slow
[quote:1z9q8tei] function BuildIndex() field CODE, NAAM, ........... INDEX ON UPPER( CODE ) TAG CODE INDEX ON UPPER( NAAM ) TAG NAAM ... ... [/quote:1z9q8tei] I see that you use : field CODE,NAAM, ..... before starting to index. Why is that ?
xbrowse slow
[quote:11zje8ru]I delete the function UPPER [/quote:11zje8ru] I never said not to use Upper. Actually we need Upper for character fields for proper searches. In my code above also I used Upper. Are you not using DBFCDX?
xbrowse slow
[quote="Marc Venken":37acr6ml][quote:37acr6ml] function BuildIndex() field CODE, NAAM, ........... INDEX ON UPPER( CODE ) TAG CODE INDEX ON UPPER( NAAM ) TAG NAAM ... ... [/quote:37acr6ml] I see that you use : field CODE,NAAM, ..... before starting to index. Why is that ?[/quote:37acr6ml] field is also is a declaration just like local, static. When we declare field CITY,AGE local nVar, cVar Then wherever we use CITY, AGE the compiler understands that it is a field name and when we use nvar and cvar it understands that it is a local variable. This declaration is helpful to use to create indexes, filter expressions without using alias->
xbrowse slow
Changed my index function with the FW_CdxCreate(cList) function. My browsing is clearly speeding up !! Thanks For the [color=#0000FF:2njuycd0]FW_CdxCreate()[/color:2njuycd0] function : The Forum and Google, the manuals also give no data on this function : There is a annoucment that the function is newly added [color=#0000FF:2njuycd0] FW_CdxCreate( [caTagList\ )[/color:2njuycd0] but not in the function list. I do know by now that not all functions are updated in the manuals (is very time consuming, i know) I figured out that it is inside the database class. I suppose for most of you it is common practice to look into classes and find the function, annalyse it and use it that way. I'm I correct in this assumption ? Doing that, I see inside the function that it also accepts a array. I suppose this array can be filled with the field, but also with the tagnames that I want. The CDX file is not deleted by the function. Should it be done before or not ? With a Fieldlist, it will be nessessary to at a "DELETED" in order to have that tag. It is this way to analyse right ? (of course I know that the Forum will always help !! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> )
xbrowse slow
[quote:1cldgnga]field is also is a declaration just like local, static. When we declare field CITY,AGE local nVar, cVar Then wherever we use CITY, AGE the compiler understands that it is a field name and when we use nvar and cvar it understands that it is a local variable. This declaration is helpful to use to create indexes, filter expressions without using alias->[/quote:1cldgnga] Ok, Than I will need to update some more code (I would like to do it good <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> ) 1. I hardly ever use Local 2. I never use field (had no idea) So I have always this kind of code : [code=fw:1cldgnga]<div class="fw" id="{CB}" style="font-family: monospace;">        <span style="color: #00C800;">case</span> upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>source->type,<span style="color: #000000;">8</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"GESLACHT"</span> .and. upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>source->waarde,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"PART"</span><br />         <span style="color: #00C800;">if</span> !empty<span style="color: #000000;">&#40;</span>target->geslacht<span style="color: #000000;">&#41;</span><br />             target->geslacht = alltrim<span style="color: #000000;">&#40;</span>target->geslacht<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />         <span style="color: #00C800;">endif</span><br />         target->geslacht = alltrim<span style="color: #000000;">&#40;</span>target->geslacht<span style="color: #000000;">&#41;</span> + alltrim<span style="color: #000000;">&#40;</span>source->waarde<span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">case</span> upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>source->type,<span style="color: #000000;">7</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"GEWICHT"</span><br /><br /><br /><span style="color: #00C800;">function</span> toptextxt<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   use c:\programmas\fotoselect\lever\topfull <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> source<br />   use master <span style="color: #00C800;">NEW</span><br />   <span style="color: #0000ff;">select</span> source<br />   source-><span style="color: #000000;">&#40;</span>dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !source-><span style="color: #000000;">&#40;</span>eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> master-><span style="color: #000000;">&#40;</span>dbseek<span style="color: #000000;">&#40;</span>source->Code<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> len<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>source->memo<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">1</span><br />            cMemo = <span style="color: #ff0000;">'<p><strong><span style="color: #4f77e6;"><span style="text-decoration: underline;">Eigenschappen</span> : </span></strong></p>'</span><br />            cData = alltrim<span style="color: #000000;">&#40;</span>source->memo<span style="color: #000000;">&#41;</span><br />            cData := StrTran<span style="color: #000000;">&#40;</span> cData, <span style="color: #ff0000;">"."</span>, <span style="color: #ff0000;">"<BR>"</span> <span style="color: #000000;">&#41;</span><br />            cMemo = cMemo + <span style="color: #ff0000;">'<p>'</span>+ cData + <span style="color: #ff0000;">'</p>'</span><br />            master->memotxt = cMemo<br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">endif</span><br />      source-><span style="color: #000000;">&#40;</span>dbskip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">enddo</span><br />   master-><span style="color: #000000;">&#40;</span>dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master"</span><span style="color: #000000;">&#41;</span><br />   close all<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// A typical scope used for Xbrowse :</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> SET_SCOPE<span style="color: #000000;">&#40;</span>oBrw2<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> cNName := upper<span style="color: #000000;">&#40;</span>nofoto->reflev<span style="color: #000000;">&#41;</span><br /><br /><br />DBSELECTAREA<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"foto"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> ORDSCOPE<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>, cNName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"foto"</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>ORDSCOPE<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, cNName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// zoek en toon extra foto</span><br /><br /><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master"</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> ORDSCOPE<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master"</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>ORDSCOPE<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">&#40;</span>nofoto->reflev<span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">if</span> upper<span style="color: #000000;">&#40;</span>master->filename<span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"MAVECO.DBF"</span><br />       cNName := alltrim<span style="color: #000000;">&#40;</span>STRTRAN<span style="color: #000000;">&#40;</span>nofoto->id, <span style="color: #ff0000;">'.'</span>, <span style="color: #ff0000;">''</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">else</span><br />       cNName := alltrim<span style="color: #000000;">&#40;</span>upper<span style="color: #000000;">&#40;</span>nofoto->ID<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">endif</span><br /><br />l_exit = .F.<br /><span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .t.<br /><br /><br />   DBSELECTAREA<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"master"</span> <span style="color: #000000;">&#41;</span><br /><br />   master-><span style="color: #000000;">&#40;</span>dbsetorder<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"fabref"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> master-><span style="color: #000000;">&#40;</span>dbseek<span style="color: #000000;">&#40;</span>cNName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      exit<br />   <span style="color: #00C800;">endif</span><br /><br />   master-><span style="color: #000000;">&#40;</span>dbsetorder<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"code"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> master-><span style="color: #000000;">&#40;</span>dbseek<span style="color: #000000;">&#40;</span>cNName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />     exit<br />   <span style="color: #00C800;">endif</span><br /><br />   master-><span style="color: #000000;">&#40;</span>dbsetorder<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"levref"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> master-><span style="color: #000000;">&#40;</span>dbseek<span style="color: #000000;">&#40;</span>cNName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      exit<br />   <span style="color: #00C800;">endif</span><br /><br /><br />   master-><span style="color: #000000;">&#40;</span>dbsetorder<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"levref"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> !master-><span style="color: #000000;">&#40;</span>dbseek<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>nofoto->art_lev<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />     exit<br />   <span style="color: #00C800;">endif</span><br /><br />   master-><span style="color: #000000;">&#40;</span>dbsetorder<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"code"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> !master-><span style="color: #000000;">&#40;</span>dbseek<span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>STRTRAN<span style="color: #000000;">&#40;</span>nofoto->id, <span style="color: #ff0000;">'.'</span>, <span style="color: #ff0000;">''</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />     exit<br />   <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">if</span> !l_exit<br />      cNName := alltrim<span style="color: #000000;">&#40;</span>upper<span style="color: #000000;">&#40;</span>nofoto->ID<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      loop<br />      l_exit = .t.<br />   <span style="color: #00C800;">endif</span><br />exit<br /><span style="color: #00C800;">enddo</span><br /><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master"</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> ORDSCOPE<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>, cNName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"master"</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>ORDSCOPE<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, cNName <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />oBrw4:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> </div>[/code:1cldgnga] So the above code is not good practice. It will benefic with the changes to the locals and fields. Witch part is best to change ?
xbrowse slow
I also wonder if the function : FW_CdxCreate() // creating all indexes on all fields will slow down a application because many tags are open? ( lets say until 20/30 tags ?) For my kind of programming, it would be good, because i always have the bad habbit of creating some extra index's before some program loops because I'm never shure that the base-index created before will be correct. (it probably is) since CDX if only 1 file. Habbit from the NTX time (extra .ntx to open) A Cdx is always update if changes are made by : Xbrowse, changes by Loops, Packs ? On witch point do you use a Reindex function ?
xbrowse slow
You are already using locals in your program. That is right. You are using alias for all functions and references to the field. That is a good and healthy practice. Please continue the way you are doing. You may use field declaration and avoid aliasing ONLY in INDEX and FILTER expressions. In all other code please continue the way you are doing and that is good.
xbrowse slow
FW_CdxCreate( [<cfieldlist>] ) Creating index on all fields is not necessary. This may result in very large cdx files and slow down on networks. Better you create index on fields that are necessary for seeks and filters. ( Filters are optimized when the fields involved are indexed) If you specify fieldlist, you do not need to specify UPPER(), because the function automatically adds upper clause for character fields. You need to include "DELETED" in the list if you want index on DELETED() We regret that we are not able to keep the manuals / Wiki uptodate. But we do mention every new functionality in whatsnew.txt. That is good starting point for reference. If you need more details of the functionality you can refer to the source code in the prg file. This helps to understand the function better as well as we learn a few hints on good programming.
xbrowse slow
Thank You very much for the very usefull info.
xbrowse slow
Mr. Rao I'm using CDX As I said the xbrowse is slow only when I use this code [code=fw:2n8asfkn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">lIncrFilter</span> := .t.<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">lSeekWild</span> := .t.<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">cFilterFld</span> := <span style="color: #ff0000;">"RUC"</span><br />&nbsp;</div>[/code:2n8asfkn] Thank you for your help
xbrowse slow until more with ntx
Hello everyone, its someone else has already gone through this and can give me a hint, I have the following problem: uses dbf ntx FiveWin with 7.11 + 1.21 xHarbour. and have a product table approximately 30,000 records to a terminal access this table for others are more like slow xbrowse with listbox is to fast to mount the screen. for use as search by entering the User will go looking in the table, the more you move from one machine accessing this query comes up to close the program from scratch. NTx are created in an application 5.2E clipper, more native listbox with five runs. I tried SET TO 2 DBLOCKSCHEME already included in the clipper app NTXLOCK2, I saw nothing in some forums. I do not know what to do. because I'm having trouble on the clients, and do not know how to solve, do not know if the bug is xbrowse. pq up a dialog with the xbrowse is slow even more sluggish. xbrowse use with rc, one hand there's someone need urgent help!
xbrowse slow until more with ntx
Try WBrowse with LISTBOX command. WBrowse is faster than XBrowse.
xbrowse slow until more with ntx
I downloaded the sources to have begotten a lib version 17 forum here, but when you move the arrows up or down in the browser it is all black, and almost not to see the data, if you have a version that works with the FiveWin xHarbour 1.21 and 7.11 and can send me this email <!-- e --><a href="mailto:gilmarss2010@gmail.com">gilmarss2010@gmail.com</a><!-- e -->, thank you
xbrowse sort
Hallo, I can't put in order a table in XBROWSE oDbf := CREATEOBJECT( "ADODB.Recordset" ) cQuery := ( "SELECT .... oDbf:Open( cQuery , .... oDbf:MoveFirst() ... ... REDEFINE XBROWSE oBrw DATASOURCE odbf ; COLUMNS "CODICE", "DESCRIZIONE","UM", "SALDO", "ORDINI" ; COLSIZES 95, 330, 25, 80,70 ; HEADERS "Codice", "Descrizione", "um", "Saldo", "Ordini" ; PICTURE ,,,"@ZE 999,999.999","@ZE 999,999.999" ; ID 200 OF oDlg ; SORT "SALDO" but the output is in "CODICE" ascend, why?
xbrowse sort
damianodec When you create your query .. add the Order By clause to your recordset [code=fw:l7crs9fy]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cQuery := <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT .... Order by [Codice] DESC"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:l7crs9fy] Hope that helps Rick Lipkin
xbrowse sort
Or this: [code=fw:2qvqfd0q]<div class="fw" id="{CB}" style="font-family: monospace;">cQuery := <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT .... Order by [SALDO]"</span> <span style="color: #000000;">&#41;</span></div>[/code:2qvqfd0q]
xbrowse sort
Saldo is calculate Field: Select... T0.totd - t0.tota as SALDO, if I put ORDER BY SALDO I get error... Sent from lumia 720 Tapatalk
xbrowse sort
[code=fw:3t948d2t]<div class="fw" id="{CB}" style="font-family: monospace;">cQuery := <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SELECT .... Order by T0.totd - t0.tota DESC "</span> <span style="color: #000000;">&#41;</span></div>[/code:3t948d2t]
xbrowse sort
ok, and if I have this query whit subquery... Select fieldA as A, fieldB as B, (Select SUM(fieldC) from tableB) as fieldZ from tableA and I want order by fieldZ ?
xbrowse sort
I don't know if this will work, but try sorting the recordset after the query. This sorts the recordset after it is retrieved from the server. [code=fw:2sgwtrds]<div class="fw" id="{CB}" style="font-family: monospace;">oDbf:<span style="color: #000000;">CREATEOBJECT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ADODB.Recordset"</span><span style="color: #000000;">&#41;</span><br />oDdf:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span> &nbsp; <span style="color: #B900B9;">// client-side cursor </span><br />oDbf:= <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SELECT...<br />oDbf:Open( cQuery, ...<br />oDbf:sort("</span>SALDO<span style="color: #ff0000;">")<br />oDbf:MoveFirst()</span></div>[/code:2sgwtrds] James
xbrowse sort
thanks mr James, very good!
xbrowse state - conservar estado xbrowse
Hola buenas tardes para todos... existe una función que nos guarda el estado de una ventana, su tamaño su posición, la pantalla en la que se esta mostrando. Para que cuando se inicie de nuevo conserve las propiedades. La usamos de la siguiente manera [code=fw:j7nzqm76]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oWnd:<span style="color: #000000;">RestoreState</span><span style="color: #000000;">&#40;</span> MemoRead<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"wndstate.txt"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ;<br />            <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> MemoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"wndstate.txt"</span>, oWnd:<span style="color: #000000;">SaveState</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span> <br /> </div>[/code:j7nzqm76] Nos gustaría saber si para los xbrowse existe algo similar, que nos recupere el alto de las filas, los anchos de las columnas y si las columnas están ocultas. De antemano gracias
xbrowse state - conservar estado xbrowse
[quote="leandro":28kfp6az]Hola buenas tardes para todos... existe una función que nos guarda el estado de una ventana, su tamaño su posición, la pantalla en la que se esta mostrando. Para que cuando se inicie de nuevo conserve las propiedades. La usamos de la siguiente manera [code=fw:28kfp6az]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oWnd:<span style="color: #000000;">RestoreState</span><span style="color: #000000;">&#40;</span> MemoRead<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"wndstate.txt"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ;<br />            <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span> MemoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"wndstate.txt"</span>, oWnd:<span style="color: #000000;">SaveState</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#41;</span> <br /> </div>[/code:28kfp6az] Nos gustaría saber si para los xbrowse existe algo similar, que nos recupere el alto de las filas, los anchos de las columnas y si las columnas están ocultas. De antemano gracias[/quote:28kfp6az] Hola Leandro, Yo utilizo estas 2 funciones, una en el INIT de la WINDOW y la otra en el VALID de la WINDOW. [code=fw:28kfp6az]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/* *********************************************************************************** */</span><br /><span style="color: #00C800;">FUNCTION</span> lGuardaXBrowse<span style="color: #000000;">&#40;</span> AMPAARRA, oXBrowse, cFile <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> cStateXbrowse := oXBrowse:<span style="color: #000000;">SaveState</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> cFileSaved    := cPathDBF<span style="color: #000000;">&#40;</span> AMPAARRA, .T. <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"xBrw"</span> + cFile + <span style="color: #ff0000;">".txt"</span><br /><span style="color: #00C800;">Local</span> hcFileSaved   := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">Local</span> lRespuesta    := .F.<br /><br />DELETEFILES<span style="color: #000000;">&#40;</span> cFileSaved <span style="color: #000000;">&#41;</span><br /><br />hcFileSaved := fcreate<span style="color: #000000;">&#40;</span> cFileSaved, FC_NORMAL <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">If</span> Ferror<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span><br />    lRespuesta := .T.<br /><br />    fwrite<span style="color: #000000;">&#40;</span> hcFileSaved, cStateXbrowse <span style="color: #000000;">&#41;</span><br /><br />    fclose<span style="color: #000000;">&#40;</span> hcFileSaved <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">Return</span> lRespuesta<br /><span style="color: #B900B9;">/* *********************************************************************************** */</span><br /><span style="color: #B900B9;">/* *********************************************************************************** */</span><br /><span style="color: #00C800;">FUNCTION</span> lRecuperaXBrowse<span style="color: #000000;">&#40;</span> AMPAARRA, oXBrowse, cFile <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> cStateXbrowse := <span style="color: #ff0000;">""</span><br /><span style="color: #00C800;">Local</span> cFileSaved    := cPathDBF<span style="color: #000000;">&#40;</span> AMPAARRA, .T. <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"xBrw"</span> + cFile + <span style="color: #ff0000;">".txt"</span><br /><span style="color: #00C800;">Local</span> lRespuesta    := .F.<br /><br /><span style="color: #00C800;">If</span> File<span style="color: #000000;">&#40;</span>cFileSaved<span style="color: #000000;">&#41;</span><br /><br />    lRespuesta    := .T.<br /><br />    cStateXbrowse := MemoRead<span style="color: #000000;">&#40;</span> cFileSaved <span style="color: #000000;">&#41;</span><br /><br />    oXBrowse:<span style="color: #000000;">RestoreState</span><span style="color: #000000;">&#40;</span> cStateXbrowse <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">EndIf</span><br /><br /><span style="color: #00C800;">Return</span> lRespuesta<br /><span style="color: #B900B9;">/* *********************************************************************************** */</span><br /> </div>[/code:28kfp6az] Seguro que se pueden mejorar/adaptar a tus necesidades.
xbrowse state - conservar estado xbrowse
Amigo gracias por responder... Ya mismo intento y cualquier cosa comento.
xbrowse strange painting?
Dear friends, i just try the sample textxbrw.prg. When running the multisel feature or incremental search i have a strange painting of the browse. Here a picture how it looks like: [img:w0awgagj]http&#58;//www&#46;d-hoefner&#46;de/files/fw_xbrw&#46;gif[/img:w0awgagj] Is there an update or workaround to avoid this? Thanks and regards, Detlef
xbrowse strange painting?
I noticed the same problem. EMG
xbrowse strange painting?
Also in other circumstances the browse titles are missing Frank
xbrowse strange painting?
In metthod seek, try to remove the following line [code:34zffrbl] &#58;&#58;lRefreshOnlyData &#58;= &#46;T&#46; [/code:34zffrbl] appear 2 times.
xbrowse strange painting?
[quote="Biel EA6DD":sl517duj]In metthod seek, try to remove the following line [code:sl517duj] &#58;&#58;lRefreshOnlyData &#58;= &#46;T&#46; [/code:sl517duj] appear 2 times.[/quote:sl517duj] Thanks Biel, incremental search paints ok now. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> But the multiselect feature still paints bad when only clicking with the mouse into the browse window <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Maybe some one could help? Thanks and regards, Detlef
xbrowse strange painting?
Detlef, Please comment all: // ::lRefreshOnlyData := .t. in METHOD Select( nOperation ) CLASS TXBrowse
xbrowse strange painting?
Antonio, now xBrowse is painting fine also with multiselect clause. Thanks a lot for your advice. Regards, Detlef
xbrowse strange painting?
Thanks a lot for your feedback <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse to csv
Estimados alguien abra hecho para xbrowse la exportacion a csv como el toexcel ya que he visto que el exportacion es mucho mas rapido que excel
xbrowse to csv
Estimados; Alguien le dio una solución a este tema? (de xBrowse con Arrays a CSV). Saludos Fernando Espinoza A.
xbrowse to csv
Hola no hubo respuesta si que la hice favor revisar y comentar [code=fw:5ynismeq]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">METHOD</span> SetoDbf<span style="color: #000000;">&#40;</span> oDbf, aCols, lAutoSort, lAutoCols, aRows <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ToCsv<span style="color: #000000;">&#40;</span> cFile, bProgress, aCols <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:5ynismeq] [code=fw:5ynismeq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> ToCsv<span style="color: #000000;">&#40;</span> cFile, bProgress, aCols <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />   <span style="color: #00C800;">local</span> nKeyNo   := ::<span style="color: #000000;">KeyNo</span><br />   <span style="color: #00C800;">local</span> nRowPos  := ::<span style="color: #000000;">nRowSel</span><br />   <span style="color: #00C800;">local</span> n, uVal := <span style="color: #ff0000;">""</span>, c, oCol, nCols<br />   <span style="color: #00C800;">local</span> nSelect, nInd := <span style="color: #000000;">0</span>, nHandle, cPic, nDec, i, cType<br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nLen</span> < <span style="color: #000000;">1</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br /><br />    <span style="color: #B900B9;">//DEFAULT cFile := cNewFileName( ViewUsu():cPathTmp + "\TEMPO", "CSV" )</span><br />       cFile := <span style="color: #ff0000;">".<span style="color: #000000;">\a</span>rchivo.CSV"</span><br /><br />    <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>nHandle := FCREATE<span style="color: #000000;">&#40;</span> cFile, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">-1</span><br />        <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error al crear el archivo csv"</span>,<span style="color: #ff0000;">"Usuario"</span> <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />    <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> aCols == <span style="color: #00C800;">nil</span><br />      aCols    := ::<span style="color: #000000;">GetVisibleCols</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   nCols       := Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">for</span> each oCol in aCols<br />        uVal += <span style="color: #ff0000;">";"</span> + StrTran<span style="color: #000000;">&#40;</span>cValtochar<span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">cHeader</span><span style="color: #000000;">&#41;</span>, CRLF, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />    uVal := subst<span style="color: #000000;">&#40;</span> uVal, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + CRLF<br /><br />   nSelect  := <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> bProgress == <span style="color: #00C800;">nil</span><br />      <span style="color: #00C800;">if</span> ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oMsgBar</span> == <span style="color: #00C800;">nil</span><br />         bProgress := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">else</span><br />         bProgress := <span style="color: #000000;">&#123;</span> | n, t | ::<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> FWString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"To csv"</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" : "</span> + ;<br />                                 Ltrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"/"</span> + Ltrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> t <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .t. <span style="color: #000000;">&#125;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><br />   REPEAT<br />      <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nCols<br />            cType := valtype<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />                <span style="color: #00C800;">case</span> cType = <span style="color: #ff0000;">"N"</span><br />                    cPic := <span style="color: #ff0000;">"9999999999"</span><br />                    nDec := CuantosDecimales<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">value</span> <span style="color: #000000;">&#41;</span><br />                    <span style="color: #00C800;">if</span> nDec > <span style="color: #000000;">0</span><br />                        cPic += <span style="color: #ff0000;">","</span><br />                        <span style="color: #00C800;">for</span> i:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nDec<br />                            cPic += <span style="color: #ff0000;">"9"</span><br />                        <span style="color: #00C800;">next</span> i<br />                    <span style="color: #00C800;">endif</span><br />                    uVal  += iif<span style="color: #000000;">&#40;</span> n=<span style="color: #000000;">1</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span>+strtran<span style="color: #000000;">&#40;</span>ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">value</span>,<span style="color: #000000;">12</span>,nDec <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"."</span>, <span style="color: #ff0000;">","</span><span style="color: #000000;">&#41;</span><br /><br />                <span style="color: #00C800;">case</span> cType = <span style="color: #ff0000;">"D"</span><br />                    uVal  += iif<span style="color: #000000;">&#40;</span> n=<span style="color: #000000;">1</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span>+dtoc<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><br /><br />                <span style="color: #00C800;">case</span> cType = <span style="color: #ff0000;">"L"</span><br />                    uVal  += iif<span style="color: #000000;">&#40;</span> n=<span style="color: #000000;">1</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span>+iif<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span>, <span style="color: #ff0000;">"SI"</span>, <span style="color: #ff0000;">"NO"</span> <span style="color: #000000;">&#41;</span><br /><br />                <span style="color: #00C800;">otherwise</span><br />                    uVal  += iif<span style="color: #000000;">&#40;</span> n=<span style="color: #000000;">1</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#41;</span>+strtran<span style="color: #000000;">&#40;</span>cValtochar<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">";"</span>,<span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endcase</span><br />        <span style="color: #00C800;">next</span><br />        uVal += CRLF<br /><br />      <span style="color: #00C800;">if</span> !Eval<span style="color: #000000;">&#40;</span> bProgress, ++nInd, ::<span style="color: #000000;">nLen</span> <span style="color: #000000;">&#41;</span><br />            exit<br />        <span style="color: #00C800;">endif</span><br /><br />    UNTIL ::<span style="color: #000000;">Skip</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />   ::<span style="color: #000000;">KeyNo</span>     := nKeyNo<br />   ::<span style="color: #000000;">nRowSel</span>   := nRowPos<br />   ::<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    FWRITE<span style="color: #000000;">&#40;</span> nHandle, uVal <span style="color: #000000;">&#41;</span><br />    FCLOSE<span style="color: #000000;">&#40;</span> nHandle <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #B900B9;">//MsgInfo( "Fue creado el archivo en temporal, debera guardarlo.."+CRLF+"proceder abrir el archivo","Usuario" )</span><br />    ShellExecute<span style="color: #000000;">&#40;</span> WinMain<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">hWnd</span>, <span style="color: #ff0000;">"open"</span>, cFile <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;">FUNCTION</span> CuantosDecimales<span style="color: #000000;">&#40;</span>tn <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> ln := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span>  ln <=<span style="color: #000000;">2</span><br />    <span style="color: #00C800;">IF</span> INT<span style="color: #000000;">&#40;</span>tn * <span style="color: #000000;">10</span> ^ ln<span style="color: #000000;">&#41;</span> = tn * <span style="color: #000000;">10</span> ^ ln<br />        EXIT<br />    <span style="color: #00C800;">ENDIF</span><br />    ln ++<br /><span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">RETURN</span> ln<br /><br /> </div>[/code:5ynismeq]
xbrowse to csv
Estimado Patricio Gracias por compartir. Estoy en las pruebas; me sale error, porque me pide la función WinMain(). Estoy usando el xBrowse de la FWH1709 y xHarbour. Saludos Fernando Espinoza A.
xbrowse to csv
WndMain()
xbrowse to csv
Estimado Patrico, Mr. Rao Con sus aportes funciona bien; únicamente me tocó comentar estas tres líneas, que provocan un error. //If !Eval( bProgress, ++nInd, ::nLen ) // EXIT //Endif Saludos Fernando Espinoza A.
xbrowse to excel
Ciao Ho un problema con Xbrowse e la trasformazione in Excel dei campi numerici con virgola. Mi spiego meglio, se genero un file excel con campi numerici interi.... tutto ok Se invece il campo numerico ha dei decimali, quando genero il relativo campo excel, invece che la virgola mi esce il puntino e quindi non riesco poi a fare operazioni numeriche su tale campo excel. Ho provato a modificare un po di cose all'interno della classe xbrowse.prg ma non riesco ad uscirne. Allego un esempio minimale Grazie Romeo **************************** * * 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 * Grazie a Tutti