Saturday 30 August 2014

Template-based Excel Reports functionality in NAV 2013 R2 RU

Basic objects of Excel Reports functionality in RU localization of NAV 2013 R2:


Type
ID
Name
Description
Table
14919
Excel Template
Table containing templates. Fields: Code, Description, File Name, BLOB, File Extension
Table
14930
Excel Template Sheet
Table containing Excel template sheets. Fields: Template Code, Name, Paper Height
Table
14931
Excel Template Section
Sheet sections. Fields: Template Code, Sheet Name, Name, Height
Table
14932
Excel Template Sheet Buffer

Codeunit
14930
Excel Report Builder Manager
Codeunit, which creates output Excel printing form based on specific template using DotNet component Microsoft.Dynamics.NAV.RU. ExcelReportBuilder.ReportBuilder
Page
14919
Excel Templates
Main templates managing page

Interaction of objects:

Page for working with templates:

Example of functionality - 12411 Order Factura-Invoice (A)

Objects (except basic stated above):
Type
ID
Name
Description
Report
12411
Order Factura-Invoice (A)
Invoice Report
Codeunit
14931
Factura-Invoice Report Helper
Codeunit, which contains the functionality of the report building (General functionality for several near-functional reports)

When you import a template related data tables Excel Template Sheet, Excel Template Section are populated automatically. On the basis of the data in these tables in the CU Factura-Invoice Report Helper adds sections through the ExcelReportBuilderMgr. AddSection and populating the data section by function ExcelReportBuilderMgr. AddDataToSection. Functionality of building reports examines height of sections and automatically adds new pages when it’s needed.
For Example:
All the sections must be named:
Dynamic lines of document are populated in the same way:

You can find further information in MS Dynamics NAV documentation or by examining functionality in RU demo database. I’ll be happy to answer any questions regarding this functionality. Don’t hesitate to ask!