Jump to content

PHC - Browlist com cor nas linhas com quantidade > 0


Recommended Posts

Posted

Bom dia,

Tenho esta browlist nao sei como colocar cores apenas nas linhas com quantidade maior que zero

select bi
lvcass = getnome("Procura por referencia","")


lvcquery = [select bi.ref, bi.design,bi.qtt,bi.edebito, bi.bistamp from bi (nolock) inner join bo on bi.bostamp=bo.bostamp Where bi.ndos=32 and bi.ref like '%]+alltrim(lvcass)+[%' and bi.obrano=?bi.obrano order by lordem]
u_sqlexec(lvcquery ,[getbi])

u_sqlexec(lvcquery , [getbi])

declare list_tit(4), list_tam(4), list_cam(4), list_pic(4)

list_tit(1)='Referência'
list_tit(2)='Designação'
list_tit(3)='Quantidade'
list_tit(4)='Venda'


list_tam(1)=100
list_tam(2)=200
list_tam(3)=200
list_tam(4)=200


list_cam(1)='getbi.ref'
list_cam(2)='getbi.design'
list_cam(3)='getbi.qtt'
list_cam(4)='getbi.edebito'

list_pic(1)=''
list_pic(2)=''
list_pic(3)='###,###.#'
list_pic(4)='###,###.##'


m.escolheu = .f.

browlist ('Artigos do Dossier', 'getbi')

if m.escolheu = .t.


select bi
locate for bi.bistamp = getbi.bistamp
return 

endif

Sera que me conseguem ajudar?

Cumprimentos

  • 7 months later...
Posted

Olá boa noite,

Tenta com o seguinte: (chamo a atenção que ao fundo está comentado um Procedure que em vez de colocar a linha toda a verde caso a QTT>0 coloca te apenas a coluna. para veres a diferença... descomentta o primeiro procedure e comenta o segundo e já ves as diferenças.

 

select bi
lvcass = getnome("Procura por referencia","")


lvcquery = [select bi.ref, bi.design,bi.qtt,bi.edebito, bi.bistamp from bi (nolock) inner join bo on bi.bostamp=bo.bostamp Where bi.ndos=32 and bi.ref like '%]+alltrim(lvcass)+[%' and bi.obrano=?bi.obrano order by lordem]
u_sqlexec(lvcquery ,[getbi])

u_sqlexec(lvcquery , [getbi])

i=24
declare list_tit(4), list_tam(4), list_cam(4), list_pic(4),list_DyCurrControl(i)

i=0
i=i+1
list_tit(1)='Referência'
list_tit(2)='Designação'
list_tit(3)='Quantidade'
list_tit(4)='Venda'
list_DyCurrControl(i)="refresca_grelha()"

i=i+1
list_tam(1)=100
list_tam(2)=200
list_tam(3)=200
list_tam(4)=200

i=i+1
list_cam(1)='getbi.ref'
list_cam(2)='getbi.design'
list_cam(3)='getbi.qtt'
list_cam(4)='getbi.edebito'

i=i+1
list_pic(1)=''
list_pic(2)=''
list_pic(3)='###,###.#'
list_pic(4)='###,###.##'


m.escolheu = .f.

browlist ('Artigos do Dossier', 'getbi')

if m.escolheu = .t.


select bi
locate for bi.bistamp = getbi.bistamp
return 

endif

*** IRÁ COLOCAR APENAS OS VALORES A CORES ***
*Procedure refresca_grelha()
*    lo_obj = "BROWLIST.Grid1"
*    &lo_obj..Columns[3].DynamicBackColor = "iif(getbi.qtt>0, RGB(0,255,0), RGB(255,255,255))"
*    Return .T.
*Endproc

*** IRÁ COLOCAR AS LINHAS A CORES ***
Procedure refresca_grelha()
    lo_obj = "BROWLIST.Grid1"
    &lo_obj..SetAll("DynamicBackColor","iif(getbi.qtt>0, RGB(0,255,0),RGB(255,255,255))","Column")
Endproc

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.