[WD19] Change Static value in a Table Break control

Startbeitrag von DarrenF am 22.02.2015 15:43

Hi guys,

I have a Table control with a Break. I've placed a Static control on the Break header to display a string (product description).

Now, to avoid having to refresh the whole Table again, I thought I would try to change it directly. The online Help gives a few examples, but I can't seem to get it to work, even if I issue a TableDisplay.

Does anyone know the syntax to do this?

Antworten:

Hello Darren

Let me complain first, ok :)

The whole table break process is really weird and only half complete and still after all these years has no proper sub total function with sub totals in columns.

Ok, I am calmer now.

This is code that I use in the table row display and I don't think it is the best way but after quite a few hours fiddling with other methods, this works so we keep using it.

I set the colours, then I have to check for "CR" and Tabs because the data is from users
The string comes from the current row
I think the secret is the single fullstop instead of the more usual ".."

WorkTypeBreakHeader..BrushColor = SysInfo3.EStProdItemBGrndColour
WorkTypeBreakHeader..Color = SysInfo3.EStProdItemTxtColour
LBUHeaderString = BU_TABLE.BU_WorkType[BU_TABLE]
LReplaceString is string =""
LReplaceString = Replace(LBUHeaderString,CR," ")
LReplaceString = Replace(LReplaceString,TAB," ")
BU_TABLE[BU_TABLE].WorkTypeBreakHeader = LReplaceString

Regards
Al

von Al - am 22.02.2015 16:29
Hi Al,

Yes, I'm starting to get a little tiny bit frustrated with this processing as well :mad:

If I do it your way, I get an error saying it's trying to update ".", presumably because it's expecting a ".."!

The Table content is derived from a query. The "ProductTitle" is linked to the "Title" returned in the query.

The Break header on the Table control looks like this:
[attachment 1362 HeadBreak.PNG]

My code is as follows but nothing seems to happen:

WTABLE_Product_Variants[glocaliTempPosN].WLPBRK_BreakHeader1.WSTC_ProductTitle = "xxxxxxxx"


If I use the following code it errors:

WTABLE_Product_Variants[WTABLE_Product_Variants].WLPBRK_BreakHeader1 = "xxxxxxx"



Error at line 347 of Click WPB_Save process.
Attempt to modify value of .
type: Internal Object.
No value can be assigned to this type of object.


von DarrenF - am 22.02.2015 19:03
Hello Darren

Sorry but I may have mislead you. My code is not in the table row display but in the break header code.

Regards
Al

von Al - am 22.02.2015 19:44
Hmm, yeah, what I'm trying to do is update the text in the header only, i.e. I don't want to Hexecute the query again as it takes too long to run.

von DarrenF - am 22.02.2015 21:09
Hello Darren

The text for my header is contained in an invisible column of the table I am presenting onscreen so if you included your data in each row you could use the breaks without having the re-run the query.
I am working with memory tables

Regards
Al

von Al - am 22.02.2015 21:41
Hi Al,

Sounds similar to what I have. I too have an invisible column returned by the query but then I place a static in the header and Link it to the corresponding query column.

How have you configured your table control? Are you actually using the in-built Table breaks?

von DarrenF - am 22.02.2015 22:01
Hi,

I'm a bit rusty on Windev, but I think you need to use any subscript from a row belonging to the break you need to address.
Do a tablesearch on the column for each item that triggers a break.
To update the controls in the break you use that subscript.

Regards,
Piet

von Piet van Zanten - am 23.02.2015 09:32
Hello Darren

I am using the built in table breaks.
My static in the break header is not linked to anything. It gets its value from the code in the "Displaying a row of BreakHeader1" event

Regards
Al

von Al - am 23.02.2015 09:44
Hi Piet,

Yes, I have the subscript of the selected row in the break. Thanks for the pointer re TableSeek as I was about the start writing code to step backwards through the list to find the 1st item in the break. Hopefully the TableSeek function is lightning fast as there are a max of (potentially) 14,000 items (and growing) returned by the query.

von DarrenF - am 23.02.2015 10:21
Hi Al/Piet,

Ok, thanks for the info. Between your responses and Piet's response, I think I now have a good view of the processing I need to implement. I'll give your responses a try.

Thanks again guys - your help is much appreciated... :spos:

von DarrenF - am 23.02.2015 10:36
Darren,

My experience is that TableSeek is fast and ArraySeek is lightning fast.
So in some cases I'm using an extra array, following the table, just for this purpose. To find a row faaast.

But that doesn't affect your table-break issue. You can add the array-seek afterwards if you find it's getting slow.

von Arie - am 23.02.2015 10:52
Thanks everyone - a combination of all the comments in this thread help me fix this issue.

1) Unlink the static control from the query.
2) Add a line of code in the display break header.
3) After user presses the Save button, added TableSeek to find the first row of the break group + code to update the table control contents.

von DarrenF - am 24.02.2015 00:22
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.