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.

Tue Dec 08, 2015 12:49 pm

Hi,

I have a formula in my table, however when i produce my document the formula does not update what code would do this.

Currently I am trying to convert the following code in to spire

For i = 1 To ActiveDocument.Fields.Count
ActiveDocument.Fields(i).Update()
Next

The ActiveDocument is the current word document that is being merged.

I have tried ActivedDocument.IsUpdateFields = True

But in my document i get !Undefined Bookmark, ABOVE

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Wed Dec 09, 2015 1:37 am

Hi,

Thanks for your inquiry.
To help us recreate and resolve your issue, please provide us with your document.
Thanks.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Wed Dec 09, 2015 9:12 am

Hi,

i have attached the document.

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Thu Dec 10, 2015 6:09 am

Hi,

Thanks for providing.
Sorry that our Spire.Doc doesn't support to calculate the formula field at present. We have added it as new feature into our schedule. We will inform you when it is supported.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Thu Dec 10, 2015 9:22 am

Ok thanks amy, do you have an approx time scale of when this will be added to spire?

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Thu Dec 10, 2015 9:33 am

Hello,

I am afraid now I can't provide you the time, once there is some update, we will let you know ASAP.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Dec 10, 2015 9:46 am

Ok thank you

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Wed Dec 30, 2015 2:59 am

Hi,

Thanks for your waiting.
The feature has been supported. Welcome to download and test Spire.Office Platinum (Hot Fix) Version:2.12.8.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Wed Dec 30, 2015 9:50 am

Hi,

Thank you for the fix.

I have added in the new spire doc dll version 5.5.216.4041 and the new license dll. but when merging the document the formula doesn't update.

The code I am using is ActiveDocument.IsUpdateFields = True, is the correct line of code? (ActiveDocument being the document i have created.)

I am calling this code before I save the document.

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Thu Dec 31, 2015 2:24 am

Hi,

Thanks for your feedback.
I tested your document(School.docx) with some simple data, and the formula({ =SUM(ABOVE) \# "0%" } ) worked fine on my side.
Would you please share all your code and used data for investigation?
Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Thu Dec 31, 2015 9:50 am

hi,

I wont be able to share my code as there is so much of it! can you share the example you used.

Overview of my code is that i have merge fields that are then used to find data for the matching merge field, then i am formating the document if any is needed, this is then saved. and before the document is saved is where i am using IsUpdateFields = True.

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Fri Jan 01, 2016 2:13 am

Hi,

I am using the following code, and attached result file.
Code: Select all
  Document doc = new Document();
            doc.LoadFromFile("..\\..\\School.docx");
            doc.Replace("[Progress Score Descending.decGrade/1/3]", "10", true, true);
            doc.Replace("[Progress Score Descending.decGrade/1/4]", "11", true, true);
            doc.Replace("[Progress Score Descending.decGrade/1/5]", "12", true, true);
            doc.Replace("[Progress Score Descending.decGrade/1/6]", "13", true, true);
            doc.Replace("[Progress Score Descending.decGrade/1/7]", "14", true, true);
            doc.IsUpdateFields = true;
            doc.SaveToFile("result.docx",FileFormat.Docx2010);


Best Regards,
Amy
E-iceblue support team
User avatar

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

Mon Jan 04, 2016 6:13 am

Hi,

Did your issue still exist?
If so, please share all your code for investigation. Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Tue Jan 05, 2016 9:20 am

Hi amy,

i havent had a a chance to look at this as yet, once i have i will let you know the outcome

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Tue Jan 05, 2016 12:07 pm

hi amy,

i have got it working, issue was with blank field i was bringing in on the word merge.

many thanks for your help

stevenheggie
 
Posts: 60
Joined: Tue Jun 24, 2014 10:32 am

Return to Spire.Doc