FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A xbrowse question to show a section with different values
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
A xbrowse question to show a section with different values
Posted: Sat Apr 02, 2016 11:02 AM
Hello,

what is the best solution to show different values at the same xbrowse-section
I have a fixed section with the main customer-informations and one section to be replaced
showing different values on button-action.

maybe a full browser using :
oBrw1:MoveCol( 12, 6 ) // switch position
or
oBrw1:aCols[1]:Hide() / oBrw1:aCols[1]:Show()

or a colum value-replacement of the section

Main-data
aDatT[1] := TRIM(("KUNDE")->ANREDE)
aDatT[2] := TRIM(("KUNDE")->NAME) + " " + TRIM(("KUNDE")->NAME1)
aDatT[3] := ("KUNDE")->ANSCHRIFT
aDatT[4] := TRIM(("KUNDE")->PLZ) + " " + TRIM(("KUNDE")->ORT)
aDatT[5] := ("KUNDE")->TEL_PRI

section replacement on button-action :

in the morning
aDatT[20] := ("KUNDE")->F_TOUR
aDatT[21] := ("KUNDE")->F_TIME
aDatT[22] := ("KUNDE")->F_PRINT

in the evening
aDatT[20] := ("KUNDE")->N_TOUR
aDatT[21] := ("KUNDE")->N_TIME
aDatT[22] := ("KUNDE")->N_PRINT

at night
aDatT[20] := ("KUNDE")->A_TOUR
aDatT[21] := ("KUNDE")->A_TIME
aDatT[22] := ("KUNDE")->A_PRINT


Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: A xbrowse question to show a section with different values
Posted: Sat Apr 02, 2016 11:32 AM

Uwe, maybe, I try

oBrow:aCols[05]:bStrData := <codeblock with parameter of value selected>
oBrow:aCols[06]:bStrData :=
oBrow:aCols[07]:bStrData :=

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A xbrowse question to show a section with different values
Posted: Sat Apr 02, 2016 11:43 AM

Cristobal,

Yes I think a column-data replacement is the better solution

I tested at startup moving columns ( works )
// "NR", "NAME1", "NAME", "SIGNAL", ; 1, 2, 3, 4
// "M_TOUR", "M_ZEIT", "M_MERKER" , ; 5, 6, 7
// "N_TOUR", "N_ZEIT", "N_MERKER", ; 8, 9, 10
// "A_TOUR", "A_ZEIT", "A_MERKER" } ; 11, 12, 13

WITH OBJECT oBrw1
// Color selection :
:aCols[5]:bClrStd := {|| { 0, 917261 } }
:aCols[6]:bClrStd := {|| { 0, 917261 } }
:aCols[7]:bClrStd := {|| { 0, 917261 } }

:aCols[8]:bClrStd := {|| { 0, 16767928 } }
:aCols[9]:bClrStd := {|| { 0, 16767928 } }
:aCols[10]:bClrStd := {|| { 0, 16767928 } }

:aCols[11]:bClrStd := {|| { 0, 11974399 } }
:aCols[12]:bClrStd := {|| { 0, 11974399 } }
:aCols[13]:bClrStd := {|| { 0, 11974399 } }

            // the 3 options
IF nSchicht = 1 // Nothing
    // shows :aCols[5] 
    // shows :aCols[6] 
    // shows :aCols[7] 
ENDIF
IF nSchicht = 2 // Show section 2
    :aCols[5]:Hide()
    :aCols[6]:Hide()
    :aCols[7]:Hide()
ENDIF
IF nSchicht = 3 // Show section 3
    :aCols[5]:Hide()
    :aCols[6]:Hide()
    :aCols[7]:Hide()
    :aCols[8]:Hide()
    :aCols[9]:Hide()
    :aCols[10]:Hide()
ENDIF

:bChange := { || T_GET(nSchicht), oFld:aDialogs[1]:Update(), ;
                               oDatT[12]:Refresh(), oDatT[13]:Refresh() }

END

but some calculations are needed on each button-action

I will test You solution

best regards
Uwe :D

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: A xbrowse question to show a section with different values
Posted: Sat Apr 02, 2016 11:47 AM

And with one array of colors for use with one parameter passed of codeblock and ("KUNDE")->fieldget( n ) instead of the field name

Sorry my english

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A xbrowse question to show a section with different values
Posted: Sat Apr 02, 2016 01:21 PM

Cristobal,

thank You very much
It is finished, tested and works PERFECT
Column datareplacement was the best solution for this project-part

best regards
Uwe :D

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: A xbrowse question to show a section with different values
Posted: Sat Apr 02, 2016 09:05 PM

Mr Uwe

Method oBrw:ReArrangeCols( aCols ) is exactly meant for this purpose only.

First create browse like this:

@ r,c XBROWSE oBrw <clauses> ;
COLUMNS ;
"NR", "NAME1", "NAME", "SIGNAL", ; 1, 2, 3, 4
"M_TOUR", "M_ZEIT", "M_MERKER" , ; 5, 6, 7
"N_TOUR", "N_ZEIT", "N_MERKER", ; 8, 9, 10
"A_TOUR", "A_ZEIT", "A_MERKER" } ; 11, 12, 13
<otherClauses>

AEval( oBrw:aCols, { |o| o:lHide := .t. }, 8 )

<other settings>
oBrw:CreateFromCode()

Button Action:

if nSchicht == 1
oBrw:ReArrangeCols( { 1, 2, 3, 4, 5, 6, 7 } )
elseif nSchicht == 2
oBrw:ReArrangeCols( { 1, 2, 3, 4, 8, 9, 10 } )
else
oBrw:ReArrangeCols( { 1, 2, 3, 4, 11,12,13 } )
endif

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A xbrowse question to show a section with different values
Posted: Sun Apr 03, 2016 03:21 PM

Mr. Rao,

thank You very much for the infos.

It works fine and is much better than replacing the column-values
because export to Excel will display all 3 tours.
I'm still working on the final result.

best regards
Uwe :D

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: A xbrowse question to show a section with different values
Posted: Sun Apr 03, 2016 03:51 PM
because export to Excel will display all 3 tours.

If you have any difficulty please let us know.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion