Page 1 of 1

Change the Header to a DCBROWSECOL

Posted: Tue May 09, 2017 9:02 am
by digitsoft
Hello Roger
How to Change the Header to a DCBROWSECOL
Thank you

Re: Change the Header to a DCBROWSECOL

Posted: Wed May 10, 2017 1:55 am
by skiman
Hi,

i do it this way:

DCBROWSECOL FIELD bonart->hoev HEADER {|| "#"+str(nTotstuks,7) } OBJECT oAantal PARENT oBrowseart WIDTH 5 ID "ARTHOEV" font "12.Verdana bold"

When I want to change it:

oAantal:heading:setcell(1 ,"#"+str(nTotstuks,7), ,.T.)
oAantal:heading:invalidaterect(oAantal:heading:cellrect(1))

Re: Change the Header to a DCBROWSECOL

Posted: Wed May 10, 2017 1:58 am
by reganc
digitsoft wrote:Hello Roger
How to Change the Header to a DCBROWSECOL
Thank you
Just use a codeblock to return the text you want...

Re: Change the Header to a DCBROWSECOL

Posted: Wed May 10, 2017 2:00 am
by reganc
skiman wrote:Hi,

i do it this way:

DCBROWSECOL FIELD bonart->hoev HEADER {|| "#"+str(nTotstuks,7) } OBJECT oAantal PARENT oBrowseart WIDTH 5 ID "ARTHOEV" font "12.Verdana bold"

When I want to change it:

oAantal:heading:setcell(1 ,"#"+str(nTotstuks,7), ,.T.)
oAantal:heading:invalidaterect(oAantal:heading:cellrect(1))
Chris,

Why do you do the 2nd bit. If it's a codeblock it should just change on the next refresh, shouldn't it?

Re: Change the Header to a DCBROWSECOL

Posted: Wed May 10, 2017 5:12 am
by skiman
hi Regan,

Sometimes refreshing has flickering as a result. That's why I try to avoid it as much as possible.

Re: Change the Header to a DCBROWSECOL

Posted: Wed May 10, 2017 5:40 am
by rdonnay
oAantal:heading:setcell(1 ,"#"+str(nTotstuks,7), ,.T.)
oAantal:heading:invalidaterect(oAantal:heading:cellrect(1))
That's one way to do it, but if you use a code block for the header then all you need to do is oBrowse:refresh(). This will reevaluate and display all headers and footers that are code blocks.