Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Jun 10, 2016 8:47 am

We are currently replacing Word with Spire.doc. We have several hundred documents containing nested IF's with merge fields, which seem to work with Word - but do not work correctly with Spire.

Given the pseudo coded nested if statement below

IF(Mergefield1 = "x"
"Some Text"
If(MergeField2 = "y"
"More Text"
"Other Text"))


we seem to be getting the following results with Spire

If Mergefield1 = "x"
Output = "Some Text" --Correct

If Mergefield1 = "a" & MergeField2 = "y"
Output = "1" --should be "More Text"

If Mergefield1 = "a" & MergeField2 = "a"
Output = "0" --should be "Other Text"

So it would appear that what is being output is the result of the Boolean expression that is part of the 2nd IF statement.

As I said we have several hundred complex documents and changing them to convert all of the nested IFs is not really an option

nick_le_page
 
Posts: 2
Joined: Fri Jun 10, 2016 8:06 am

Mon Jun 13, 2016 3:17 am

Hi,

Thanks for your posting.
To help us investigate your issue and work out solution soon, please share us a sample document and your code.
If it is inconvenience to share them here, please send them to support@e-iceblue.com.
Thank you for your assistance in advance.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Jun 14, 2016 12:52 pm

I am sorry, It appears that we were using a slightly out of date DLL in the production environment. When creating a demo I could not recreate the problem. Updating the server DLLs has fixed the problem

Thanks

nick_le_page
 
Posts: 2
Joined: Fri Jun 10, 2016 8:06 am

Wed Jun 15, 2016 1:21 am

Hi,

Thanks for your feedback.
Welcome to feel free to write to us for further problems.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc