on 09-08-2015 11:26 AM
Getting the text from the database and pasting it to the Richt Text Control, I get some of the tags/formatting visible, which I don't see how to get rid of.
The text owidctlpar gets stored together with the text originally entered in the control.
1. Get data and paste in control
rte_control.setredraw(FALSE)
ls_input = lds_data.getitemstring(ids_data.getrow(), 'description')
rte_control.pasteRTF(ls_input, Detail!)
rte_control.setredraw(TRUE)
2. Get the text from control and store to database
rte_control.setredraw(FALSE)
ls_input = rte_control.copyRTF(FALSE, Detail!)
lds_data.setitem(lds_data.getrow(), 'description', ls_input)
rte_control.setredraw(TRUE)
Checking the string in the database, I can find the owidctlpar, which seems to be part of the header.
\headery720\footery720\pgwsxn11905\pghsxn16838\marglsxn0\margtsxn0\margrsxn0\margbsxn0\pard\itap0
owidctlpar
For everytime I save, I get a new owidctlpar part in the string.
Hi O;
1) make sure that the "Toolbar" property on not ON in the RTE Control.
2) make sure that somewhere in your code it does not enable the "toolbar" property
3) Your application does not use the ShowHeadFoot (xxxx, TRUE) option.
regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, that still does not "remove" the owidctlpar text.
It is only visible when retrieving the data from the database, and using copyRTF method to load it into the control again.
The data is stored in a long varchar field, could it be something with the way it is stored? Should I use another datatype?
This RTF control seems rather buggy at first glance.
HI Chris
We have an application which is using a varchar text field for entry and they would like to use a rich text datawindow column for more functionality. It works - but pastes the owidctlpar in front of the text when it re-retrieves it - is there anyway to get this to work without having to convert the database text fields everywhere?
BTW using SQL Anywhere 12
O Steine
For your information I have documented this issue and reported to SAP Support as below related to DisableBind=1 as below.
I've been investigating an issue migrating our 10.5 apps which use rich text edits and save data to a SQL Anywhere 12 database on a long nvarchar column.
It works perfectly in 10.5 but in 12.6 the text written to the database is modified during the update to replace an embedded \n to a carriage return. I note that this is the case with the same ODBC connection to the same database - illustrating it is not an SA issue - but possibly a datawindow issue.
This results in the rich text returning to the RichTextEdit from the database looking like it has a a prefix "owidctlpar".
This is actually the corruption of the rich text control string segment string itap0\nowidctlpar where the \n is converted to a CR
Apparently this has been reported before as an issue and users have been told to set DisableBind=0 or convert the column to a long binary. Neither of these are an option for us. Apparently these fixes get around the problem (unfortunately neither a workable solution for us) - but there remains the following question.
Since the source to the column could be anything (not necessarily rich text) - could PB 12.6 be corrupting any long nvarchar (or nvarchar) data which contains an embedded "\n"???
I have sent test cases of this to SAP support - but I want the community to recognize that there could be a broader problem affecting those not using datawindows to store rich text.
Glenn
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.