Advertisements

Merging PDF Files in Navision

Many of time we have multiple files in pdf but for some certain reasons we require to merge them to single File.

Continuing from my previous post i am extending my functionality with Merging of Mulitiple pdf files to single pdf file.

PDFConvMerge-2-2

In my Setup Page created in previous post i have added one more field to store the Tool Path & File Name for Merging multiple files.

Based on the dll provided by http://www.pdfsharp.net this post is written.

Visit the Site download the utility and extract the dll file and exe file from the zip and store in same Folder.

The format of command to merge the files at command prompt is similar to:

Command to merge :- pdfmerge output=.\ActionFolder\result.pdf input=.\ActionFolder\1.pdf,.\ActionFolder\2.pdf,.\ActionFolder\3.pdf

We will prepare the Function which will take as parameter the Output & Input File and run the utility to Merge these files to single file using WsShell in Navision.

PDFConvMerge-4

Function is very simple to accept the Input & Output File Names and Prepare Single PDF file from multiple pdf files provided as input (comma seperated List of Files) to the function.

To keep it simple no additional codes for test and other routine job is not added. Now you are familiar with the functionality you can tweak the code accordingly to meet all other requirements.

Thats all for this post. Will comeup with more Information in my upcoming posts.

Till then keep exploring and learning.

 

 

Advertisements

Multiple namespace support in XML Ports – Microsoft Dynamics NAV 2016

Microsoft Dynamics NAV 2016 now enables developers to create XMLPorts which contain more than one namespace. Namespaces are used to distinguish fields and provide uniqueness.

The inclusion of namespaces enables parties to tag elements and resolve any ambiguity.

What is default Namespace?

This property specifies the default namespace for both import and export. The default value is unique for different XMLports.

For example, the following string specifies a namespace: urn:microsoft-dynamics-nav/xmlports/x100, where 100 is the ID of the XMLport.

What is Namespace?

You can use this property to declare one or more namespaces on the XMLport.

To add a namespace, you can choose the AssistEdit button or enter the namespaces directly in the field.

A namespace declaration consists of prefix and the namespace name, which has the format prefix=namespace. Separate multiple namespaces with a comma.

In the XML documents exported or imported by the XMLport, the namespaces declarations are only supported in the <root> element.

For example, if an XMLport has the namespace mynavprefix=mynavnamepace and the default namespace urn:nav:schema:all, then the root element will be as follows:

<Root xmlns:mynavprefix=”mynavnamespace” xmlns=”urn:nav:schema:all”>

To specify a default namespace, leave the Prefix field blank.

You can also specify the default namespace by specifying the namespace in the DefaultNamespace Property and setting the UseDefaultNamespace Property to Yes.

However, there can only be one default namespace. So if you want to specify a default namespace in the Namespace property, you must set the UseDefaultNamespace Property to No.

How to Define Namespace:
Namespace-1

Using Namespace:
Namespace-2

The final XMLport will be as below:
Namespace-3

Now save your XMLport and execute it.
Namespace-4

The output will be similar to below:
Namespace-5

Conclusion:

  • Multiple namespaces are defined in the root element of the XMLport and have their own property editor for defining them.
  • Developers can easily select the namespace via lookups on the element record.
  • XMLports are accessible both for developers and super users. Including the namespace prefix in the core editor lets you see key data while developing.

I will come up with more information in my upcoming posts.

Important

Most of the contents you find in this blog will be either inherited from MSDN or Navision Developer IT Pro Help. Some places images are also directly taken from these sites. Purpose is simple to try those stuffs and re-produce adding few things as per my understanding to make easy understanding for others and quick reference.

Here nothing under my own brand or authorship of the content. At any point of time we are just promoting Microsoft stuffs nothing personnel with same.

Hope stuffs used here will not violate any copyright agreement with them. In case by mistake or in-intestinally it happens and the Microsoft feels these should not be used Microsoft have full right to inform me about same and will be glad to take down any such content which may be violating the norms.

Purpose is to promote Navision and share with community.

FB Profile

Like FB Page

%d bloggers like this: