Hello
I am using your demo ActionTest tabs as a editor. I store the documents in a database. I have noticed a problem since I have updated my components to XE 5 and to the latest versión of RichView. The problema is the following. I have a blank document, I write something, or include a table, perfect. Then I save the document in the database. When I load the stored document, the layout is the same, but if you try to indent a paragraph, then the text is move to the right a lot of positions. If I try to insert a table then this table have 1500 pt as cell padding and cell spacing. So I think that when I upload the document something is missing or wrong and measurements are not the same anymore.
This is the code I use to save and load documents :
1) Saving
SRichViewEdit1.RichViewEdit.Modified := False;
FDataStream.Clear;
FDataStream.Position := 0;
if FSaveRVF_RTF = 0 then
SRichViewEdit1.RichViewEdit.SaveRVFToStream( FDataStream,False )
else
if FSaveRVF_RTF = 1 then
SRichViewEdit1.RichViewEdit.SaveRTFToStream( FDataStream,False );
2) Loading
WasSaved := False;
FDataStream.Position := 0;
SRichViewEdit1.RichViewEdit.LoadFromStream(FDataStream,rvynaAuto);
FDataStream.clear;
SRichViewEdit1.RVHeader.Format;
SRichViewEdit1.RVFooter.Format;
SRichViewEdit1.SetRVMargins(True);
SRichViewEdit1.Format;
Can you help me ?
Regards
Jesus Mendez
Issue with ActionTest Tabs wiht LoadFromStream
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hi Sergey
I do not know how to do it. I store the documents in SQL Anywhere. What I can send you is the two units I use, that are in fact your demo of Action Test Tab and then you can call the unit passing the stream.
First time when you open the editor is always fine. Once you close the Editor (even without saving nothing) then if you try ton indent a paragraph or insert a table then happens weird things.
Please take a look you mail, I will send you this two files.
Regards
I do not know how to do it. I store the documents in SQL Anywhere. What I can send you is the two units I use, that are in fact your demo of Action Test Tab and then you can call the unit passing the stream.
First time when you open the editor is always fine. Once you close the Editor (even without saving nothing) then if you try ton indent a paragraph or insert a table then happens weird things.
Please take a look you mail, I will send you this two files.
Regards
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hi Sergey
In fact this is the problem. But I only call to this procedure once in Editform in formcreate event.
How is that possible if I create the editform and after that I destroy it, that this affects twice.
RVA_ConvertToTwips(srvActionsResource); >>>>>> this one
RVAControlPanel1.UnitsProgram := rvstuTwips;
SRichViewEdit1.ConvertToTwips;
cmbUnits.ItemIndex := ord(SRichViewEdit1.UnitsProgram);
RVAControlPanel1.UnitsDisplay := SRichViewEdit1.UnitsProgram;
Regards
In fact this is the problem. But I only call to this procedure once in Editform in formcreate event.
How is that possible if I create the editform and after that I destroy it, that this affects twice.
RVA_ConvertToTwips(srvActionsResource); >>>>>> this one
RVAControlPanel1.UnitsProgram := rvstuTwips;
SRichViewEdit1.ConvertToTwips;
cmbUnits.ItemIndex := ord(SRichViewEdit1.UnitsProgram);
RVAControlPanel1.UnitsDisplay := SRichViewEdit1.UnitsProgram;
Regards
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
It happens because the actions not on the form, but on a datamodule.
I suggest to move RVAControlPanel1 from this form to this datamodule, and move this code to FormCreate of this datamodule:
I suggest to move RVAControlPanel1 from this form to this datamodule, and move this code to FormCreate of this datamodule:
Code: Select all
RVA_ConvertToTwips(Self);
RVAControlPanel1.UnitsProgram := rvstuTwips;