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 :
Finance | Project Operations, Human Resources, ...
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 21

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

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    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.

  • Maris Sausins Profile Picture
    21 on at

    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,811 on at

    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
    21 on at

    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,811 on at

    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
    21 on at

    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!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans