Microsoft Dynamics 365 Blog

This article describes the following procedures:
• How to add a non-predefined report in Microsoft Dynamics NAV

• How to make the report available in Employee Portal in Microsoft Dynamics NAV

This article describes these procedures on a computer that is running Microsoft Windows SharePoint Services.


Typically, only some tables are configured for the demonstration site in Employee Portal. These tables include the following tables:
• Customer

• Item

• Sales Header

• Vendor

The following reports are available to be added to Employee Portal:
• Sales Quote (204)

• Order Confirmation (205)

• Quantity Explosion of BOM (99000753)

• Rolled-up Cost Shares (99000754)

• Detailed Calculation (99000756)

Note: This article uses the Service Item table (5940) to show you how to add the “Service Item – Resource Usage” report (5939) to Employee Portal.


How to add a non-predefined report:

To add the “Service Item – Resource Usage” report (5939) to Employee Portal by using the Service Item table (5940), follow these steps:

1. Add a report that is not related to the predefined tables. To do this, follow these steps:
a. On the Tools menu, click Object Designer. 

b. In Object Designer, click Codeunit, select codeunit 6828, and then click Design.  

c. On the View menu, click C/AL Globals, and then add the new ServiceTableBased function.

d. Add the following new global variable:
• Name: Service Item

• Data Type: Record

• Subtype: Service Item

e. Add the following line of code to the ServiceTableBased function.

“Service Item”.SETVIEW(PrintRecordRef.GETVIEW);

ReturnValue := REPORT.SAVEASXML(ReportID,TempPath,TRUE,”Service Item”);


f. Add the following line of code to the CreateReportPreview function.

REPORT::”Service Item – Resource Usage”:

ReturnValue := ServiceTableBased(ReportID,TmpFileName,PrintRecordRef);


g. Click Save, and then click Compile.

How to make the report available in Employee Portal:

1. Add the Show Report action to the Action list of the Web part. To do this, follow these steps:
a. Click Administration, expand Application Setup, expand Employee Portal, and then click Groups.

b. Select an existing “Web part request” card, and then click Card.

c. Click Table, and then click Card. Or, press SHIFT+F5. 

d. Select the required table, and then click Actions.

e. In the EP WP Table Card dialog box, specify the following information:
• Type: Show Report

• Target WP Request: Current


• Target Table No.: 5940

• Report ID: 5939

• In the Caption field, type a new caption for the “Service Item – Resource Usage” report.


2. Add the Web part to Windows SharePoint Services. To do this, follow these steps:
a. Open Employee Portal in a Web browser. 

b. In the Add Web Parts list, drag a Web part to the location that you want in the window.

c. In the Modify My Web Part box, select the group that contains the Web part.

d. In the Web Part Request list, select the Web part for which you added the actions in step 1 earlier in this section.


Mohamad Vajid (mvajid)

Microsoft Dynamics ME

Microsoft Customer Service and Support (CSS) EMEA


We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!