NAV 2015: Fill Excel template from NAV

PachiPachi Member Posts: 25
Good afternoon,

I'm trying to design a report to create sales invoices by filling an Excel template provided by the customer.

Does someone know how to manage this filling without affecting Excel formats (fonts, colours, cell sizes,...)?

Thank you.


  • Options
    Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    edited 2018-01-30
    Not possible without heavy customization I'm afraid.

    The .NET component provided by MS completely disregards content/formatting of the written cell, and writes default values. A modification is required which would read the cell and formatting before writing the cell, and use the same attributes in a call to write operation.

    But even this is very limited as the wrapper MS provided with NAV hides a lot of properties, so they cannot be read.

    You may need to restore to some 3rd party components, like ClosedXML, which wraps many tedious OpenXML calls into nice functions. Still, a considerable amount of work is required to make it working and foolproof.

    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.