web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Creating Excel workbook via X++

(0) ShareShare
ReportReport
Posted on by

I have the task of creating a Excel workbook for our international freight forwarders.  The workbook includes items such as the sales order #, item Id, sales Qty, etc, etc.  The workbook is generated and send to the freight forwarders to full in with the flight information use to delivery the order to our customers.  They send the workbook back to us for we can generate a pretty report to send to the customer.  The issue is the freight forwarders are constantly misspelling or abbreviating the name of the airlines.  I would like to include a data validation / named list in the airline name cells from X++.  Is this doable?  Here's a link showing what I want to perform programmatically with X++:

http://office.microsoft.com/en-us/excel-help/create-or-remove-a-drop-down-list-HP005202215.aspx

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Kenny Saelen Profile Picture
    on at
    RE: Creating Excel workbook via X++

    There are some options.

    Since you cannot use the template (which would be the best option actually as Will L proposed), there are other options:

    1: Use the X++ framework to write XLS files. msdaxerp.wordpress.com/.../writeread-to-excel-sheet

    2: You can also just write an XML so that you can have fast and easy X++ code. Then you can apply an XSLT to fit the format op XLSX (which is a zip with XML in it). I once wrote a post on that. www.ksaelen.be/.../using-c-xml-xslt-to-create-excel-spreadsheet

    3: look for a good .net API and call that one from AX. visualstudiogallery.msdn.microsoft.com/81c33294-eee9-4683-9cee-a5714cfebf34 But this might be a bit overkill too.

  • Jim Richardson Profile Picture
    on at
    RE: Creating Excel workbook via X++

    Will,

    Thanks for your reply, but I don't think a template will work.  The list of airlines is too dynamic for a template and the number of orders various from single digits to several hundred.  So I think creating the data validation list via X++ is the best solution.  So any help?

    JIm R.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Creating Excel workbook via X++

    The easiest way would be to create an Excel template with the data validation rules already applied.  When your X++ runs you can write the cells for the Source of your data validation or if you already know them ahead of time leave them prepopulated.  So you are writing to a partially formatted excel template instead of trying to do every thing with X++ code.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans