{"id":464,"date":"2010-07-12T02:39:24","date_gmt":"2010-07-12T09:39:24","guid":{"rendered":"http:\/\/45.63.48.66\/?p=464"},"modified":"2019-05-02T14:59:03","modified_gmt":"2019-05-02T21:59:03","slug":"rim-for-styleheets-in-dynamics-nav","status":"publish","type":"post","link":"https:\/\/gotcal.com\/index.php\/2010\/07\/rim-for-styleheets-in-dynamics-nav\/","title":{"rendered":"RIM for Styleheets in Dynamics NAV"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-475\" title=\"stylesheet\" src=\"http:\/\/45.63.48.66\/wp-content\/uploads\/2010\/07\/stylesheet-300x224.jpg\" alt=\"\" width=\"300\" height=\"224\" srcset=\"https:\/\/gotcal.com\/wp-content\/uploads\/2010\/07\/stylesheet-300x224.jpg 300w, https:\/\/gotcal.com\/wp-content\/uploads\/2010\/07\/stylesheet.jpg 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>Microsoft Office Integration from Dynamics NAV uses stylesheets to transfer data to Excel and Word. If you are on a v5 database or higher this is standard functionality. If you have upgraded your executables, you will notice the new buttons in the toolbar, but nothing happens when you click them. In order to get them working you need to import some new objects, and add a couple of new functions to codeunit 1. The objects are:<\/p>\n<ul>\n<li>Form 690: Manage Style Sheets<\/li>\n<li>Form 691: Send-to Programs<\/li>\n<li>Form 692: Import Style Sheet<\/li>\n<li>Form 693: Program Selections<\/li>\n<li>Form 694: Style Sheets<\/li>\n<li>Codeunit 403: Application Launch Management<\/li>\n<\/ul>\n<p>Most of this blog entry is really nothing hot of the press, but i found a nice little trick for getting the records inserted into the tables automatically.<\/p>\n<p><!--more-->The new functions in codeunit are:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nLaunchApp(DataXML : Automation &amp;quot;'Microsoft XML, v4.0'.DOMDocument40&amp;quot;;StylesheetID : GUID;ApplicationXML : Automation &amp;quot;'Microsoft XML, v\r\nEXIT(AppLaunchMgt.LaunchApp(DataXML,StylesheetID,ApplicationXML));\r\n\r\nSelectStyleSheet(ObjectType : Integer;ObjectID : Integer;VAR StyleSheetID : GUID) : Boolean\r\nEXIT(AppLaunchMgt.SelectStyleSheet(ObjectType,ObjectID,StyleSheetID));\r\n\r\nManageStyleSheets(ObjectType : Integer;ObjectID : Integer)\r\nStyleSheets.SetObject(ObjectType,ObjectID);\r\nStyleSheets.RUN;\r\n<\/pre>\n<p>These function needs to have these specifics ID&#8217;s in codeunit 1:<\/p>\n<ul>\n<li>LaunchApp, ID=116<\/li>\n<li>SelectStyleSheet, ID=117<\/li>\n<li>ManageStyleSheets, ID=118<\/li>\n<\/ul>\n<p>when you have the objects imported, and the functions created in codeunit 1 you are almost ready to rock and roll. You just need to setup the Send-To Program in table 2000000065 and import the Stylesheets via Tools, Manage Style Sheets.<strong> At least that is the way i used to do it until i found i could just run Codeunit 403 Application Launch Management, as it actually inserts all these records for you. Nice!<\/strong><\/p>\n<p>Now you are ready to go.<\/p>\n<p>Of course you might want to change the Cronus logo in the default stylesheets to be your own logo. There are multiple guides on how to this, but i have found this to be a very quick\/dirty way to do it:<\/p>\n<ol>\n<li>Open the stylesheet in eg. Notepad.exe, and search for &#8220;bindata&#8221;, you will see a big section of Base64 encoded text. That is the Cronus logo in bitmap format, encoded to Base64. Delete this.<\/li>\n<li>Go to http:\/\/www.motobit.com\/util\/base64-decoder-encoder.asp and input your own logo, choose output to Base64 text and copy\/paste this back into notepad, where you just deleted the Cronus logo.<\/li>\n<li>Thats it.<\/li>\n<\/ol>\n<p>The previous guide i used was from <a href=\"http:\/\/www.nextequalzero.com\/2008\/03\/using-send-to-functionality-in-a-non-v5-dynamics-nav-database\">http:\/\/www.nextequalzero.com\/2008\/03\/using-send-to-functionality-in-a-non-v5-dynamics-nav-database<\/a> but suggested inserting all the records by hand. And a guide to change logo: <a href=\"http:\/\/www.nextequalzero.com\/2008\/02\/xml-stylesheets-for-dynamics-nav-adding-your-logo\">http:\/\/www.nextequalzero.com\/2008\/02\/xml-stylesheets-for-dynamics-nav-adding-your-logo<\/a><\/p>\n<p>Also the official MS guide is here: <a href=\"https:\/\/mbs.microsoft.com\/downloads\/partner\/Nav\/50material\/TechWhitePapers\/XMLStyleSheetsTechWhitePaper.pdf\">https:\/\/mbs.microsoft.com\/downloads\/partner\/Nav\/50material\/TechWhitePapers\/XMLStyleSheetsTechWhitePaper.pdf<\/a><\/p>\n<p>There are also a lot of hints on this on the main user groups <a href=\"http:\/\/mibuso.com\">MIBUSO<\/a> and <a href=\"http:\/\/dynamicsuser.net\">Dynamicsuser<\/a>.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Microsoft Office Integration from Dynamics NAV uses stylesheets to transfer data to Excel and Word. If you are on a v5 database or higher this is standard functionality. If you have upgraded your executables, you will notice the new buttons in the toolbar, but nothing happens when you click them. In order to get them [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[37,77,27,22,40,35,25],"class_list":["post-464","post","type-post","status-publish","format-standard","hentry","category-navision","tag-application","tag-navision","tag-how-to","tag-object","tag-stylesheet","tag-system-table","tag-upgrade"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/comments?post=464"}],"version-history":[{"count":16,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/464\/revisions"}],"predecessor-version":[{"id":1047,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/posts\/464\/revisions\/1047"}],"wp:attachment":[{"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/media?parent=464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/categories?post=464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gotcal.com\/index.php\/wp-json\/wp\/v2\/tags?post=464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}