Book a Demo

Author Topic: Embedding External Files in RTF Output??  (Read 11193 times)

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Embedding External Files in RTF Output??
« on: July 17, 2009, 09:27:10 pm »
Hey,

sorry for flooding the forum with questions ;) But I'm really having a hard time with RTF output...

OK, my problem is that I need to embed external documentes (e.g. Other RTF files or Images like BMPs) into the RTF output file.

Is this possible? I tried element file links but I only managed to insert the link address to the RTF, not its contents.

This is important because sometimes we need to include tables or other graphics within customer realted documents. These object will be maintained in other tools. To avoid inconsistency, it is necessary to include these object by link to the model and to be able to output them.

Thanks,

Jan

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Embedding External Files in RTF Output??
« Reply #1 on: July 17, 2009, 10:13:44 pm »
Quote
Is this possible? I tried element file links but I only managed to insert the link address to the RTF, not its contents.

Two solutions:

a) Add a linked document to an object, copy the content of the customer document in it and add a "ModelDocument" section to the template.
Not exactly what you want but at leas a solution.

b) Insert an INCLUDETEXT field from MS Word into your template which is filled with the document path from eg. a tagged value of an element in your model. A bit tricky but it might work. This will order Word to include the document referenced into your document so it is more a feature of Word, not EA.

For both solutions be aware that including large documents into your specification might spoil your layout a lot.

HTH

Oliver

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Re: Embedding External Files in RTF Output??
« Reply #2 on: July 17, 2009, 10:25:11 pm »
Hey Oliver,

thanks for your reply. The second idea seems to be interesting. But the question is, if this can be included in the model rather that the template. Using the template makes it impossible to specify an element to wich the embedded object should be attached. If I would include this field (of wich i'm not sure if word will recocgnize it after copying from word into RTF and then back to word), it would be either on the first page, on the last or in each element/package description.

So, it would be nice, if it would be possible to attach this field as a linked document, include this within the template, and open it in word....

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Re: Embedding External Files in RTF Output??
« Reply #3 on: July 17, 2009, 10:39:46 pm »
Hi, I found a solution by myself, at least for the images.

I works like this:
- Right click on an element in the model
- Click on "Linked Document..."
- Now, in the RTF editor, simply right click, choose Insert->"Link Picture"
- Choose the file (only bitmap)
- Save and close
- Insert a Element/Linked Document section in your rtf template (its not called "document model")
- Genearte the RTF

Now your can change the original image and regenerate the RTF, and you will see that the image has changed.

Unfortunately,your can't link rtf files. This is really weired... You have the option of a linked document but in fact it's not linked but included in the model, isnt' it?

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Embedding External Files in RTF Output??
« Reply #4 on: July 18, 2009, 12:04:32 am »
Quote
Hey Oliver,

thanks for your reply. The second idea seems to be interesting. But the question is, if this can be included in the model rather that the template. Using the template makes it impossible to specify an element to wich the embedded object should be attached.

Of course you can. Just include the INCLUDETEXT field in the template and let it be filled by a tagged value. Elements from your model can then have that tagged value differently each to reference a different document.
So you have a different document per model element.

Oliver

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Re: Embedding External Files in RTF Output??
« Reply #5 on: July 18, 2009, 01:28:57 am »
Yeah, that's a good idea.
But I tried, and I didn't get the field to work. I tried to copy the field from Word, but it only copies the text displayed, not the field itself. Then I tried to use "Insert Field" from the Template Editor, but it also failed. In the help it says:

Insert your own data fieldsNot Supported In The Enterprise Architect RTF Generator.

Do you think it really works to use field from word in RTF and then back to word?

Cheers,

Jan

Oliver F.

  • EA User
  • **
  • Posts: 573
  • Karma: +2/-1
  • Aren´t we all in the model business ?
    • View Profile
    • Karl Storz homepage
Re: Embedding External Files in RTF Output??
« Reply #6 on: July 18, 2009, 01:45:53 am »
Quote
Yeah, that's a good idea.
But I tried, and I didn't get the field to work. I tried to copy the field from Word, but it only copies the text displayed, not the field itself. Then I tried to use "Insert Field" from the Template Editor, but it also failed. In the help it says:

Insert your own data fieldsNot Supported In The Enterprise Architect RTF Generator.

Do you think it really works to use field from word in RTF and then back to word?
 


Well, at least in a quick try I was able to create a data field which was correctly displayed by MS Word as a data field.
The more interesting question seems to be to fill the data field with the tagged values...

Oliver

Update: I stand corrected. I can include a field but it is only shown as a field, not filled with the correct data. And it was such a brilliant thought 8-)

What happens with your fields if you import the template into the RTF editor (File->Import) instead of creating it in EA?
« Last Edit: July 18, 2009, 01:55:32 am by ofels »

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Embedding External Files in RTF Output??
« Reply #7 on: July 20, 2009, 02:56:31 pm »
One other option you might want to try is OLE embedding of data in a Linked Document.  This can be done by dragging a file onto the edited RTF document or Use: Insert | OLE Object.

ebeb

  • EA User
  • **
  • Posts: 169
  • Karma: +0/-0
    • View Profile
Re: Embedding External Files in RTF Output??
« Reply #8 on: July 20, 2009, 06:30:47 pm »
@Oliver:

Yes, I also managed to insert an INCLUDETEXT field in word with an external file. Then I imported the RTF with this field in EA and the File I included was shown in EA. But as you said, its not possible to edit the field. What is needed IMO, is a field-in-a-field using the INSERTTEXT as a container for the EA tag that will be filled with the correct file name. But I either don't know how to do that.

@Dermot: I know the embedded option, but its EMBEDDED.

I successfully managed to used OLE embedding to include an external document, using the following steps:
- Create a file to include.
- Create a linked document in EA
- Insert an OLE object, choose Word...
- Word opens, include a new INCLUDETEXT field including the previously created file
- Save and close Word.
- Now save the linked document
- Create the RTF (the Linked Document section must be active in the template)

BUT: It's won't be updated dynamically. I changed the included document, and regenerated the documentation, but nothing happens. I needed to open the linked document, open the embedded Word-File, press F9 to update the filed, save and return to EA.

That not very comfortable and it is even easier to just import the document in the linked doc everytime it changes.

So, IMO no advantage in using embedded object.

Anyway, I'm still wondering about the RTF Editor. Everything in EA has a nice look and feel, except this buggy RTF Editor which still  looks like Win 3.1. I'd rather use something real predictable, e.g. XML for the tables, referring to RTF styles. The RTF editor is really unpredictable. Sometimes I open It and some section and field have strage non-alphanumeric characters at the end, sometimes it still work but sometimes the fields won't work.  :-?
I don't know, but Sparx should come up with some new Idea for the whole RTF stuff.