Creating a table in RichView

General TRichView support forum. Please post your questions here
Post Reply
shapoval
Posts: 9
Joined: Tue Mar 01, 2011 5:41 pm

Creating a table in RichView

Post 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?
shapoval
Posts: 9
Joined: Tue Mar 01, 2011 5:41 pm

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

Post by Sergey Tkachenko »

Please post a code showing how you insert a table, or send a (simple) sample project to richviewgmailcom.
shapoval
Posts: 9
Joined: Tue Mar 01, 2011 5:41 pm

Post 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.
shapoval
Posts: 9
Joined: Tue Mar 01, 2011 5:41 pm

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