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 » Mon Jan 16, 2017 4:00 pm

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: 14398
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Mon Jan 16, 2017 4:27 pm

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 » Tue Jan 17, 2017 7:17 am

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 » Tue Jan 17, 2017 7:18 am

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: 14398
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Tue Jan 17, 2017 8:24 am

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 » Wed Jan 18, 2017 7:57 am

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: 14398
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Wed Jan 18, 2017 9:46 am

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 » Mon Jan 23, 2017 10:10 am


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

Post by retwas » Fri Jan 27, 2017 3:05 pm

Did you know why ? Thanks :)

Sergey Tkachenko
Site Admin
Posts: 14398
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Sun Jan 29, 2017 12:28 pm

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: 14398
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Number code style

Post by Sergey Tkachenko » Mon Jan 30, 2017 9:14 am

The new forum allows attaching files.

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

Re: Number code style

Post by retwas » Tue Jan 31, 2017 2:02 pm

Ok I sent it by email because rvf are not authorized

Sergey Tkachenko
Site Admin
Posts: 14398
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Number code style

Post by Sergey Tkachenko » Sun Feb 12, 2017 6:52 am

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