I need to Modify n-up datawindow after design like rows count from 4 row to 5 row
- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Modify n-up datawindow after design
- mahmoud mahmoud
- PowerBuilder
- Sunday, 20 November 2022 21:08 PM UTC
- Monday, 21 November 2022 06:40 AM UTC
- PowerBuilder
- # 1
AFAIK, Rework is the only solution. Let's wait what others say.
- Sunday, 20 November 2022 21:38 PM UTC
- PowerBuilder
- # 2
Hi Mamoud;
Do you mean vertical "columns" from 4 => 5?
Regards ... Chris
- Monday, 21 November 2022 11:13 AM UTC
- PowerBuilder
- # 3
i want to change it from 4 to >=5 but after finsh datawinow setup and save datawindow
- Chris Pollach @Appeon
- Monday, 21 November 2022 16:09 PM UTC
-
Helpful Loading... Helpful 0
- Monday, 21 November 2022 12:30 PM UTC
- PowerBuilder
- # 4
There is no easy way to do that. N-up style isn't a simple style. Even syntaxfromsql doesn't support this style. But for a simple n-up datawindow (where you have not done to many optimizations this could be done. Of course the easiest would be to do the opposite! To change a datawindow from 5 to 4 columns is easier than to change it from 4 to 5. That's because you would simply have to get the datawindow syntax (using libraryexport for example) and delete column with row_in_detail = x and the corresponding header (starting always from the end).
In the contrary, adding a row (directly in syntax) implies following steps:
- Add header (if you use one -> Duplicate the last one). Header name should be <colname>_t_<colno>. Example third column for lname would be: lname_t_3.
- Add column (simply duplicate the last one). You have to give the right value to row_in_detail property. For the previous header it would be: row_in_detail=3
- Reposition header and column position in x axis. Positioning should be something like (new_object.x) = (previous object).x + (previous object).width + (some additional threshold ex: 14 pb units).
Those steps can give the syntax. Then you will have to use datawindow create function. If your syntax has no errors your datawindow should be functioning.
Andreas.
- Monday, 21 November 2022 16:58 PM UTC
- PowerBuilder
- # 5
Save yourself a LOT of grief and simply recreate the N-up datawindow.
That's a safer and much faster alternative to trying to rework the syntax of the existing N-up datawindow.
- Tuesday, 22 November 2022 14:40 PM UTC
- PowerBuilder
- # 6
This isn't that difficult to do.
Edit source of the datawindow (back it up first), find "rows_in_detail", change to new number, save and close DW source.
Edit datawindow normally, highlight/copy/place the objects for one full "row" of data. Before de-selecting new objects, set TAG to "fixme" (or something unique within the datawindow). Save and close datawindow.
Edit source again, find the unique string. The block of copied objects *should* be at the end of the file, if not, you'll need to find the unique string throughout the file.
For each found column object, the property order should be row_in_detail, name, tag. You can change the properties to match your needs. If you want to remove the tag property as you go, delete the entire 'tag="fixme"' text (spaces don't seem to matter here, leave an extra or delete it, it'll be fine). Computes will be similar, but editing them isn't as easy. If you have embedded CRLF in your compute source, it'll span multiple lines of text in the source code editor as well. Just be careful to NOT sort the lines of text, or accidentally remove text that's part of the object syntax (nominally, each line in the DW source is one object, but anything with computed properties *might* have multiple lines, so be careful).
Once all of the source changes are saved, you should be able to open in graphics mode and test the retrieve to see if it all looks ok.
- Page :
- 1
However, you are not allowed to reply to this question.