HAPPY NEW YEAR !!
In todays blog we will be discussing about Creating Word Layout in Business Central MSDYN365BC
If you want to Create RDLC Layout then ref to my previous blog
So lets begin with Creating a AL File For the Word Layout
AL file for WORD LAYOUR in MSDYN365BC
As shown below New report is being create with DefaultLayout As WORD for Item Table
I have added few fields for demo purpose, you can add fields according to your need.
After creating the AL File, build the extension (Ctrl+Shift+B) to generate the MyWordReport.docx file.
Create PAGE Extension in MSDYN365BC
I have creeated page extension of Item List page and added the report to Run on Open Page event, so when you go on Item List this report will run.
You can specify you report to run on Action as well.
Open the Word report layout document in Word.
Once the MyWordReport.docx file has been open in Word layout enable the Developer TAB
If you do not see the Developer tab, go to Options, then Customize Ribbon, and in the Main tabs section, select the Developer check box as shown below.
On the Developer tab, choose XML Mapping Pane, in the Custom XML Part dropdown list, choose the custom XML part for ADD INCLUDE report, . The name of the custom XML part has the following format
Add data field in Word Layout in MSDYN365BC
- Add Table with 4 column and 2 rows
- Right-click on the Item table, and in Insert Content Control, select Repeating to add the repeater data item in the 2nd row
- Right-click on the field and in Insert Content Control, select Plain Text to add the column as a text box.
Save the report layout when you are done and then close it.
Back in Visual Studio Code, press Ctrl+F5 to compile and run the report.
Now open the Client and run Item List, and Report will be Run while opening the List and You can preview it as shown below.
Download Link for different version of NAV and Business Central