BizTalk Custom Pipeline to Convert Excel file to Xml file

This blog explains how to convert .xls to Xml file in BizTalk using Custom Pipeline.

Below pipeline component is generic one, which can be applied to any excel files for xml conversion.

Sample Input (Excel File):

SampleInput.png

Sample Output (Xml File):

SampleOutput.png

Please follow below steps.

  1. Take a class library project and keep the code mentioned in Download link below.

Download

2) Provide strong name key, build and deploy to GAC.

3) Take a BizTalk receive pipeline and add the pipeline component (ExcelToXmlFileConversion) to Toolbox

3.png

4) Drag and Drop the Pipeline component from toolbox to Decode stage of Receive pipeline.

4.png

5) Build BizTalk project and deploy.

6) In Admin Console, take one-way receive port and receive location.

7) In Receive pipeline, browse the pipeline “ExcelToXmlFile”

8) Provide the below information in pipeline properties.

8.png

//ConnectionString: Provide the same connection string as in the screenshot above

//DataNodeName: Root name of the repeating node

//NameSpace: BizTalk message namespace.

//SqlStatement: [Sheet1] is the sheet name in the excel sheet.

//TempDropFolderLocation: This is temporary path you need to provide to perform some internal operations by the pipeline code.

9) Take a send port and provide below properties.

9.1.png
9.2.png

10) Start the BizTalk application and restart host instances.

11) Drop an Excel file in Input location and you can see the Xml file in Output location

10 responses to “BizTalk Custom Pipeline to Convert Excel file to Xml file”

  1. I have a question, Is it possible to consume an excel sheet in Orchestration whose columns are unknown. If yes, What will be the message type of it and the schema for it. (this is in reference to scenario where I have the Excel to XML pipeline already in place)

    Like

    1. It’s not possible to consume excel sheet in orchestration because orchestration always expect xml file, you have to write custom pipeline component to convert excel into xml format.

      Like

  2. Pavan brundavanam Avatar
    Pavan brundavanam

    While using the customer pipeline in UAT and DEV i am getting connection string issue like “provider not registered in local machine error” for both adm and jet.
    Please advise me for The resolution of issue asap.
    Thanks in advance.

    Like

    1. Pavan brundavanam Avatar
      Pavan brundavanam

      *custom pipeline component.

      Like

  3. Could you please change the connection provider to “Provider=Microsoft.ACE.OLEDB.12.0;” in connection string. and update IIS App Pool setting as refer: https://www.mikesdotnetting.com/article/280/solved-the-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-mach
    Install install the Microsoft Access Database Engine 2010 Redistributable from https://www.microsoft.com/en-us/download/details.aspx?id=13255

    Like

  4. Pavan brundavanam Avatar
    Pavan brundavanam

    Hi team,
    I followed your process in Dec the components working fine. But in Q&A I am getting the same issue provider not found after fallowing the same process as you suggested. Please assist on this.

    Like

    1. Hi Pavan,
      we didn’t understand this line: process in Dec the components working fine. But in Q&A.
      Does it mean, it is working in development and not working in UAT or test server?
      if in that case you need to check the prerequisites software for MS Excel as suggested in above comments and does UAT or Test server have MS Excel on that server?

      Like

  5. Why ‘Bitmap’ has error could not be found namespace in my vs?

    Like

  6. Hello
    Can you please provide the mapping Screen short as well as some error facing so can you please provide it?

    Error : This service instance exists to help debug routing failures for instance “{DC865843-7D4D-4E7D-9083-8D65BAD83B18}”. The context of the message associated with this instance contains all the promoted properties at the time of the routing failure.

    Like

Leave a comment