Author Topic: Write table to a RTF file using DocumentGenerator  (Read 4986 times)

ja1234

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Write table to a RTF file using DocumentGenerator
« on: April 14, 2016, 12:53:30 am »
Hi all,

I have successfully created an RTF file using DocumentGenerator and easily inserting text with the InsertText method.

How can I add a table (with say 3 columns and 5 rows)?

Any input is appreciated.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13274
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Write table to a RTF file using DocumentGenerator
« Reply #1 on: April 14, 2016, 01:26:36 am »
I'm afraid you'll have to somehow generate the RTF code for tables.

But are you really sure you should be using the DocumentGenerator API? That is like the last resort if all else fails.
I've done some pretty complicated docgen stuff without ever needing that API.

Geert

ja1234

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Write table to a RTF file using DocumentGenerator
« Reply #2 on: April 14, 2016, 01:44:02 am »
Thank you for the reply.  I noticed there is some RTF markup that I could use, but how to actually insert it using DocumentGenerator I have not figured it out , as DocumentGenerator just considers it as text using InsertText ...

What would you suggest instead of DocumentGenerator?

Thanks.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13274
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Write table to a RTF file using DocumentGenerator
« Reply #3 on: April 14, 2016, 02:12:04 am »
Just use the regular RTF templates.

I have posted an article on my website that might help as an example.

Usually there is no need at all to use the DocumentGenerator API.

Geert