PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD19] Where are the Sub Totals in tables
[WD19] Where are the Sub Totals in tables
Débuté par Al, 20 aoû. 2014 17:18 - 6 réponses
Posté le 20 août 2014 - 17:18
Hello All

A glaring omission in PCSoft tables is the lack of a proper subtotal for data breaks. There is a halfhearted attempt to provide them using statics in table breaks but that is worse than not having them at all because they are not tied to the columns and most times you can't add more than one or two statics as they don't all seem to offer the subtotal option and besides it is not the way it should be done.

I hoped that the pivot tables might be of use but looking at the example in V19 it seems that the only way it gives a subtotal is to condense the rows, so I get a sub total but loose the details.

At the moment I am getting by in some tables by using memory tables and calculating sub totals for groups of data and then adding a manual sub total row into the table. This works fine in things like a balance sheet sheet display because no-one really wants to sort the rows but is not that usefull for other displays where the rows need to be sorted

There is so much really great functionaility packed into the tables, I find it quite disappointing that the provision of sub totals seems of little importance to PCSoft or maybe it's just too hard for them to code.

Hopefully V20 will see a result but I doubt it. I did a search of the forum and found that I have been complaining here about the lack of sub totals in tables since 2011. Either I need to stop complaining or PCSoft need to fix their tables :rolleyes:


Regards
Al
Posté le 20 août 2014 - 19:58
Hi Al...

I understand that you have been complaining HERE about that problem, but have you send a suggestion of improvement to pcsoft using their request to technical support tool?

After all, they created that tool to let users tell them what they need, and they do develop a lot of the suggestions... Now complaints on a forum? Not so much, I would say...

Best regards
Posté le 20 août 2014 - 23:51
Hello Fabrice

I tried that, but they just refer me to the sub total option using statics and give me a number which is not very helpful, but you are right, I will try them again.

Regards
Al
Posté le 21 août 2014 - 10:00
Hi Al

I use subtotals quite a lot I use statics and have no problem adding several subtotals to a table. Even with multiple breaks
However there is a bug in the table with break. If you anchor a Colum then the subtotals sometimes appear somewhere else.

My work around is not anchoring. if not needed. If you need then make the columns none adjustable. When you make the screen bigger the statics will follow the Colum. But when adjusting a Colum manually they are not following the Colum and you get a total that is not where it is supposed to be.

An other bug in the table with breaks is that it does not support several nested breaks. Collapse and expand does not work as it should. PC soft has confirmed to me that this is indeed a bug.

I wanted to use the table breaks for balans sheet as well. Stoped trying will not work.

I use the pivot table as well And indeed I did not go for version 19 since there are no sub totals. It is a pitty for otherwise a great control. There are other issues with this control . One cannot determine how it orders items. It orders alphabetically not on any other key. Filling it with a query does not help ( Pc-soft suggested that ) It calculates it self and the calculated result is ordered.
For now I use the pivot for balanssheet and costing It does the job for 90%. But brings great features as well. I hoped version 19 would solve the issues but it does not No subtotals.

So For now I leave it like this. There seems to be no other way then to use the treeviewtable control and do it all by programming. But that is not an easy task . I have give it a try last year. But to get the features of the pivot table is a huge task.


regards
Allard
Posté le 21 août 2014 - 10:36
Hello Allard

Most often I can't get the statics to work.
When I create a static from the IDE tool bar, it appears in the top left hand corner of the window and I drag it onto the table header or footer. The problem then is that the option for subtotal does not appear in the GUI tab of the table editor, so I must be doing something different to you. It was like that in V18 and is still a problem in V19

Regards
Al
Posté le 21 août 2014 - 11:13
The lack of subtotals bothered me too (WD18) as I need to display them in BreakHeaders en -Footers.

There is a solution in calculating them yourself from TableBreakSubscript(TABLE_T.BRK_BreakHeader) as long that TableBreakSubscript is the same (then you have all the rows between the two breaks).

If you put that routine in Displaying a row of BreakHeader(Table_T) it does not slow down the process noticeably.

If you show the results in for example textboxes and you realign them, each time the user changes the width of any column before the column you want to show subtotals, you have subtotals (like I have now).

It is a bit of work, yes, but that work you can do also 10 times as fast.

Kind regards
Posté le 21 août 2014 - 13:36
My answer (real life solution) of this morning has not yet been added to the forum, but as for the remarks about stc and shattering around when you resize page / table-control, I noticed that a simple making the controls invisible, Multitask(-1) and then making the controls again visible solves a lot of redrawing issues. It does not even flicker on the screen (at least, not with me).

But in addition to my earlier post (not appeared yet) here is the routine I use to follow the width of the column, in place (X-value) and in width

// Om het totaalveld in de footer onder de D/C/S te houden
Procedure PROC_VerplaatsCumulerendTotaal()
EDT_TotaalDebet..Width = COL_Debet..Width+52
EDT_TotaalCredit..Width = COL_Credit..Width
EDT_TotaalDebet..X = COL_Credit..X-EDT_TotaalDebet..Width+1 ; EDT_TotaalDebet..Visible = False ; EDT_TotaalDebet..Visible = True
EDT_TotaalCredit..X = COL_IRnaam..X-EDT_TotaalCredit..Width+1 ; EDT_TotaalCredit..Visible = False ; EDT_TotaalCredit..Visible = True
EDT_TotaalSaldo..X = COL_IRnaam..X+15 ; EDT_TotaalSaldo..Visible = False ; EDT_TotaalSaldo..Visible = True


It is a real-life solution and it works.

Hope this helps,
Kind regards