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
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.
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,867 Super User 2024 Season 2
Martin Dráb 229,173 Most Valuable Professional
nmaenpaa 101,156