Layout sequence on multirecord form

Author: mail@gandg.it (TheAleph)

Hi all, in a multirecord form the sequence in which the data is displayed is horizontal (eg on 3 columns ) REC 1 REC 2 REC 3 REC 4 REC 5 REC 6 REC 7 REC 8 REC 9 REC 10 REC 11 etc.. is there a way to change the sequence vertically (eg) REC1 REC 6 REC 12 REC 2 REC 8 etc ... REC 3 REC 9 REC 4 REC 10 REC 5 REC 11 I've tried using the bottom scroll bar but it does not work. thanks

8 Comments

  1. Just sort your occurences against a calculated position number: depending on the amount of hits jou calculate the "length" of the table in our example 5 (you missed record 7 in the sorted) and the width which is 3 the Row is calculates by the (occ) modulo 5 the position number is at first the column positionwhich the column is the integer division of the (occurence -1) by the length to make it sortable just take row*100 + column Example: occ 1 ; row = 1%5 = 1 ; columns = (1-1)//5 = 0 ; position key = 100 occ 2 ; row = 2%5 = 2 ; columns = (2-1)//5 = 0 ; position key = 200 occ 6 ; row = 6%5 = 1 ; columns = (6-1)//5 = 1 ; position key = 101 occ 11 ; row = 11%5 = 1 ; columns = (11-1)//5 = 3 ; position key = 103


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. Thanks for your answer Uli, but this is not the solution; the problem is not sorting but the sequence of data display......... now using the right scroll bar I read records from left to right, and from top to bottom, so when the records are more then displayed the scroll bar is used to move from top to bottom up and down. The right scoll bar must lock the columns, the bottom scoll bar must lock the lines ..... In the following example 8 recs on 3 columns .... 3 recs on 1st line, 3 recs on 2nd line, 2 recs on 3rd line column 1 column 2 column 3 (no other columns) line 1 xxxxxxx xxxxxxx xxxxxxx line 2 xxxxxxx xxxxxxx xxxxxxx line 3 xxxxxxx xxxxxxx line 4 +if necessary I expect that when I use the bottom scroll bar the sense is from left to right (for logical) In the following example 8 recs on 4 lines .... 4 recs on 1st column, 4 recs on 2nd column, 0 recs on 3rd column column 1 column 2 column 3 +if necessary line 1 xxxxxxx xxxxxxx line 2 xxxxxxx xxxxxxx line 3 xxxxxxx xxxxxxx line 4 xxxxxxx xxxxxxx ( no other lines) Sorry but it's hard to build in text file........if you need I can send by email an excel file. thanks


    Author: TheAleph (mail@gandg.it)
  3. I'm confused: may be I have not understood what you need. Maybe it's just a wrong interpretation what the scrollbar does: in fact it's a simple "next occurence" for the entity this functionality doesn't know (and care) that you have painted repetitions on your screen. I understood that you want a 3 column display with the first occurences in the first column, then the second one is filled and the 3rd on at last. just like you have it in a telephone book. REC1 REC6 REC11 REC2 REC7 REC12 REC3 REC7 REC13 REC4 REC9 REC5 REC10 To make it a pretty layout, you have to create some empty occurences your hitlist is always (lines*columns) Otherwise it will look after the sort: REC1 REC6 REC11 REC2 REC7 REC12 REC3 REC7 REC13 REC4 REC9 REC5 REC10 But this assumes that all records can be showed (I developed that for a printout where the position calculation included some page number). It's correct that when you have more records to show it may look messy. Instead of using the scrollbar, you can paint 2 buttons which jump through your hitlist in steps of your columns (here 3) the only thing is that you do not advance the position if you are already on the "last line"


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. Set scroll bars off, use buttons instead. In Detail trigger off the scroll down button put: Setocc $entname, $curocc($entname) + 3 When you have 3 columns. Is that what you need?


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  5. ulrich-merkel said It's correct that when you have more records to show it may look messy. Instead of using the scrollbar, you can paint 2 buttons which jump through your hitlist in steps of your columns (here 3) the only thing is that you do not advance the position if you are already on the "last line"

    You get an even better support if you jump not in units of rows, but of pages: (but you must not do the next-jump when you are on the last-page now) (and you have to fill not only the line, but the whole page with empty occurences). All you have to have do calculate a pagenumber as the integer division of the original occurrence by the product of columns and intented rows per page. multiply by 10000 and add it to the sortkey. For the calculation of the row within the page, you should use occ%(columns*rowspp). rowspp = rows per page, columns= colums to be shown page-position = occ//(columns*rowspp) row-position = (occ%(columns*rowspp))//rowspp column-position = occ%(colums) + 1 sort-key = column-position + 100 * row-position + 10000 * page-position


    Author: ulrich-merkel (ulrichmerkel@web.de)
  6. Hi Roberto, you (and your end-user) can keep the scrollbar if you take the following concept: To have 15 records as a single occurence on you form, paint a temporary entity MYPAGE which has fields where you want to display the records: FLD1 FLD6 FLD11 FLD2 FLD7 FLD12 FLD3 FLD7 FLD13 FLD4 FLD9 FLD14 FLD5 FLD10 FLD15 then you traverse your dataentity hitlist and assign the data to the display fields with: forentity DATAENTITY selectcase($curocc(DATAENTITY)%15) case 1: creocc "MYPAGE",-1 FLD1.MYPAGE = DATAFIELD.DATAENTITY case 2: FLD2.MYPAGE = DATAFIELD.DATAENTITY ... case 0: FLD15.MYPAGE = DATAFIELD.DATAENTITY endselectcase endfor P.S: I had not access to my uniface development, so there may be typos in the code example.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  7. Thanks Uli and Theo for your time, I'm going to try your suggestions; I expected that Uniface was able to automatically process the data as required, but didn't. In your opinion could be, this one, added into the wishlist ? Bye


    Author: TheAleph (mail@gandg.it)
  8. TheAleph said In your opinion could be, this one, added into the wishlist ?

    Hi Roberto, based on my experiences with the wishlist, implementing my solution (and all other dITo ones) and have a working software is a much better use of your time.


    Author: ulrich-merkel (ulrichmerkel@web.de)