Excel Template Based Exporter

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2009-08-06 in Download section
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.

Comments

  • SavatageSavatage Member Posts: 7,142
    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.
  • SavatageSavatage Member Posts: 7,142
    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?
  • couberpucouberpu Member Posts: 317
    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,
    CouberPu
  • miksy123miksy123 Member Posts: 10
    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).
  • KatashikiKatashiki Member Posts: 12
    Indeed a setup of the automation variables needed on the codeunit. Anyone knows which is the correct setup?
Sign In or Register to comment.