Page 1 of 1

Number code style

Posted: Mon Jan 16, 2017 4:00 pm
by retwas
Hello

I have a problem with the use of the component DBRichViewEdit. If I save some basic information when loading the values I have a format that is applied at the opening of the datasource

For example, this value cannot be loaded correctly, the text is center and blue
2 00 01 17 300 299
While it works very well
2 10 01 17 300 299

I've not found property in the component to work around the problem.

Thanks

Posted: Mon Jan 16, 2017 4:27 pm
by Sergey Tkachenko
Do you want to change font and paragraph properties of the whole document on loading

Posted: Tue Jan 17, 2017 7:17 am
by retwas
I didn't want change anything, I just want to load 2 00 01 17 300 299 in my DBRichViewEdit. Data is correctly saved in database, but when I load it I can't see my number :cry:

Posted: Tue Jan 17, 2017 7:18 am
by retwas
When I load this number, my cursor is at the center of the DBRichViewEdit, and when I write the text is blue and bold

Posted: Tue Jan 17, 2017 8:24 am
by Sergey Tkachenko
Probably, documents are stored in the database in RVF format without styles. So, when loading, existing collections of text, paragraphs and list styles are used.

Right click DBRichViewEdit component at design time, choose "Settings" in the context menu. Set "Allow adding styles dynamically" (or "Allow adding styles dynamically + style templates" if you need real styles, like in MS Word).

Make sure that your DBRichViewEdit is connected with its own TRVStyle component (if you have multiple editors, connect each of them to its own TRBStyle component).

Resave your documents in database, assigning the proper font and paragraph properties.

Does it fix the problem?

Posted: Wed Jan 18, 2017 7:57 am
by retwas
Hi

No I have again the problem.

My DBRichViewEdit is connected at the TRVStyle.

I add the numer and save it to database with text(max) field.

When I load this value, I didn't see it, my cursor is at the center of the RichView and when I write the text is bold and blue.

Posted: Wed Jan 18, 2017 9:46 am
by Sergey Tkachenko
If this is a field for text, especially Unicode text, it cannot contain binary data like RVF, so document can be damaged.

Please save field content to a file and send to me.
You can do it using this code:

Code: Select all

var Stream: TMemoryStream; 
 FileStream: TFileStream; 

Stream := TMemoryStream.Create; 
(Table.FiedByName(FieldName) as TBlobField).SaveToStream(Stream); 
Stream.Position := 0; 
FileStream := TFileStream.Create(FileName, fmCreate); 
FileStream.CopyFrom(Stream, 0); 
FileStream.Free; 
Stream.Free;

Posted: Mon Jan 23, 2017 10:10 am
by retwas

Posted: Fri Jan 27, 2017 3:05 pm
by retwas
Did you know why ? Thanks :)

Posted: Sun Jan 29, 2017 12:28 pm
by Sergey Tkachenko
Sorry, this site does not work, at least I cannot open it.
Please send the file by email to richviewgmailcom

Re: Number code style

Posted: Mon Jan 30, 2017 9:14 am
by Sergey Tkachenko
The new forum allows attaching files.

Re: Number code style

Posted: Tue Jan 31, 2017 2:02 pm
by retwas
Ok I sent it by email because rvf are not authorized

Re: Number code style

Posted: Sun Feb 12, 2017 6:52 am
by Sergey Tkachenko
Summary of our conversation: the component mistakenly detected RVF format in this sequence of numbers. A fixed version is uploaded, RVF detection is more strict now.