Number code style

General TRichView support forum. Please post your questions here
Post Reply
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Number code style

Post 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
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you want to change font and paragraph properties of the whole document on loading
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Post 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:
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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?
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Post by retwas »

retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Post by retwas »

Did you know why ? Thanks :)
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, this site does not work, at least I cannot open it.
Please send the file by email to richviewgmailcom
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Number code style

Post by Sergey Tkachenko »

The new forum allows attaching files.
retwas
Posts: 39
Joined: Tue May 21, 2013 1:41 pm

Re: Number code style

Post by retwas »

Ok I sent it by email because rvf are not authorized
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Number code style

Post 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.
Post Reply