Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in For cyclus #15

Open
LadislavSopko opened this issue Mar 15, 2020 · 0 comments
Open

Problem in For cyclus #15

LadislavSopko opened this issue Mar 15, 2020 · 0 comments

Comments

@LadislavSopko
Copy link

Hello,
In first Nice project.
I did a try to use it in my case. I need Multilanguage document generator. I decide tu use FieldCode in this manner:

<% for(int i = 0; i < 10; ++i){ %>
{ INCLUDETEXT "{FILENAME \p}/../Texts<%=Model.Lang%>.docx" Main_001 }
<% } %>

INCLUDETEXT will load part of other document into current. I want to change include file name depending on current language. I have parallel files with bookmarked text blocks, and word will replace them after. I saw that your code did not handle FieldCode out of the box, so I did some fix to make it work. But there is a problem with this. SharpXdoc will replace only the first iteration with correct language string, resting 9 lines will come without Lang.
it produces this :

{ INCLUDETEXT "{FILENAME \p}/../TextsIT.docx" Main_001 }
{ INCLUDETEXT "{FILENAME \p}/../Texts.docx" Main_001 }
{ INCLUDETEXT "{FILENAME \p}/../Texts.docx" Main_001 }
{ INCLUDETEXT "{FILENAME \p}/../Texts.docx" Main_001 }
{ INCLUDETEXT "{FILENAME \p}/../Texts.docx" Main_001 }
...

I did a try to debug it, but I did not figure out while it not work.
I make branch: "feature/laco/Add_FuncCode" in my fork with problem project "Test"
You can check it here:
https://github.com/LadislavSopko/SharpDocx/tree/feature/laco/Add_FuncCode

Feel free take my fixes for FieldCode if you like it.

Regards
Ladislav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant