tDBRichViewEdit stopped working
tDBRichViewEdit stopped working
Hi,
Have been using RichView in a project for a while now. Upgraded Delphi 6 with Borland's RTL 3 update a few months ago, but did not have any issues. Just went into the richview part of the program and ...
The tDBRichView edit used to work OK, but now it displays this:
-8 1 3
-9 2 0 0 2 0 1
RVStyle1
ø
Was this the RTL update, or is something else upset with me?
Have been using RichView in a project for a while now. Upgraded Delphi 6 with Borland's RTL 3 update a few months ago, but did not have any issues. Just went into the richview part of the program and ...
The tDBRichView edit used to work OK, but now it displays this:
-8 1 3
-9 2 0 0 2 0 1
RVStyle1
ø
Was this the RTL update, or is something else upset with me?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Displaying text like this in DBRichViewEdit means that the component fails to load document in RVF format and loads it as a plain text.
Usually it may happen if the document does not contain collections of styles, but your document does: the line "-9 2 0 0 2 0 1" begins saving a collection of text styles.
1) Make sure that the DBRichViewEdit's properties RVFTextStylesReadMode and RVFParaStylesReadMode are both equal to rvf_sInsertMerge
2) May be document is failed to read by another reason (including damaged table).
You can save it in a file and send it to me:
Usually it may happen if the document does not contain collections of styles, but your document does: the line "-9 2 0 0 2 0 1" begins saving a collection of text styles.
1) Make sure that the DBRichViewEdit's properties RVFTextStylesReadMode and RVFParaStylesReadMode are both equal to rvf_sInsertMerge
2) May be document is failed to read by another reason (including damaged table).
You can save it in a file and send it to me:
Code: Select all
var Stream: TStream;
FileStream: TFileStream;
begin
Stream := Table1.CreateBlobStream(Table1.FieldByName(FieldName), bmRead);
FileStream := TFileStream.Create('FieldData.rvf', fmCreate);
FileStream.CopyFrom(Stream, 0);
FileStream.Free;
Stream.Free;
Hi Sergey, good to hear from you again!
The database is OK. The reason I know this is because I have an earlier hard disk without the borland update, and it's version of the program works fine.
Also, no changes to the document code were made.
So, any problems with this borland update?
By the way, by version of RV shows as 1.9.14.1
Here are teh files which the RTL lib update changes I can send them to you if you want to test:
c:\program files\borland\delphi6\Source\RTL\Common\Classes.pas
c:\program files\borland\delphi6\Lib\Classes.dcu
c:\program files\borland\delphi6\Lib\Debug\Classes.dcu
c:\program files\borland\delphi6\Lib\rtl.dcp
c:\program files\borland\delphi6\MergeModules\BaseRTL.msm
c:\winnt\System32\rtl60.bpl
c:\winnt\System32\rtl60.map
c:\winnt\System32\rtl60.jpn
Many thanks!
The database is OK. The reason I know this is because I have an earlier hard disk without the borland update, and it's version of the program works fine.
Also, no changes to the document code were made.
So, any problems with this borland update?
By the way, by version of RV shows as 1.9.14.1
Here are teh files which the RTL lib update changes I can send them to you if you want to test:
c:\program files\borland\delphi6\Source\RTL\Common\Classes.pas
c:\program files\borland\delphi6\Lib\Classes.dcu
c:\program files\borland\delphi6\Lib\Debug\Classes.dcu
c:\program files\borland\delphi6\Lib\rtl.dcp
c:\program files\borland\delphi6\MergeModules\BaseRTL.msm
c:\winnt\System32\rtl60.bpl
c:\winnt\System32\rtl60.map
c:\winnt\System32\rtl60.jpn
Many thanks!
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I have the same problem using Delphi7 and Firebird on WinXP.
The DDL of the field wich will store the RichText is: BLOB SUB_TYPE 1 SEGMENT SIZE 80
When I commit the the contents of the field on the database, it saves and load/reload as:
-8 1 3
-9 2 0 0 2 0 1
I could override this using FieldFormat as rvdbRTF instead of rvdbRVF, after that change, the storage was made correctly and I was able to load the field with the correct formats.
The DDL of the field wich will store the RichText is: BLOB SUB_TYPE 1 SEGMENT SIZE 80
When I commit the the contents of the field on the database, it saves and load/reload as:
-8 1 3
-9 2 0 0 2 0 1
I could override this using FieldFormat as rvdbRTF instead of rvdbRVF, after that change, the storage was made correctly and I was able to load the field with the correct formats.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I thought that all Blob fields stores Binary data, thats why they are called Binary Large Object (Blob).Sergey Tkachenko wrote:One of possible reasons - the chosen field type cannot store binary data.
RVF is a binary format (if rvfoSaveBinary is included in RVFOptions (default)), while RTF is a text format (it uses only characters with codes <128 and ignores line breaks in text)
I use them to save images, sounds, movies, rich texts, etc..
Anyways, if I use RVF without rvfoSaveBinary, it is the same as use RTF? (I ask this based on what you said above)
Thanks for fast answer too
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Well, if it can contain images, it must be able to contain binary RVF.
But it can be easily verified. If the problem remains after excluding rvfoSaveBinary, the reason is different.
RVF saved with excluded rvfoSaveBinary option contains exactly the same data as normal RVF, but all binary data are encoded in text strings. It becomes slower to read and larger in size. But it is not an RTF.
Another possible reason for this problem - incorrect properties settings.
Right click DBRichViewEdit in Delphi, choose "Settings" in the popup menu, make sure that the mode "Allow adding styles dynamically" is set.
But it can be easily verified. If the problem remains after excluding rvfoSaveBinary, the reason is different.
RVF saved with excluded rvfoSaveBinary option contains exactly the same data as normal RVF, but all binary data are encoded in text strings. It becomes slower to read and larger in size. But it is not an RTF.
Another possible reason for this problem - incorrect properties settings.
Right click DBRichViewEdit in Delphi, choose "Settings" in the popup menu, make sure that the mode "Allow adding styles dynamically" is set.
Hmm, well, I dont have large size texts, my project is all about small texts with most 10~30 lines of just text with formated options, no images at all, no tables, nothing except text and format options, such as bold, italic, alignment, and so on..Sergey Tkachenko wrote:Well, if it can contain images, it must be able to contain binary RVF.
But it can be easily verified. If the problem remains after excluding rvfoSaveBinary, the reason is different.
RVF saved with excluded rvfoSaveBinary option contains exactly the same data as normal RVF, but all binary data are encoded in text strings. It becomes slower to read and larger in size. But it is not an RTF.
Another possible reason for this problem - incorrect properties settings.
Right click DBRichViewEdit in Delphi, choose "Settings" in the popup menu, make sure that the mode "Allow adding styles dynamically" is set.
I'll have lots of records with that small fields, like millions in a year, however I'll load single records, mount them, in like 2~5 records, and then print the result.
My quest is: Whats the difference between RTF and RVF in my case? Wich one should I use?
Thanks again.