Page 1 of 1
tDBRichViewEdit stopped working
Posted: Thu Mar 09, 2006 6:18 am
by Mitcht
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?
Posted: Thu Mar 09, 2006 8:01 am
by Sergey Tkachenko
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:
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;
Posted: Thu Mar 09, 2006 2:32 pm
by Mitcht
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!
Posted: Thu Mar 09, 2006 3:00 pm
by Sergey Tkachenko
I do not think that the problem is because of BCB update, but may be the problem is because of trichview update
Posted: Fri Mar 10, 2006 12:27 am
by Mitcht
OK, upgraded tRichView to version 1.9.8, still having the same problem.
Posted: Fri Mar 10, 2006 12:54 pm
by Sergey Tkachenko
Can you send me a sample of such document (see the instructions how to save it to file above)
Posted: Fri Mar 24, 2006 2:02 pm
by Kym
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.
Posted: Fri Mar 24, 2006 2:19 pm
by Sergey Tkachenko
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)
Posted: Fri Mar 24, 2006 5:24 pm
by Kym
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 thought that all Blob fields stores Binary data, thats why they are called Binary Large Object (Blob).
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
Posted: Fri Mar 24, 2006 7:35 pm
by Sergey Tkachenko
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.
Posted: Sat Mar 25, 2006 2:27 am
by Kym
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.
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..
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.