Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Export to word template, an error occured during the export.

(0) ShareShare
ReportReport
Posted on by 56

Hello, everyone!

I have a custom data entity with root DS and join data sources, and I want to export data to word template, but I am getting and error "an error occured during the export".

Tried to recreate the data entity, made it simplier with almost no joined data sources, just DAVS, removed all methods, but still getting the same error.

pastedimage1676287436352v1.png

pastedimage1676287473911v2.png

when debugging, stack trace to error msg:

pastedimage1676287681401v3.png

getting to line 137, then jumps over to catch block and displaying error

pastedimage1676288410684v5.png

in "renderWordTemplate" method of DocuTemplaterender class

pastedimage1676288172204v4.png

after line 557 result variable I guess is true, because it doesn't get into "if" block, but I can't realy view the value of the result in watch.

In the catch block, I'm getting error:

pastedimage1676288569509v6.png

Tried some different data entities on different forms, export to word works perfectly fine. Can't figure out what is the problem.

Maybe someone can help me.

Any help appreciated!

Kind Regards,

Maris

  • Maris Sausins Profile Picture
    56 on at
    RE: Export to word template, an error occured during the export.

    Sorry for the late response!

    I'm always doing full build with DB sync, when creating a new entity. Then refreshing the entity list.

    My colleague found out that changing "Date, time, and number format" to "en-us" in user option (maybe some other formats works too) export to word is working perfectly fine.

    Don't really know why is that and how to fix it, but we think that problem is causing a field of type real which is in primary index. When used "en-us" number format then the real number is formated using dot like "1.0", but when using "lv" number format the real number is formated using comma like "1,0".

    Any help appreciated!

  • huijij Profile Picture
    19,801 on at
    RE: Export to word template, an error occured during the export.

    When you create entity, you must sync a database when you build entities. On the Visual Studio toolbar, click Build > Build Solution to build the project. Verify that the build doesn't contain any errors. If the error persists, you can recreate a new entity.

  • Maris Sausins Profile Picture
    56 on at
    RE: Export to word template, an error occured during the export.

    Standard entities and my other custom entities working fine, "documentGenerator.GenerateDocument(params)" returns "true", only export to word not working for this particular entity, but "Open in excel" functionality working perfectly fine.

  • huijij Profile Picture
    19,801 on at
    RE: Export to word template, an error occured during the export.

    Since it is skipped, it should not be executed to this piece of code. Do you also encounter this problem when exporting other standard entities or just this custom entity?

  • Maris Sausins Profile Picture
    56 on at
    RE: Export to word template, an error occured during the export.

    Hi, Judy!

    Thanks for your response! Can you please explain, how do you mean to print out the value of the variable?

    When I'm debugging the "renderWordTemplate" method of DocuTemplaterender class, cursor just jump to line 563, and I can't see the value of variable result.

    Kind Regards

    Maris

  • huijij Profile Picture
    19,801 on at
    RE: Export to word template, an error occured during the export.

    Hi,

    I think when you don't know the value of the variable of line 557, you can try to print it out. Then you can rebuild your project with DB sync and try again.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Jahanvi Profile Picture

Jahanvi 34

#2
PJ JohnPaul Profile Picture

PJ JohnPaul 5

#3
SudhanshuMSID Profile Picture

SudhanshuMSID 1

Overall leaderboard

Product updates

Dynamics 365 release plans