NAV 2015: Fill Excel template from NAV

Pachi
Pachi 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.

Comments

  • Slawek_Guzek
    Slawek_Guzek Member Posts: 1,692
    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 - www.yitron.co.uk
    Business Central, MS SQL Server, Wherescape RED;