cancel
Showing results for 
Search instead for 
Did you mean: 

Rich Text Control - Visible tags on .pasteRTF()

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Chris,

Why do I need to disable the Toolbar property?

I would like the user to view and use the toolbar.

Thanks!

Former Member
0 Kudos

Hi O;

  <My Bad> .. I thought that you had an issue with the toolbar appearing after the PasteRTF ( ) method.

  Looks like maybe you just want to turn the header off maybe ...

RTF_Control.ShowHeadFoot (xxxx, FALSE)

Regards ... Chris

Former Member
0 Kudos

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.

Former Member
0 Kudos

Ahhh ... that's probably your issue .... You need (which is what I do) to store the RTF data into a BLOB column!

What DBMS are you using?

Former Member
0 Kudos

Yes, that's probably it.

I'll change the column type.

I am using Sybase as DBMS.

Thanks

Former Member
0 Kudos

The Purrrrrrfect DBMS for that ... LOL!

Just change the column type to IMAGE and don't forget to set AutoCommint = TRUE in your SQLCA.

Are you using the native client driver?

Former Member
0 Kudos

Yes, we're using the native client driver.

Thanks again

glenn_barber
Participant
0 Kudos

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

glenn_barber
Participant
0 Kudos

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

Answers (0)