Page 1 of 1

Creating a table in RichView

Posted: Tue May 03, 2011 1:33 pm
by shapoval
Hi Sergey,

I'm trying to build a document, containing some tables, using TRichView component. I create TRichView and TRVStyle instances and fill them in programmatically. Everything works fine until I add a table to a document. Adding a table results in an invalid document, which can't be read by the ActionTest application.

I'm using your code from the "Editor 1" example to create a table. The only thing I can imagine is that I need to call Format after creating a table and before saving the document, but trying to call it results in Abstract Error in the RV_InfoAboutSaD function.

Could you give any advice please?

Posted: Tue May 03, 2011 2:07 pm
by shapoval
Some new findings. I also import smaller RVF documents as parts of my big document using InsertRVFFromStream. It also works fine if there is no table in the inserted document. If there is a table, it results in the same error as above.

Posted: Wed May 04, 2011 6:33 am
by Sergey Tkachenko
Please post a code showing how you insert a table, or send a (simple) sample project to richviewgmailcom.

Posted: Wed May 04, 2011 6:44 am
by shapoval
Hi Sergey,

Thanks for the quick answer.

It seems to me that the problem is because of the fact that there is no visible controls. The table insert code works, I've tested it on "visualized" RichViewEdit. But what I do is I create TRichView and TRVStyle in a unit, which doesn't represent a form, and populate it with data programmatically.

Actually I've found that it doesn't create a valid RVF document even is there is no table. But my target is converting it to RTF and it works until I add a table.

I believe it's something related to absence of a parent control, but creating a non-visible form and making it a parent didn't help.

I'll send you a small sample by e-mail.

Posted: Wed May 04, 2011 11:32 am
by shapoval
I've fixed the problem. Instead of using TRichView in non-visual unit I now use TRVReportHelper, as you advice here and it works fine.