Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Merge not working

Look at this code:

a = '1':@vm:'2':@vm:'3':@vm:'4':@vm:'5':@vm:'6':@vm:'7':@fm:"q":@fm:"a"
Set_Property(ctrl_notes$, "OLE.LIST", a)

set_Property(ctrl_notes$, "OLE.CellMerge[1;2]", "7":@fm:"2")

I expect the q and the a to be contained in one merged cell. But what i get is this:



As you can. the a is now showing .

What I want is for q and a to show in the same cell.
«1

Comments

  • You need to put "q" and "a" into the same cell. The cell containing "a" is hidden by the merging. The CellMerge property extends the target cell (e.g. cell 1;2) to cover up the cells requested (e.g, 7 columns and 2 rows). It does not merge data because there is no clear definition on how to do that. Every developer would expect different results. Thus, the developer is responsibly for deciding what goes into that extended cell.
  • hi, thank you. I was not clear enough in my initial post.

    I want q and a to appear in the same cell, but I want a to be on the line below q. Is this possible?
  • let me put it this way:

    Is it possible to display multi-line text in one cell? I know it's possible for the user to manually expand the cell to get multiple lines to show. Is it possible to make this expanding happen automatically? Basically, I want to mimic this in your edit table:


    I would like all of that text to appear in one cell.
  • @josh in addition to the CellMultilined property that was referenced in the other thread, you'll want to use the DataRow property to set the height of the row to be taller than the default.
  • thanks i will try this.
  • edited February 26
    thank you, this is perfect


    you have no idea how much you have helped me
  • Hi,

    I have now got the edit table working so that a cell contains and shows multiple lines. But I have run into another problem.

    When I scroll, the scrolling is very jittery. It seems like the scroll jumps from row to row, whereas I want the scroll to slowly move down or up a few pixels, not a row.

    Is this possible?
  • The table is not designed to scroll that way. It scrolls row by row. This is to account for the potential for very large data sets.
  • Ok, thank you for your response.In that case, let me ask you if this is possible.

    Instead of putting each line of text in the same row, I will put each line of text in its own row. This will make the scrolling smooth. However, the user won't be able to select multiple lines of text at the same time:



    All I want is for the user to be able to select multiple rows at the same time so that they can copy and paste part of the text.
  • I see. So, part of the problem is that you have really huge rows, which makes it scroll oddly. Going with multiple rows is going to be a trade-off. It will scroll better, but then you'll lose the convenience of multlilined cells. If you go the route of multiple cells, you can simulate multi-selection with code, i.e., responding to click events and manually settings the backgrounds of rows to a selection color. I've resorted to this on several occassions.

    Advanced UIs like these take a lot of manual effort.
  • edited March 6
    OK i might have to try something else.

    Do you think I could use the tree control to display this info?

    So each node of the tree would be the equivalent of a multilined cell in the edit table.
  • I think the SRP Tree Control will be worse. It is even more limited on how it displays information, and it's editing capabilities are very limited in scope.

    When it comes to free-form text, the best control is an EditBox. I'd use your table above, but when the user selects a row, the edit box is update with that row's notes/comments. It creates a nice separation of functionality that allows each control to do what it does best.
  • yes this is doable, but it will be strange that the text is repeated in two places.

    I might be able to just use a really big scrollable edit box to display all of the notes. But this will only work if it's possible to apply formatting to parts of the text within the edit box. Does the edit box have a markup language that I can use to format parts of the text?
  • edited March 6
    I have just though of another idea.

    So, it's possible to embed a web browser inside an OI form.

    I will display my multiline data in the web browser inside the oi form.

    The only problem is, how does OI know about clicks and such in the web browser? Well, when the user presses a button in the web browser, I will paste data into the windows clipboard in javascript. And since the click happened in the OI form, the click will trigger a click even in the OI form. In the OI form, I will check the clipboard's contents to notify myself about what action I need to take in response to what occurred in the browser.

    I am going to try this now and see if it works.
  • damn, this clipboard doesn't work because whenever you copy to the clipboard, IE puts up a message asking the user if they want the browser to alter the clipboard.
  • A web browser isn't very useful for editing text.

    Regarding my suggestion. When you said it would be weird to see the text is two places, I think you misunderstood me. I was suggesting you do not show the notes in their entirety (or possibly at all) in the table. The table would just display the other information. The edit box would be used to edit notes for the currently selected row in the table.
  • edited March 6
    Hi, thank you for your suggestion. But I think you misunderstand. I do not want the user to be able to edit the text, only highlight it with their cursor, which will allow them to copy it to the clipboard.

    Anyhow, I have figured it out I think. Look at this:





    Basically, I will have one big multiline cell that contains the note. Now, next to that cell will be multiple one line rows. When I scroll, the edit table will scroll smoothly because it will scroll from one small little row to the next, instead of to the next big row. See the screenshot above for what I mean.

    I have tested it in a test program and it works. Now I just need to get it working with the real code.

    Do you think this will work? It is working so far.


  • I see. I didn't realize it was readonly. I guess that's a solution, but it seems to be an odd compromise just to get smooth scrolling. Did you know that multi-line cells have a resize gripper in the bottom right corner? This allows users to stretch the cell (in edit mode) to larger sizes. This would allow you to make the note cell just one row high, but then the user could go into a readonly edit mode that allows them to stretch the cell bigger. In fact, that table will automatically stretch the cell when it gets focus, so long as it is a multilined cell.
  • This is a reportable rather than an edittable but it's the first example I could think of that demonstrates what I think Kevin was referring to.
    I think what he was suggesting was to not show the multiline text in the edittable at all but rather display it in an editbox for the selected row only.
    That way you can have many rows in your table, (by keeping the big column hidden) and then the verbose stuff is viewable only if really required.

  • Hi, this behavior doesn't suit the requirement. Basically, the users want to just scroll to be able to see everything. They don't want to have to click on a cell to give it focus so that the cell resizes to reveal the rest.


  • edited March 6
    @AusMarkB

    hi, the notes are not verbose stuff. They're the main pieces of data that the users care about.
  • HOLD THAT DOOR,
    I'll see myself out
  • @josh in the Customer Notes screen shot you posted as the UI you were trying to emulate, I see that the form has what I would refer to as header data (e.g., date, order no, keyword, type) and then the larger area with the main content (i.e., the "notes"). I also see the vertical scrollbar...but what would I see if I scrolled down? Would I see more header/notes or does this view only represent one note at a time?

    Regardless of your answer, I understand that you want to be able to scroll through the SRP EditTable to see multiple notes and their associated header data. Is scrolling to navigate to other notes a firm requirement? Why not have a way to navigate through the notes using VCR buttons? I think this would save you a lot of design hassle and might open up better features.
  • @DonBakke

    If you were to scroll further down, you would see the next note.

    I have talked to the users and they said that they want to scroll. I asked them about pressing a button to see the next note, and they said that that's too slow.

    Anyhow, I have got it working the way I want (see my screenshot above), but I think there is a bug in the edit table that is stopping me from continuing.

    Here is a screenshot of everything working correctly:



    And here is the code that creates the table

    Set_Property(ctrl_notes$, "OLE.Redraw", 0) column_titles = "" column_titles <1,-1> = "Date" column_titles <1,-1> = "Order No" column_titles <1,-1> = "Note No" column_titles <1,-1> = "Keyword" column_titles <1,-1> = "Type" column_titles<1,-1> = "Agent" column_titles<1,-1> = "" ncolumns = fieldcount(column_titles<1>, @vm) set_property(ctrl_notes$, 'OLE.Dimension', ncolumns:@fm:1) set_property(ctrl_notes$, "OLE.AllowInserts", 0) set_property(ctrl_notes$, "OLE.AllowDeletions", 0) set_property(ctrl_notes$, 'OLE.HeaderColumn[All]', 0:@fm:false$) set_property(ctrl_notes$, 'OLE.TitleList', column_titles) //set_property(ctrl_notes$, "OLE.ScrollBarsVisible", "Always":@FM:"Never") set_property(ctrl_notes$, "OLE.DataColumn[1]", 80) set_property(ctrl_notes$, "OLE.DataColumn[2]", 70) set_property(ctrl_notes$, "OLE.DataColumn[3]", 55) set_property(ctrl_notes$, "OLE.DataColumn[4]", 120) set_property(ctrl_notes$, "OLE.DataColumn[5]", 120) set_property(ctrl_notes$, "OLE.DataColumn[7]", 20) set_property(ctrl_notes$, "OLE.CellProtection[ALL;ALL]", "NONE") //set_property(ctrl_notes$, "OLE.CellType[7; 1]", 'PUB') /* data = "" for i = 1 to 3 a = '1':@vm:'2':@vm:'3':@vm:'4':@vm:'5':@vm:'6':@vm:'7':@fm:"qaaa":crlf$:@fm:"poo":@vm:" ":@fm:"poo":@fm:@fm:"poo":@fm:@fm:"poo":@fm:@fm:"poo":@fm:@fm:"poo":@fm data := a Next i Set_Property(ctrl_notes$, "OLE.LIST", data) set_Property(ctrl_notes$, "OLE.CellMerge[1;2]", "6":@fm:"10") Set_Property(ctrl_notes$, "OLE.CellMultilined[1; ":2:"]", 1) //Set_Property(ctrl_notes$, "OLE.DataRow[2]", "10") Set_Property(ctrl_notes$, "OLE.CellText[1; 2]", "aaaa":crlf$:"poo":crlf$:"aaaa":crlf$:"poo":crlf$:"aaaa":crlf$:"poo":crlf$:"aaaa":crlf$:"poo") Set_Property(ctrl_notes$, "OLE.CellAlignment[1; 2]", "T") set_property(ctrl_notes$, "OLE.CellProtection[ALL;ALL]", "RO") */ le = "" for i = 1 to 16 le<-1> = "1":@vm:"2":@vm"3":@vm:"4":@vm:"5":@vm:"6" le<-1> = "" le<-1> = "" le<-1> = "" le<-1> = "" le<-1> = "" le<-1> = "" le<-1> = "" Next i Set_Property(ctrl_notes$, "OLE.LIST", le) //set_Property(ctrl_notes$, "OLE.CellMerge[1; 2]", "6":@fm:"7") for j = 2 to 16*8 step 8 set_Property(ctrl_notes$, "OLE.CellMerge[1; ":j:"]", "6":@fm:"7") Next j //set_property(ctrl_notes$, "OLE.CellProtection[1;2]", "RO") Set_Property(ctrl_notes$, "OLE.Redraw", 1)


    However, when I change the 16 to a 17 in the above code, I get this:



    For all values bigger than 16, I get a variation of the above error.
  • I'm not trying to sidestep the potential bug (although it is getting late in the USA so no one here will be able to look at this with a clear head until tomorrow), but have you tried using the RowsToRecords property? I'm not sure if it will work the way I'm hoping it will, but one of the purposes of this property is to define a number of EditTable rows to be a virtual record...but it also preserves the formatting of your rows so that when you add more data records (e.g., using the InsertRecords method), it should create all of the EditTable rows with the same formatting style for you. Therefore you won't have to create weird logic that skips every 8 rows before doing a merge. If it does work, I think it will make your code much cleaner and easier to work with.
  • hi, the number of rows that each "note cell" can contain varies. So I don't think that it will work. For example, some could be 7, another could be 1, etc. In the code above, I just made everything be 7 for testing purposes.
  • I will just say, the numbers 16 and 17 seem to be very special numbers with regard to this control. Maybe these 2 numbers mean something to you?
  • edited March 6
    you know what, this is all too much. I am just going to go with kevin's initial suggestion. So when they click on a note, it will load the note in "Edit mode" on the side of the table in an edit box.

    Thanks all for your help.
  • Is all of it readonly? Or can users alter data? If it is all readonly data, then this is a report, which is better suited to OIPI or a web control.
Sign In or Register to comment.