Skip to Content

eMail Report as Attachment (Excel/Word)

h4. Introduction  This blog is an extension to my previous blog eMail  Reporting (eMail Reporting). This deals with the issue of sending out the XI payload in a  mail attachment of different formats. Here let us see how a payload is converted  to a Excel report or Word report in a mail attachment. h4. Approach   Let us use the same XSLT mapping which was used to generate a report form the  payload. But there is a small change we need to do in the mail pacakge to send  a Excel Report as an attachment. In case of eMail  Reporting (eMail Reporting)  the *Content_Typ*e was set to *text/html*,    but in this case we need to set the *Content_Type* as *application/*.   The following is the same XSLT mapping which was used in eMail  Reporting (eMail Reporting) with just a change in Content_Type   h4. mail.xsl    h4. Source XML   h4. Mail with Excel attachment image   h4. Attached Excel report image      Let us go ahead and do a small change again in the content type to receive    a Word report as attachment. We just need to change the *Contet_Type*    to *application/msword* and the mail will be received with a    word as attachment.       The following are the screenshots of the mail received h4. Mail with Word attachment image   h4. Attached Word report image
You must be Logged on to comment or reply to a post.
  • Hi,Prakash

    Thank you for excellent blogs, it’s very useful.
    I have a quetion about sender Mail adapter.
    Is it possible to use sender Mail adapter with Excel attachment, and convert the Excel
    sheet into xml format payload?
    Please answer my question.


    • Hi Michikuni,

      Yes it is possible but using adapter module.
      You can use PayloadSwapBean and then write your custom adapter module to convert the Excel file as payload.


      • Hi Prakash,

        Thanks for your reply and good information to use PayloadSwapBean.
        And I have other questions, where can I find PayloadSwapBean source code and write custom adapter module?
        Can you answer my questions, Prakash?

        Best regards,

        • Hi Michikuni,

          You will get the source code of the PayloadSwapBean. Check out this blog The specified item was not found. to know more about using PayloadSwapBean in a Sender Mail Adapter.


  • Hi Prakash ,

    I wanted to have a mail Excel workbook created with more then one work sheet in it what checnges wil be needed in the XSLT mapping of this Blog??

    Urgent Help needed


  • Hi,

    idoc - mail (shipment)
    The blog is useful but I need to generate a  dynamic name for the attachment and the value of file name is to be generated from fields of IDoc(src).I have stored the value in one of the fields in Shipment structure.Dynamic config is not working .Please suggest me the code for dynamic config in xslt