Dataset.Post clears formatting/unicode from TDBRichViewEdit
-
- Posts: 13
- Joined: Wed Oct 22, 2014 9:37 am
- Location: UK
Dataset.Post clears formatting/unicode from TDBRichViewEdit
Hi,
(Please bear with me, I am new to the TRichView components)
I have a blob field in a SQL Server database that I've hooked up a TDBRichViewEdit component (via FireDAC & RemObjects DataAbstract)
If I paste in unicode characters they're showing fine until I call dataset.post (via a Save button) and then the unicode characters change to ????
If I make any formatting changes (bold, Heading style) etc, they are all lost when Post is called.
There are no beforePost/afterPost events on the dataset.
I've replaced the TDBRichViewEdit component with another one straight off the component palette (i.e. to ensure that I haven't switched any properties), and it still does the same thing.
The formatting functions (styles, font name and font size) are all lifted straight from your REditor demo.
Note, this _was_ working earlier, but I don't know what I've done wrong?
Do you have any suggestions please?
Thanks,
Stuart
Delphi XE6
RichView 15.1.2
(Please bear with me, I am new to the TRichView components)
I have a blob field in a SQL Server database that I've hooked up a TDBRichViewEdit component (via FireDAC & RemObjects DataAbstract)
If I paste in unicode characters they're showing fine until I call dataset.post (via a Save button) and then the unicode characters change to ????
If I make any formatting changes (bold, Heading style) etc, they are all lost when Post is called.
There are no beforePost/afterPost events on the dataset.
I've replaced the TDBRichViewEdit component with another one straight off the component palette (i.e. to ensure that I haven't switched any properties), and it still does the same thing.
The formatting functions (styles, font name and font size) are all lifted straight from your REditor demo.
Note, this _was_ working earlier, but I don't know what I've done wrong?
Do you have any suggestions please?
Thanks,
Stuart
Delphi XE6
RichView 15.1.2
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 13
- Joined: Wed Oct 22, 2014 9:37 am
- Location: UK
Thanks for your reply Sergey.
Right click on component > Settings...
I have "Allow adding styles dynamically" ticked.
Here's a screen grab of all three settings pages:
http://imgur.com/4wUzcrg
Thanks
Stuart
Right click on component > Settings...
I have "Allow adding styles dynamically" ticked.
Here's a screen grab of all three settings pages:
http://imgur.com/4wUzcrg
Thanks
Stuart
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 13
- Joined: Wed Oct 22, 2014 9:37 am
- Location: UK
Hi,
No it has it's own RVStyle component.
I just put together a test app (connected to the same DB server) and the TDBRichViewEdit behaves as expected.
So I copied and pasted the RVStyle & DBRichViewEdit components from the test app to the 'real' app, and the problem still persists.
I am really stuck with this, don't know what I am doing in the 'real' application to make it behave like this.
I have made a short gif to show what happens in my app:
http://imgur.com/mxnTYev
Thanks for your continued assistance,
Stuart
No it has it's own RVStyle component.
I just put together a test app (connected to the same DB server) and the TDBRichViewEdit behaves as expected.
So I copied and pasted the RVStyle & DBRichViewEdit components from the test app to the 'real' app, and the problem still persists.
I am really stuck with this, don't know what I am doing in the 'real' application to make it behave like this.
I have made a short gif to show what happens in my app:
http://imgur.com/mxnTYev
Thanks for your continued assistance,
Stuart
-
- Posts: 13
- Joined: Wed Oct 22, 2014 9:37 am
- Location: UK
I think this might be significant:
I wanted to see the 'raw' contents of the field behind the TDBRichViewEdit, so I added a TDBMemo component on the same form.
The TDBMemo shows the text from the DBRichViewEdit, but (obviously) in plain text, even though rvfoSaveBinary is flagged on the DBRichViewEdit control and fieldformat = rvdbRVF.
The underlying field is a blob field - SQL Server type "varbinary(max)".
Does this help ?
Thanks
Stuart
I wanted to see the 'raw' contents of the field behind the TDBRichViewEdit, so I added a TDBMemo component on the same form.
The TDBMemo shows the text from the DBRichViewEdit, but (obviously) in plain text, even though rvfoSaveBinary is flagged on the DBRichViewEdit control and fieldformat = rvdbRVF.
The underlying field is a blob field - SQL Server type "varbinary(max)".
Does this help ?
Thanks
Stuart
-
- Posts: 13
- Joined: Wed Oct 22, 2014 9:37 am
- Location: UK
Here's another gif that shows the DBRichViewEdit and a DBMemo attached to the same field.
At the start, the contents are obviously binary (edited in my test app)
When I edit the DBRichViewEdit nothing happens until I try to bold some text - then the RAW field contents change to plain text.
Then hitting Save (i.e. Dataset.Post) converts the DBRichViewEdit to plain text as well.
http://i.imgur.com/9tPYLDe.gif
Thanks
Stuart
At the start, the contents are obviously binary (edited in my test app)
When I edit the DBRichViewEdit nothing happens until I try to bold some text - then the RAW field contents change to plain text.
Then hitting Save (i.e. Dataset.Post) converts the DBRichViewEdit to plain text as well.
http://i.imgur.com/9tPYLDe.gif
Thanks
Stuart
-
- Site Admin
- Posts: 17564
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 13
- Joined: Wed Oct 22, 2014 9:37 am
- Location: UK
Hi Sergey,
I didn't have OnSaveCustomFormat event assigned.
However, your comment got me to question the FieldFormat property and I then found that my code was setting the FieldFormat to 'Text' during the formcreate event. (the record in the database can be either rich text or plain text and my IF statement was wrong.
Phew.
Many many thanks for your help -- great support & I apologise for making such a newbie mistake.
Stuart
I didn't have OnSaveCustomFormat event assigned.
However, your comment got me to question the FieldFormat property and I then found that my code was setting the FieldFormat to 'Text' during the formcreate event. (the record in the database can be either rich text or plain text and my IF statement was wrong.
Phew.
Many many thanks for your help -- great support & I apologise for making such a newbie mistake.
Stuart