Using project data in the report header

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Using project data in the report header

Postby tpen3219 » Sat Aug 31, 2013 1:17 pm

Instead of the data in the report I am using instancespecifications within the project to hold report and revision data. It is much easier to maintain than through the report data.
It is working fine except for the headers. I can access the values anywhere in the report except the header.
It appears as though the header data is established before the velocity script is executed.
Is there any way to make this work?

I have attached the project, the main template and two macro files.
HospiraDoc_DID_Template - Tom v5.docx is the template.
MM Architecture - Tom.mdzip is the project.
Thanks
You do not have the required permissions to view the files attached to this post.
tpen3219
Forum Beginner
Forum Beginner
 
Posts: 93
Posts Rating:3
Joined: Fri Nov 04, 2011 11:57 am

Re: Using project data in the report header

Postby thanapol_r » Tue Sep 03, 2013 7:09 pm

DOCX file format internally stores headers and content in different files, thus ReportEngine will process header files and content file separately. So, the variables that you set in the content part will not affect to the header parts. However, there are 2 solutions.

1. We would still recommend you to use report data because it has been designed to work with document headers

2. create a new template and add the code that you use to set the variable into the header of the first page before create header in other pages. The header which contains the code, which is used to declare variables and set the value, must be created before other headers because the order of the header files are depended on creation time. For example, if you create headers in the second page before the first page, the second-page header will be internally stored before the first-page header. This cause ReportEngine process the second-page header before the first page.


The attachment "HospiraDoc_DID_Template - Tom v5_fixed.docx" contains the fix using solution #2.

Best Regards,
Thanapol R.
No Magic Customer Support
You do not have the required permissions to view the files attached to this post.
thanapol_r
Customer Support
Customer Support
 
Posts: 19
Posts Rating:3
Joined: Wed Aug 14, 2013 5:42 am

Re: Using project data in the report header

Postby tpen3219 » Wed Sep 04, 2013 8:23 am

Thank you very much.
There are some problems with the change.
1) The heading styles disappeared from the generated document. So the table of contents no longer works.
2) I tried to insert line breaks above the text of the first page but then the headings no longer worked. The report specs require the cover page to be centered vertically. Is there a way to fix this?

Also, can you you tell exactly what you changed? I tried to modify the version I sent you to place the first block of code into the header. But I did not get the same result. The headers were still empty except for the icon - same as before.

Again, thank you for your help.
tpen3219
Forum Beginner
Forum Beginner
 
Posts: 93
Posts Rating:3
Joined: Fri Nov 04, 2011 11:57 am

Re: Using project data in the report header

Postby thanapol_r » Thu Sep 05, 2013 3:14 am

Sorry for breaking your heading styles.

We have improved the solution #2 by
1. Create a new DOCX file which contains the PrepareData section with the code for setting report variables.
prepareData.docx

2. Include PrepareData section in the header of the HospiraDoc_DID_Template.
header.png

HospiraDoc_DID_Template - Tom v5_fixed2.docx


We, then generate the report with Data element scope and the output is as follow
output.docx


Best Regards,
Thanapol R.
No Magic Customer Support
You do not have the required permissions to view the files attached to this post.
thanapol_r
Customer Support
Customer Support
 
Posts: 19
Posts Rating:3
Joined: Wed Aug 14, 2013 5:42 am

Re: Using project data in the report header

Postby paul.j.lotz@nasa.gov » Fri Oct 22, 2021 1:27 pm

I wanted to do something similar and this thread was very helpful!
paul.j.lotz@nasa.gov
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Fri Apr 30, 2021 7:25 pm

Re: Using project data in the report header

Postby nanebocy@gmail.com » Wed Dec 15, 2021 11:22 pm

Did you at whatever point track down a response for this? I'm in a generally hazy situation. At this point getting a basically obscure goof message.
nanebocy@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Wed Dec 15, 2021 11:17 pm


Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests

cron