We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DocIO RemoveEmptyParagraphs broke word fie and RemoveEmptyGroup does not work

There is a word template(office 97 - 2003), I open the template use DocIO, then set RemoveEmptyParagraphs = true and save it in code, the word file got a error when I open it.
And set RemoveEmptyGroup = true, the table with mail field of the template  does not been removed.

13 Replies

SK Sathish K Syncfusion Team November 29, 2013 05:57 AM UTC

Hi Winson,

 

Thank you for your interest in Syncfusion products.

 

Could you please provide us the template document you have used along with the sample project or code snippet to reproduce issue at our end? Thereby we can analyze further on this case and provide you the appropriate solution.

 

Please let us know if you have any other questions.

 

Regards,

Sathish                                    



WY Winson Yang December 3, 2013 02:30 AM UTC

Hi, Sathish ,
For your refer.


DocIO_c57f6f13.zip


SK Sathish K Syncfusion Team December 10, 2013 05:52 PM UTC

Hi Winson,

 

Thank you for your update.

 

We are unable to reproduce any of the issues mentioned by you. We have modified your sample to show you the same. Please find the attached sample and refer that. Please modify the sample to reproduce the issue at our end and update us.

 

Please let us know if you have any questions.

 

Regards,

Sathish



DocIO_c639dd20.zip


WY Winson Yang December 11, 2013 01:58 AM UTC

Hi, Sathish,
I open the project you attached, and run it.
Then I generate and save the docx file, open it to check.
The table with the merge field and paragraph with the merge field still here.
"RemoveEmptyParagraphs" and "RemoveEmptyGroup" are not work.


Capture_b8dd5339.zip


SK Sathish K Syncfusion Team December 11, 2013 02:10 PM UTC

Hi Winson,

 

Thank you for your update.

Please do find the below table to illustrate the behaviour of MailMerge properties.

Property Name

Specification

ClearFields

If this property is set as false then we have clear the unmerged field from the generated word document. Default value for this property as true.

RemoveEmptyParagraphs

If this property is set as true then we could remove the paragraph which contain mergefield with empty value.

RemoveEmptyGroup

If this property is set as true then we could remove the group which contain merge fields with empty values.


In the given sample you have set the ClearFields property value as false, caused the unmerged fields are preserved in the generated word document. For resolving this issue, please ignore to set the ClearFields as false. This is not an issue and actual behaviour with MailMerge functionality of DocIO. For your reference, we have modified the sample to meet your requirement. Please do find the sample from the attachment. Try running the sample and let us know if this helps you.

 

Please refer the below UG links for more details on Mail merge functionality of DocIO:

http://help.syncfusion.com/UG/winrt/default.htm#!Documents/mailmerge.htm


http://help.syncfusion.com/UG/winrt/default.htm#!Documents/additionalmailmergef.htm
 

Please let us know if you have any questions.

 

Regards,

Sathish



DocIO_f1323e7e.zip


WY Winson Yang December 12, 2013 01:20 AM UTC

Hi, Sathish,
Thanks for your reply and detail information.
But I run the project which the latest you attach, the empty table still in the generated word file.
The "RemoveEmptyGroup" still not work.


Capture_85417bb1.zip


SK Sathish K Syncfusion Team December 13, 2013 02:05 PM UTC

Hi Winson,

 

Thank you for your update.

 

The actual behavior of "RemoveEmptyGroup" property is to remove the empty paragraph generated between the BeginGroup and EndGroup. It will not remove the empty tables or other text body items preserved in the document. If you want remove the empty table, then you have to find out the index of that table entity and remove that entity.

 

Please let us know if you have any other questions.

 

Regards,

Sathish


WY Winson Yang December 16, 2013 02:57 AM UTC

Hi, Sathish,
Well noted, Thanks for your reply~~!


SK Sathish K Syncfusion Team December 16, 2013 07:16 AM UTC

Hi Winson,

 

Thank you for your update.

 

We are glad that our guidance helped you well. Please let us know if you have any other concerns. We will be happy to help you as always.

 

Regards,

Sathish



A A July 5, 2016 09:22 PM UTC

Hi Sathish,

I want to remove empty paragraphs in table cells after mail merge. If I set RemoveEmptyParagraphs = true, I see the following error when opening the file:

Ambiguous cell mapping encountered. Possible missing paragraph element. <p> elements are required before every </tc>.

If I do not set the property, there will be no error but empty paragraphs are kept.


SV Sivasubramani V Syncfusion Team July 6, 2016 05:25 AM UTC

Hi Winson,

Thank you for your update.

Could you please provide us the template document along with the sample application to reproduce issue at our end?

It would be much helpful for us to reproduce and analyze the issue at our end.

Please let us know if you have any questions.

Regards,
Sivasubramani. V
 



A A July 6, 2016 01:22 PM UTC

Hi Sivasubramani,

This happens with a simple template consisting of just a table. For example, you can reproduce the error with attached template if column "Race" of the table is empty.


Attachment: ListContact_faf4a6b0.zip


PE Priyanga Elangovan Syncfusion Team July 7, 2016 12:53 PM UTC

Hi Winson,

We are unable to reproduce the mentioned exception issue with your attached template document. Could you please provide us the sample application or code example to reproduce the issue at our end

It would be much helpful for us to reproduce and analyze the issue at our end.


Please let us know if you have any questions.


Regards,
Priyanga.E 


Loader.
Up arrow icon