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

Notifications

Announcements

No record found.

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)
  • Verified answer
    Community Member Profile Picture
    on at

    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.

  • Jim Richardson Profile Picture
    on at

    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.

  • Suggested answer
    Kenny Saelen Profile Picture
    on at

    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans