Page 1 of 1

HEADER and FOOTER codeblocks

Posted: Wed Mar 09, 2016 11:09 am
by reganc
Roger

Are footer and header codeblocks meant to refresh their values every time a dc_getrefresh() is done?

We put totals into the footers of some columns. As they can be defined as codeblocks, I presumed their values would be refreshed in a similar way to the way DCSAY and DCSTATICs are done. But they're not.

Am I missing something?

As a workaround I have done a loop round the column objects, getting the footer blocks, evaluating them and then pasting them in the footer cell using setcell following by an invalidaterect().

Re: HEADER and FOOTER codeblocks

Posted: Wed Mar 09, 2016 12:38 pm
by rdonnay
I thought it was supposed to work that way too.

The method DC_XbpColumn():refresh() will do what you want but only for a specified column.

To update all columns would require this:

Code: Select all

FOR i := 1 TO oBrowse:colCount
  oBrowse:getColumn(i):refresh()
NEXT
I have added the following code to the DC_XbpBrowse:refresh() method in _DCXBROW.PRG. This is called by DC_GetRefresh(). I recommend that you do the same and rebuild DCLIPX.DLL, otherwise use the code shown above in your application code.

Code: Select all

FOR i := 1 TO ::colCount      <<<<<<< new
  ::getColumn(i):refresh()    <<<<<<< new
NEXT                          <<<<<<< new

::refreshAll()
This change will be in build 264.