|
| [WD19] Change Static value in a Table Break control |
| Iniciado por guest, 22,feb. 2015 16:43 - 14 respuestas |
| |
| | | |
|
| |
| Publicado el 22,febrero 2015 - 16: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? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,febrero 2015 - 17:29 |
Hello Darren
Let me complain first, ok <img src="/NG2013_WEB/ui/smiley/1.gif" align=absmiddle border=0 alt=":)">
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,febrero 2015 - 20:03 |
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. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,febrero 2015 - 20:44 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,febrero 2015 - 22:09 |
| 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. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,febrero 2015 - 22:41 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 22,febrero 2015 - 23:01 |
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? |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 09:59 |
Hi,
Actually, you can adress the few allowed controls in the breaks right away. Put this in the 'Displaying a row of BRK_HeaderDoc'
nTmpBreakSubscript is int= TableBreakSubscript(BRK_HeaderDoc) IF nTmpBreakSubscript > 0 THEN TABLE_T[nTmpBreakSubscript].STC_Periode..Visible = False TABLE_T[nTmpBreakSubscript].STC_Periode = TABLE_T[nTmpBreakSubscript].COL_Periode TABLE_T[nTmpBreakSubscript].STC_Periode..visible = True END
Note: coding the 'TABLE_T[nTmpBreakSubscript].STC_Periode..Visible = False' and later again true is not always necessaire. It just prevents some artefarcts on the screen I just had a few times. With a shorter new text in the static parts of the previous text still were shown, but with invisible / change / visible that was solved.
Be aware of this: the use of 'Displaying a row of BRK_HeaderDoc' ONLY fills the visible breaks. So, if for any reason you want to adress a static on a break that has not been shown yet, it keeps the blanc or the previous initialized value, till the break has been shown (again) on the screen. If you want to avoid that, you can browse programmically through all the breaks and initialize/change them at once.
Tip: with the same technique you can calculate totals and subtotals yourself and put them in the BRK_Footer (and even in the BRK_Header). Maybe not ten times as fast but (compared to other ways of doing it) maybe five times (still a big gain), just after you have figured it out how to do it.
Kind regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 10:32 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 10:44 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 11:21 |
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. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 11:36 |
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: |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 11:52 |
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. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,febrero 2015 - 14:31 |
No need for a TableSeek.
<Result> = TableBreakSubscript(<Break Header/Footer> [, <Subscript>])
[, <Subscript>] = the row from which you request the header/footer from and <Result> is what you are looking for.
Result is instantly, even in a 100.000 row memory-table (yes, I tried that!).
Kind regards |
| |
| |
| | | |
|
| | |
| |
| Publicado el 24,febrero 2015 - 01:22 |
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. |
| |
| |
| | | |
|
| | | | |
| | |
|