XslCompiledTransform Class - usage of stylesheets Nav2013R2

jensthomsenjensthomsen Member Posts: 173
edited 2014-04-28 in NAV Three Tier
Hi

I was wondering if anybody has used the DotNet interopt to format a XML with a XLS/CSS and shown in an Internet Explorer? In Nav2013R2 the DotNet interopt is this:

System.Xml.Xsl.XslCompiledTransform.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

MSDN gives this help:
http://msdn.microsoft.com/en-us/library ... sform.aspx

I want to use it to show the danish version of an OIOUBL (XML) invoice/creditmemo in a stylesheet in internet explorer - or even better: Save it to a PDF!

Any examples would be welcome \:D/

Comments

  • jw65jw65 Member Posts: 18
    Hi,
    I'm using this for the same kind a scenario. We use a different xml standard for invoices (Finvoice).
    It's pretty straight forward:

    XslCompiledTransform := XslCompiledTransform.XslCompiledTransform;
    XslCompiledTransform.Load(StylesheetLocation); //StylesheetLocation is text variable storing location of xsl file
    localTempFile := FileMgt.ClientTempFileName('html'); //create a temporary html file (FileMgt = codeunit 419)
    XslCompiledTransform.Transform(tmpXmlFile, localTempFile ); //tmpXmlFile is text variable where the xml file is located, the temp xml file is created earlier in a different routine
    HYPERLINK(localTempFile); //open the transformed html file in Internet Explorer
Sign In or Register to comment.