Hello all,
- How does one update a Microsoft Word Attachment for a given Format mapping? I -think- this works in a way you wouldn't expect... read on.
Here's my setup:
I've derived a Free Text Invoice from the RCS Free Text Invoice Model offerings from Microsoft:
In the highlighted line you can see my derived copy of the Free text invoice (Word), my derivation is called (WWI Invoice Model) WWI Free text invoice (Word).
When I look at (WWI Invoice Model) WWI Free text invoice (Word) in the Format Designer I can see the file attachment for the report as shown below:
Note the Template is WWI Free text invoice (Word)_FTIModTemplate with File name FTIModTemplate.docx.
I've accessed the attachment and added a field that I had in my derived data model and it's associated data model mapping.
I've attached a new version in the attachment list accessed from the Attachments link near the upper right of the image above. This screen now looks like this:
In the image we can see the original attachment that came with the derivation of the MS Word format in the row that is not selected.
Note in the row that is selected and the details shown, the new file name is WWI_FTIModTemplate.docx.
How do I get the updated file to be used??
The only MS doc I can find is this page:
That says /You must then replace the original Word template of the editable ER
format with the modified template that now contains Word content
controls that were mapped to the fields of the Report custom XML part./
But that page doesn't tell you how to actually go about updating the template?!?!
If I delete the ERfile entry shown in the last image above, then there's NO template attached at the Format designer page for the root report element:
So.. this is what I tried and this seems to work:
- Download the ERfile entry in the attachents list.
- Edit that file as you need.
- Delete the ERfile entry in the attachments list.
- Make a new ERfile entry in the attachemnts list and upload the file you edited.. But -don't change the file name!
- Finally go back to format screen and select the top report element, then on the right under the attachment details reselect the template like so:
Next challenge: What happens when I add a new data model element and propagate that through to the format? to be continued...
Update: Here's how I've been updating the MS Word template. I'm not sure if this is the best way, but it seems to be working.
Use case: You have added a new data model node and you have added this to the format mapping and you need to edit the MS Word template to place the new field in the document.
Method:
. Access your format from your Reporting Configurations in Electronic Reporting.
. Select the top level 'Report' node in th eformat designer.
. Select the Format tab in the right half of the window
. Select the (paperclip) attachments button.
. This takes you to a screen like this:
. Select the entry in the column on the left.
. Action menu at top: (arrow)Open
. Browser file save dialogue box
. When you open your file, select the MS Word Developer menu (after activating it, see a DuckDuckGo search for details), in the XML Mapping Pane function you will find your new fields. Hooray!
Use case: Template update after making edits:
Method:
. Access your format from your Reporting Configurations in Electronic Reporting.
. Select the top level 'Report' node in th eformat designer.
. Select the Format tab in the right half of the window
. Select the (paperclip) attachments button.
. This takes you to a screen like this:
. Select the entry in the column on the left.
. Action menu at top: Delete. Yes to prompt.
. Action menu at top: +New, dropdown. Select ERFile (In my case it started out that way so I selected the same. I tried just 'file' and that failed for me.)
. Right side bar tap opens 'Upload document'
. Browse button, press.
. Navigate to storage of template. Select file.
. Save and return to previous screen.
. On the right under format, select the template drop down, there should be the name of the entry that was there before, select it again:
. Save