#includeSection for .docx and images

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

#includeSection for .docx and images

Postby thomas.b.davis@lmco.com » Thu Jan 17, 2019 7:06 pm

Hi there, we've been playing around with utilising multiple separate .docx files to then build up a final document from a number of separate .docx files. We looked at using the #includeSection() directive to do this, but found that the images in the document weren't inserted into the generated document (i.e. they just had spaces for the image with the red x). Just keen to understand whether this is an error or intended functionality?

As part of the generation, we want to be able to determine which separate .docx files to include, and dynamically call the #includeSection(). We found the $import.include() functions but noted that these don't work for .docx files. It appears that in MagicDraw 19.0 the $import.include() does work for .docx files (we are running with 18.5 but will transition soon). My question is, if i use the $import.includeSection() directive in MagicDraw 19.0, and the section I include contains images, will these be correctly output into the document (for .docx files)?
thomas.b.davis@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 21
Posts Rating:1
Joined: Wed Jan 10, 2018 8:05 pm

Re: #includeSection for .docx and images

Postby sarawut_w » Thu Jan 17, 2019 9:50 pm

Hello,

#includeSection() directive to do this, but found that the images in the document weren't inserted into the generated document.

You are supposed to get the images in your report.
We tested this, the images are printed out through #includeSection() directive.
Could you please provide us the sample templates that could be used to reproduce this issue?


My question is, if i use the $import.includeSection() directive in MagicDraw 19.0, and the section I include contains images, will these be correctly output into the document (for .docx files)?

Yes, you are right!
We have provided the $import.includeSection(includedTemplate,sectionName) function since MagicDraw 19.0.
If you could not get the image returned from this function, please share us your sample templates that could be used to reproduce this issue.
By the way, please see the working templates that could get the correct result.
sample.png


Best regards,
Sarawut W.
Support Engineer
You do not have the required permissions to view the files attached to this post.
sarawut_w
No Magic
No Magic
 
Posts: 313
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: #includeSection for .docx and images

Postby thomas.b.davis@lmco.com » Thu Jan 17, 2019 10:55 pm

Hi Sarawut,

Please see the attached template files as the example I used.

main_page.docx is the main template. included_doc.docx is the document with the section to be included (it contains an image). output.docx is the output produced from running the reportwizard in MagicDraw 18.5 SP1.

Regards,

Tom
You do not have the required permissions to view the files attached to this post.
thomas.b.davis@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 21
Posts Rating:1
Joined: Wed Jan 10, 2018 8:05 pm

Re: #includeSection for .docx and images

Postby sarawut_w » Fri Jan 18, 2019 2:36 am

Hello Tom,

We are sorry for misleading you.
In MagicDraw 18.5 SP1, #includeSection directive could not get image from included template.
We have supported this, since MagicDraw 19.0 version.

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 313
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: #includeSection for .docx and images

Postby thomas.b.davis@lmco.com » Sat Jan 19, 2019 6:43 pm

Hi Sarawut,

No worries at all, we are looking to move to MagicDraw 19.0 soon so it sounds like that will fix a number of our issues.

Kind Regards,

Tom
thomas.b.davis@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 21
Posts Rating:1
Joined: Wed Jan 10, 2018 8:05 pm


Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests