PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Table Control break header...
[WD20] Table Control break header...
Iniciado por guest, 30,oct. 2015 12:19 - 7 respuestas
Publicado el 30,octubre 2015 - 12:19
Hi guys,

I've got a question regarding a Table control with a break header that's being populated by programming...

The problem: I have a Table control on a window that is populated by programming (using TableAddLine), and there's a Break header defined. As I would do with a Break header populated via a Query, I've dropped a Static control in the Break header in an attempt to display some header text - in this case it's a product Category title as the table breaks on a change of product Category. The actual break works fine, but the actual text doesn't :-(

The issue is that I'm struggling to decide where to add my code in order to correctly display this break header text. At the moment I keep getting the last category description in the Category table as (I think) the Table control only considers my code right at the end of processing.

Any ideas how to resolve this?
Publicado el 30,octubre 2015 - 20:58
Hello Darren

If you double click on the break heading row in the table, not on the static, there is a "Displaying a row of BreakHeader" event. I put code in there to fill the static.

Regards
Al
Publicado el 31,octubre 2015 - 19:16
Hi Al,

Hmmm, yeah, that's what I thought as well, but all that happens is, that the actual breaks look fine, it's just that the contents of the static control in the break header is wrong... or should I say; it contains the same text in ALL the breaks ...which happens to be the very last category desc returned by the query I'm using :confused:

I've also tried putting the code into the "Displaying a row" of the main table control, but get just the same result...
Publicado el 31,octubre 2015 - 22:13
Hello Darren

Invariably, the text value shown in the break header is also contained in a hidden column in the table and this same field is used as the break header link. In this way, the heading text will always be correct.

Regards
Al
Publicado el 31,octubre 2015 - 22:33
Hi Al,

Yes, you are correct, but I'm not linking a file or query to the table, so I can't see a way to link the header to the column
Publicado el 01,noviembre 2015 - 20:29
Hi darren,

I think this link may help you.
To address a break you can use any subscript (row number) that's included in a break.

Regards,
Piet
Publicado el 01,noviembre 2015 - 22:18
Thanks Piet,

I've left it as a column in the table, but the table control is only part of the solution. The user also wants the ability to export to Excel and if I had a break header, that would 'break' that part... So the final solution has the category as a column, has the AAF ' export to excel ' and (based on my recent post regarding report based on a table), I've created a report based on the table where I've set a break on category, so one way or another, the user can see the sales analysis, a report broken down by category or they can export to excel in a 'flat' format :spos:

...but thanks everyone who took the time to get involved...
Publicado el 01,noviembre 2015 - 22:34
Hello Darren

One way to produce a flat file for export is to offer that option to the user on a button and then refill the table and this time, in the break row display, make it blank If you also displayed your hidden "category" column the user has a file with no breaks and all the data they need.

Regards
Al