How to define a GROUP-color on xBrw-cells ?

How to define a GROUP-color on xBrw-cells ?

Postby ukoenig » Mon Mar 20, 2017 12:00 pm

Hello,

I want to define GROUP-colors on the first xBrowse-cell field ("STEUER")->PAT_NUMMER
to sliver the bills of a customer.

sample :
3 bills on customer 1
// color-change
4 bills on customer 2
// color change
1 bill on customer 3

Image

There is still something wrong with the color-change-logic.

Code: Select all  Expand view

WITH OBJECT oBrw1
    :aCols[ 1 ]:bClrStd := { || If( nPNr <> ("STEUER")->PAT_NUMMER, ;
                           { If( ( oBrw1:cAlias )->( Deleted() ), 255, aVal[103] ), aVal[102] }, ;
                           { If( ( oBrw1:cAlias )->( Deleted() ), 255, aVal[101] ), aVal[100] } ) }
    :aCols[ 1 ]:bClrSel     :=  ;
    :aCols[ 1 ]:bClrSelFocus    := { || { If( ( oBrw1:cAlias )->( Deleted() ), 255, aVal[105] ), aVal[104] } }
        :bRecSelData        := { |brw| brw:KeyNo }
        :bRecSelHeader  := { |brw| "Nr." }  // or simply "SlNo"
        :bRecSelFooter      := { |brw| brw:nLen } // or Simpy any value
        :nRecSelWidth       := 50
    :MakeTotals()
    :aCols[ 6 ]:bFooter := { || oBrw1:aCols[ 6 ]:nTotal }
    If( nPNr = ("STEUER")->PAT_NUMMER, "", nPNr := ("STEUER")->PAT_NUMMER ) // pat_nummer changed
END
 
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: How to define a GROUP-color on xBrw-cells ?

Postby nageswaragunupudi » Mon Mar 20, 2017 12:18 pm

aColorPairs := { { CLR_BLACK, CLR_WHITE}, { CLR_WHITE, CLR_BLUE }, ........... }
nColorPairs := Len( aColorPairs )

oCol:bClrStd := { || aColorPairs[ VAL( STEUER->PAT_NUMMER ) % nColorPairs + 1 ] }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to define a GROUP-color on xBrw-cells ?

Postby ukoenig » Mon Mar 20, 2017 12:46 pm

Mr. Rao,

thank You very much, but it seems there is still something wrong.
I added some more bills to test the color-change.
Number 0004 is painted white.

Image

aColorPairs := { { CLR_BLACK, CLR_WHITE}, { CLR_WHITE, CLR_BLUE } }
nColorPairs := Len( aColorPairs )

WITH OBJECT oBrw1
:aCols[ 1 ]:bClrStd := { || aColorPairs[ VAL( STEUER->PAT_NUMMER ) % nColorPairs + 1 ] }
:bRecSelData := { |brw| brw:KeyNo }
:bRecSelHeader := { |brw| "Nr." } // or simply "SlNo"
:bRecSelFooter := { |brw| brw:nLen } // or Simpy any value
:nRecSelWidth := 50
:MakeTotals()
:aCols[ 6 ]:bFooter := { || oBrw1:aCols[ 6 ]:nTotal }
END

best regards
Uwe :roll:
Last edited by ukoenig on Mon Mar 20, 2017 12:48 pm, edited 1 time in total.
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: How to define a GROUP-color on xBrw-cells ?

Postby nageswaragunupudi » Mon Mar 20, 2017 12:48 pm

There is nothing wrong.
Define more number of color pairs may be around 10
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to define a GROUP-color on xBrw-cells ?

Postby ukoenig » Mon Mar 20, 2017 1:16 pm

Once again,
thank You very much.
It works PERFECT now.
I added some more bills for my test.
The solution is needed for a overview of all written bills for the tax consultant.
A customer can have many bills the same time defined with a TYP ( insurance, privat, social welfare office ....)

Image

Code: Select all  Expand view

aColorPairs := { { CLR_BLACK, CLR_WHITE}, ;
          { CLR_WHITE, 16711680 }, ; // Blue
          { CLR_WHITE, 255 }, ;   // Red
          { CLR_WHITE, 32768 }, ; // Green
          { CLR_WHITE, 16512 }, ; // Brown
          { CLR_BLACK, 8454143 }, ; // Yellow
          { CLR_BLACK, 16776960 } } // Lightblue

nColorPairs := Len( aColorPairs )

WITH OBJECT oBrw1
     oBrw:bClrStd := { || If( oBrw:KeyNo() % 2 == 0, ; // Row-colors
               { If( ( oBrw:cAlias )->( Deleted() ), 255, aVal[103] ), aVal[102] }, ;
               { If( ( oBrw:cAlias )->( Deleted() ), 255, aVal[101] ), aVal[100] } ) }
     oBrw:bClrSel :=  ;
     oBrw:bClrSelFocus  := { || { If( ( oBrw:cAlias )->( Deleted() ), 255, aVal[105] ), aVal[104] } }
     :aCols[ 1 ]:bClrStd := { || aColorPairs[ VAL( STEUER->PAT_NUMMER ) % nColorPairs + 1 ] }
     :bRecSelData := { |brw| brw:KeyNo }
     :bRecSelHeader := { |brw| "Nr." }  // or simply "SlNo"
     :bRecSelFooter := { |brw| brw:nLen } // or Simpy any value
     :nRecSelWidth := 50
     :MakeTotals()
     :aCols[ 6 ]:bFooter := { || oBrw1:aCols[ 6 ]:nTotal }
END
 


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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests