Calling macroses in DOCX header?

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Calling macroses in DOCX header?

Postby henrikas@rubedo.lt » Tue Dec 06, 2016 5:33 am

Is it possible to call macro functions from DOCX header/footer when generating a report? It is possible when generating RTF files, but for DOCX it simply shows macro calls, e.g.:

in report template body:

Code: Select all
#macro(Foo)
#set($bar = “OK”)
#end


in report template header calling a defined function:

Code: Select all
#Foo() $bar



Result:
DOCX shows
Code: Select all
#Foo() NA

RTF shows
Code: Select all
OK


If not possible, are there any workarounds?
MD version 18.3
henrikas@rubedo.lt
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Thu Jun 19, 2014 5:44 am
Full name: Henrikas

Re: Calling macroses in DOCX header?

Postby sarawut_w » Tue Dec 06, 2016 11:36 pm

Hello,

We are investigating whether this is a bug or not.
Please keep waiting for us, we are finding a best workaround for you.

Best regards,
Sarawut W.
Support Engineer
sarawut_w
No Magic
No Magic
 
Posts: 493
Posts Rating:45
Joined: Thu Jun 23, 2011 12:47 am

Re: Calling macroses in DOCX header?

Postby fmejia5@ford.com » Thu Aug 19, 2021 7:46 am

Was this ever solved?
fmejia5@ford.com
Forum Newbie
Forum Newbie
 
Posts: 21
Posts Rating:1
Joined: Tue Apr 28, 2020 2:34 pm

Re: Calling macroses in DOCX header?

Postby sarawut_w » Thu Aug 19, 2021 9:16 pm

Hello,

Yes, this is already fixed in MD 19.0 version.

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

Re: Calling macroses in DOCX header?

Postby melpers@strattechnologies.com » Tue Sep 14, 2021 11:52 am

How about calling $image from within a word header?
It seems to execute the code - but in the word document where the image should be there is the error: Image Cannot Be Displayed.
....perhaps this should be a different thread? I included it here since it was .doc header-related.
melpers@strattechnologies.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Fri Apr 23, 2021 7:12 am

Re: Calling macroses in DOCX header?

Postby sarawut_w » Wed Sep 15, 2021 6:23 pm

Hello,

Magic Report have not support DOC template anymore.
So, new bug fixes and functions would go on DOCX template only.

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

Re: Calling macroses in DOCX header?

Postby melpers@strattechnologies.com » Thu Sep 16, 2021 7:06 am

Thanks for the quick reply Sarawut,
I've attached a very simple model mdzip file, a simple template file (in DOCX) and the output file resulting from running the template on the model.
You can see in the template that the same code is present in the regular text part of the first page AND in the header of that page.
The code in the main text part of the page correctly displays the image.
The code in the header of that page results in the error: Cannot Display Image
Not sure if this is a bug but it doesn't do what I thought it would.
It seems to execute the code correctly (as I have experimented with other VTL commands in the template that work) - just something wrong with the $image in the way it displays.
You do not have the required permissions to view the files attached to this post.
melpers@strattechnologies.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Fri Apr 23, 2021 7:12 am

Re: Calling macroses in DOCX header?

Postby sarawut_w » Fri Sep 17, 2021 1:16 am

Hello,

For now, we have not support for printing image in header/footer part.
By the way, we have registered this request in our implementation pipeline.
It would be implemented in future release.

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

Re: Calling macroses in DOCX header?

Postby melpers@strattechnologies.com » Fri Sep 17, 2021 5:20 am

Thanks for the quick response again Sarawut - and for submitting this as an enhancement request.
melpers@strattechnologies.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Fri Apr 23, 2021 7:12 am


Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests

cron