Excel Template Based Exporter

Administrator
Member, Moderator, Administrator Posts: 2,506
Excel Template Based Exporter
Export data from any table directly to Excel with greater ease and flexibility! Only basic report skills are required to implement the Excel Template Based Exporter (ETBE).
More powerful than a dataport:
Dataports rely on hardcoding the order of field data in the Field Designer. The ETBE isn't constrained to one layout. Just create a new Excel file with the fields needed in the first row and the ETBE does the rest. Use the same report object with different template files to export table data in any field combination. All without ever writing a field name in the code!
Empower your users to customize their own excel templates. Give them the ability to:
- select the fields THEY want to see
- arrange the fields in any order
- rename what the fields are called in the export file
- pre-design excel file (print settings, format, color, etc)
- filter and so rt data just as any basic report has to offer
- include extra data from associated tables (some code required)
ETBE IS SECURE: since ETBE uses the basic report objects of Navision, users only have access to the tables you set them up to have (all while maintaining their predefined permissions).
How to use:
Just create a basic report with one dataitem. Then, add the three public function calls to the included Codeunit. The example report included demonstrates how to:
1. Initialize codeunit in OnPreDataItem
2. Export data for each record in OnAfterGetRecord
3. Save the final export in the OnPostRecord
(the easiest way is to save the included excel template directly to C:\)
Learn Excel Automation Here:
If you are new to Excel Automation, I encourage you to take a look at the code. The comment-filled codeunit provides a great overview of what is needed to make an excel export happen.
I have found this to be a very helpful tool. I originally designed it for a specific task but then later came to recognize it as a more general multi-purpose module. I am glad to take the time to package it up and be able to share it with others.
As it is still growing, please feel free to send suggestions on improvements to my email address: chriscarlins@msn.com
Thanks
http://www.mibuso.com/dlinfo.asp?FileID=783
Discuss this download here.
Export data from any table directly to Excel with greater ease and flexibility! Only basic report skills are required to implement the Excel Template Based Exporter (ETBE).
More powerful than a dataport:
Dataports rely on hardcoding the order of field data in the Field Designer. The ETBE isn't constrained to one layout. Just create a new Excel file with the fields needed in the first row and the ETBE does the rest. Use the same report object with different template files to export table data in any field combination. All without ever writing a field name in the code!
Empower your users to customize their own excel templates. Give them the ability to:
- select the fields THEY want to see
- arrange the fields in any order
- rename what the fields are called in the export file
- pre-design excel file (print settings, format, color, etc)
- filter and so rt data just as any basic report has to offer
- include extra data from associated tables (some code required)
ETBE IS SECURE: since ETBE uses the basic report objects of Navision, users only have access to the tables you set them up to have (all while maintaining their predefined permissions).
How to use:
Just create a basic report with one dataitem. Then, add the three public function calls to the included Codeunit. The example report included demonstrates how to:
1. Initialize codeunit in OnPreDataItem
2. Export data for each record in OnAfterGetRecord
3. Save the final export in the OnPostRecord
(the easiest way is to save the included excel template directly to C:\)
Learn Excel Automation Here:
If you are new to Excel Automation, I encourage you to take a look at the code. The comment-filled codeunit provides a great overview of what is needed to make an excel export happen.
I have found this to be a very helpful tool. I originally designed it for a specific task but then later came to recognize it as a more general multi-purpose module. I am glad to take the time to package it up and be able to share it with others.
As it is still growing, please feel free to send suggestions on improvements to my email address: chriscarlins@msn.com
Thanks

http://www.mibuso.com/dlinfo.asp?FileID=783
Discuss this download here.
0
Comments
-
This download is great (after you fix the automation variables for the codeunit) I guess every system is different.
Anyway. I notice that you can't overwrite a file so there for you cannot append (or add-to) an existing file. That would be my suggestion for the next update.
I will try to do it myself - but it's defiantely not my specialty.
Note I changed it to Export Sales Header Info instead of Cust Ledger Entries - Works Great.0 -
Anyone else get permission errors for the codeunit?
After License change "you do not have permission......."
I changed the codeunit to 50003 still with a problem.
I have access to 50000,50001,50002
Is there something stange about this codeunit?0 -
Chris,
I have to download the txt version of the code, instead of fob, and modify the report ID, codeunit ID inside the report and codeunit id. I also need to make change to Automation subtype. It ran great! =D> =D>
But, I have few questions:
1. Is it true that for each table output I need to create a report for it?
2. If I read the instruction correct, I can have one report setup and user can have their own templates to show their own excel information, within their permissions?
Best Regards,
CouberPu0 -
How can I change the code, so it searches the field names in row 2 or 8 or...not in the first row? I would like to create a header containing many rows, and start with data input from, let's say, row 9 (after the header).0
-
Indeed a setup of the automation variables needed on the codeunit. Anyone knows which is the correct setup?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions