Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 6 Jahren, 1 Monat
Letzter Beitrag:
vor 5 Jahren, 6 Monaten
Beteiligte Autoren:
DarrenF, Al, HernanCano, Arie, DW, Ola

[WD16] Totals of a table control...

Startbeitrag von DarrenF am 07.07.2012 10:00

Hi guys,

I have a couple of questions regarding the automatic totalling of the column(s) of a Table control.

1) Is it possible to change the properties and text of the automatic sum line, i.e. can I change it to be Bold?
2) Can I change the text from "Sum"? [Solved changing the text - it's at the table level on the General tab]
3) Once I've selected that the Sum row is after the last row in the Table control, how do I change this so that it appears outside the table? I've tried removing and re-adding, but no luck. [Solved - it's on the General tab]

Thanks in advance...


Hello Darren,

Yes you can change the properties.

Table[rowTotal]..Color = LightRed

Col_Amount[rowAverage]..BrushColor = LightBlue

You Can change it for the table or just a column by using its name.


von DW - am 07.07.2012 13:51
Thanks DW!

It works as long as you put the code in the correct event :cheers:

I have 2 Table controls on the same window... when you click on the 1st window it filters the 2nd window. This 2nd window contains the row I want to make bold, so here's the code of the "End of initialis(z)ation" of the 2nd Table control:

// Make totals row of lines table control slightly larger and in bold
WTABLE_EPos_Lines[rowTotal]..FontBold = True
WTABLE_EPos_Lines[rowTotal]..FontSize = 10


Thanks again...

von DarrenF - am 07.07.2012 18:49
I also tried the [rowTotal] option to get the correct row.
While it does not seem to work in the first place (except if you put it in the init-part as you say), some further investigation put me on a workaround.
You can do this:
WTABLE_EPos_Lines[rowTotal]..FontSize = 10
where ever you want (I used a testbutton for it), but there is a little bug. WD forgets to do a redraw to reflect the changes. If you grab the resize handle of the window and resize the window at least one pixel, it forces a redraw and the fontsize of rowTotal changes.
This is how I noticed it.

Then I used this little trick to force a redraw myself.
lstFactuurregels.BedragExcl..DisplayEnabled = False
lstFactuurregels.BedragExcl..DisplayEnabled = True

Also MultiTaskRedraw() does the trick, but this repaints the whole window, which does not cause any harm, but is also not necesarry.

von Arie - am 08.07.2012 19:48
Hi guys

I have a problem with totals in a table window in WD16. It is an older table control, but I can't remember the version during which it was created. Anyways, it seems to have all the current table features. I activated the totals, added to it the sum calculation to one column and translated the "Sum" caption to three languages. But I cant see anything referring to the sum when I test the window! Am I missing something here?

Best regards

von Ola - am 11.07.2012 08:12
Why doesn't this run?

COL_GRADE[rowAverage]..Visible = true
COL_GRADE[rowCount]..Visible = true
COL_GRADE[rowTotal]..Visible = true
tblDatos..TotalsEnabled = True

My scenario:
The table was not created with TotalsEnabled.
No column was defined to sum, count nor average.
The idea is to put one (or several) of these totals by programming.


von HernanCano - am 19.02.2013 05:30
Hello HernanCano

The help indicates this command only turns on or off the display of the row that displays the totals.
I think you should nominate the columns you want to be totalled and then use the ..totalsenabled(true/false) to turn the totals row visible or invisible


von Al - am 19.02.2013 06:35
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.