A xbrowse question to show a section with different values

A xbrowse question to show a section with different values

Postby ukoenig » 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


Image
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A xbrowse question to show a section with different values

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: A xbrowse question to show a section with different values

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A xbrowse question to show a section with different values

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: A xbrowse question to show a section with different values

Postby ukoenig » Sat Apr 02, 2016 1: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A xbrowse question to show a section with different values

Postby nageswaragunupudi » Sat Apr 02, 2016 9: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: A xbrowse question to show a section with different values

Postby ukoenig » Sun Apr 03, 2016 3: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A xbrowse question to show a section with different values

Postby nageswaragunupudi » Sun Apr 03, 2016 3: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests