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.

Mon Nov 23, 2015 9:36 am

Hi,

I'm using mail merge with content control when I make the document from xml and write the output to the file the document docx will show the values if I make the Update field.But when I convert the .docx to .pdf my mergefield value will show like that;
- 905196,96 \# ₺#,###.##.Is there a way to show my result with formatted?..And also I'm create the macro to automatic all update field but I'm not triggered from c# to update that fields with my macro?

bora1891
 
Posts: 8
Joined: Thu Nov 19, 2015 6:58 am

Tue Nov 24, 2015 3:33 am

Hi,

Thanks for your inquiry.
Was your xml doing data binding with .docx document?
I checked your attached .docx document and it didn't include such an xml file.
Would you please provide us your code and further information about how to operate your document?
Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Fri Nov 27, 2015 8:44 am

Hi,

I work with openxml and I read xml from my database.Then I insert data from my methods but I have a mergefields in my document and I insert data to the merge field but the fields didnt update.I changed the content of the document from openxml but when I convert docx to pdf the merge fields shows like that - 905196,96 \# ₺#,###.##.I write the document to the disk and when I opened the document give the message dialog.Dialog says that;
this document content fields update.Do you want update this content?
--> If I click yes the merge fields updated

I used this link to update document content.
http://www.samuraiprogrammer.com/blog/2 ... pened.aspx

Is there a way to update fields with spire doc?

bora1891
 
Posts: 8
Joined: Thu Nov 19, 2015 6:58 am

Fri Nov 27, 2015 8:55 am

Hi,

Please try this line document.IsUpdateFields = true.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Wed Dec 02, 2015 6:32 am

Hi,

Has your issue been resolved?
Thanks for your feedback.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Tue Jul 19, 2022 7:58 am

I found this thread from google, and I seem to have the same exact problem.
Tried setting
Code: Select all
Document.IsUpdateFields = true

But that not seems to be working.
I'd appreciate any other solutions for this.

Spire.Doc Version=10.2.5.0

thusithagh
 
Posts: 4
Joined: Tue Jul 19, 2022 7:55 am

Tue Jul 19, 2022 9:53 am

thusithagh wrote:I found this thread from google, and I seem to have the same exact problem.
Tried setting
Code: Select all
Document.IsUpdateFields = true

But that not seems to be working.
I'd appreciate any other solutions for this.

Spire.Doc Version=10.2.5.0


Hi,

Thanks for your inquiry.

The lastest version of Spire.Doc is 10.7.0. Please firstly update it and test again. If the issue still exists, to help us reproduce it, please provide your full test code and test files(if any). Thanks in advance for your assistance.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Tue Jul 19, 2022 11:26 am

TEST.zip
I just updated to FreeSpire.Doc 10.7.0 and this still seems to be happening.
I don't have a complete code, but it looks like below

Code: Select all
Document sourceDoc = new Document(new MemoryStream(doc.Document));
sourceDoc.IsUpdateFields = true;
MemoryStream pdfStream = new MemoryStream();           
sourceDoc.SaveToStream(pdfStream, FileFormat.Docx);


doc.Document is byte array of a generated word document. My final goal is to convert that byte array of a word doc into a PDF. So this is just testing that to see whether the update field gets updated correctly.
I'm attaching a sample file with an update field. I expect the update field in this to be updated via FreeSpirce.Doc, which isn't working.

TEST.zip

thusithagh
 
Posts: 4
Joined: Tue Jul 19, 2022 7:55 am

Wed Jul 20, 2022 3:56 am

Hi,

Thanks for your sharing.

I did notice the IF field was not updated correctly. Word updates the field value to "BuyerCountry" and Spire.Doc is updated to an empty string. I have logged this issue in our bug tracking system with the ticket SPIREDOC-8191. If there is any update about it, I will notify you in time. Sorry for the inconvenience caused.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Mon Jul 25, 2022 4:30 am

Thank you!
Please do update me. For some reason I'm not getting any notifications for this forum.

thusithagh
 
Posts: 4
Joined: Tue Jul 19, 2022 7:55 am

Mon Jul 25, 2022 8:30 am

Yes I will inform you in time when the issue is resolved.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.Doc

cron