1. Mark Montgomery
  2. PowerBuilder
  3. Thursday, 10 February 2022 13:41 PM UTC

In PowerBuilder 2019 R2, we have a datawindow with a column that is 5000 characters.  Users typically paste data into this column (from clipboard).  However, if the data being pasted in is greater than 1024 characters, the column will not allow that (nothing is pasted in).  The Limit on the Edit tab is 0 and I've changed that to 5000 with same result.

If I paste in 1024 characters and then try to enter more characters, that is not allowed, either.

When data is retrieved from that column, more than 1024 characters are retrieved/displayed.  If data is saved to a file and then imported into the datawindow, the full column is displayed/saved but I am trying to eliminate that step if possible.

Is there a solution for this?  Seems like I'm missing something simple, but I don't know what it could be.

Thanks,

Mark

Mark Montgomery Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 20:21 PM UTC
  2. PowerBuilder
  3. # 1

Everyone,

Sorry for another message but I found a workaround.  Instead of having the users paste directly into the datawindow, I added a Paste command button which gets the value from the ClipBoard and does a SetItem with it.  That seems to be working.  Should've thought of that earlier.

Thanks for the responses!

Mark

Comment
There are no comments made yet.
Mark Montgomery Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 20:07 PM UTC
  2. PowerBuilder
  3. # 2

Chris, Ronnie, and Miguel,

The specification pane shows Type of char(5000) and the datawindow source shows type=char(5000).  The datawindow is a tabular datawindow and I've tried with the column having the Auto Horizontal Scroll checked and unchecked (and all combinations with the Auto Vertical Scroll and Horizontal Scroll Bar and Vertical Scroll Bar checked / unchecked) and still experiencing same behavior.  Very odd.

Thanks,

Mark

Comment
There are no comments made yet.
Mark Montgomery Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 19:58 PM UTC
  2. PowerBuilder
  3. # 3

John,

When I recreate what you did with a new window and datawindow, I see the same behavior.  I get an ll_rc of 0.

Thanks,

Mark

Comment
  1. John Fauss
  2. Thursday, 10 February 2022 20:38 PM UTC
I see from your recent response that the presentation style of your DW is Tabular, and I used Freeform - Obviously, the presentation style makes a difference! I'm glad to hear you found a solution that works for your situation, and thank you for sharing it with us!
  1. Helpful
  1. John Fauss
  2. Friday, 11 February 2022 04:59 AM UTC
One additional comment: I re-tested my earlier test scenario using a tabular DW instead of a freeform presentation style, using the same code to paste the Windows Clipboard contents into the char(5000) column... and it worked successfully, so use of the tabular presentation style is NOT the cause of Mark's issue.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 18:20 PM UTC
  2. PowerBuilder
  3. # 4

Apart from all the good advice,

Edit the source code of your dw and check what's specified in the column's type. Probably char(1024) which you'll have to change to char(5000).

regards.

Comment
  1. Miguel Leeuwe
  2. Thursday, 10 February 2022 18:23 PM UTC
Another less likely problem, might be one that uses / used to occur when you paste some column from one datawindow to another and which would have some epxression which wasn't valid on the destination dwindow. The internal id= would then get mixed up and when you think you're accessing column A, you might be accessing column B.
  1. Helpful
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 17:46 PM UTC
  2. PowerBuilder
  3. # 5

Did you make sure that either "Auto Horizontal Scroll" (or "Auto Vertical Scroll" for free form DW) is checked in the painter properties for that column?

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 16:49 PM UTC
  2. PowerBuilder
  3. # 6

Hi Mark;

   How is that column defined in the DWO's "specification" pane?

Regards ... Chris

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 10 February 2022 15:40 PM UTC
  2. PowerBuilder
  3. # 7

Hi, Mark - 

Using PB 2019 R3, I'm unable to reproduce the issue you are experiencing. I created a test external source DW data object that contains a string(5000) data column named "info". In a test window, I initialized the DW control in it's Constructor event with InsertRow(0). to create and see one row. In a command button is the following script:

Long ll_rc

dw_1.SetColumn("info")
ll_rc = dw_1.Paste()

MessageBox("Paste Results","RC = " + String(ll_rc))

Using Notepad++, I copied 4,412 characters of text from a file into the Windows Clipboard. Running the test app and clicking the command button to run the above script results in the following:

Showing that 4,412 characters were pasted into the DW's "info" data column, and I can see all of the pasted text in the column.

This test took only a few minutes to set up. Can you attempt to do same/similar with a new, external source DW and test window? If it works, then the problem you're experiencing in your app is in the DW, the data, or the code. You may need to provide some more, specific information as to the source of the data being copied (Word document, spreadsheet, etc.), the DWobject definition for the column object (from exported DW source, for example), and the code you are using to perform the paste operation.

Best regards, John

 

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 10 February 2022 20:16 PM UTC
Thanks for testing that John on R3!

@Mark: This might be a good case for up grading to PB2019 R3 (LTS edition). The current build is 2728.
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.