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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Remove Rows if table is empty

Thread ID:

Created:

Updated:

Platform:

Replies:

142502 Feb 6,2019 05:59 PM UTC Feb 18,2019 12:28 PM UTC WinForms 6
loading
Tags: DocIO
Marcelo
Asked On February 6, 2019 05:59 PM UTC

Hi 
I have a word template (in attach)

In my template i have a list and sublist

my sublist have a table header

If sublist is empty how remove table header and all rows?



Marcelo
Replied On February 6, 2019 06:00 PM UTC

Hi 
I have a word template (in attach)

In my template i have a list and sublist

my sublist have a table header

If sublist is empty how remove table header and all rows?



My attach

Attachment: Template_1e37b4b3.rar

Dilli Babu Nandha Gopal [Syncfusion]
Replied On February 7, 2019 06:11 PM UTC

Hi Marcelo, 

Greetings from Syncfusion. 

Yes, it is possible to remove a table if a group is empty. To perform this, the following things need to be done. 
   1. Group start must be outside a table i.e., table must be placed inside group start and end. We have modified your template document which is available in the following link - http://www.syncfusion.com/downloads/support/forum/142502/doc/Modified_Template2691692   
   2. Need to enable RemoveEmptyGroup property before MailMerge execution. 
document.MailMerge.RemoveEmptyGroup = true; 

Please let us know if you have any questions. 

Regards, 
Dilli babu. 


Marcelo
Replied On February 8, 2019 05:57 PM UTC

Hi Marcelo, 

Greetings from Syncfusion. 

Yes, it is possible to remove a table if a group is empty. To perform this, the following things need to be done. 
   1. Group start must be outside a table i.e., table must be placed inside group start and end. We have modified your template document which is available in the following link - http://www.syncfusion.com/downloads/support/forum/142502/doc/Modified_Template2691692   
   2. Need to enable RemoveEmptyGroup property before MailMerge execution. 
document.MailMerge.RemoveEmptyGroup = true; 

Please let us know if you have any questions. 

Regards, 
Dilli babu. 


you example repeat my table header

other solution?


Dilli Babu Nandha Gopal [Syncfusion]
Replied On February 13, 2019 04:37 PM UTC

Hi Marcelo,

Thank you for your patience.

While executing Mail merge with the given template, if the data(sublist) of “Job positions” merge field group is empty and RemoveEmptyGroup API is true, then all the rows of “Job positions” group is removed as expected. Please find the example project from below link,
http://www.syncfusion.com/downloads/support/forum/142502/ze/Sample_MailMerge-86268251
  
Could you please confirm us you expected requirement?   
1.    Remove rows of “Job positions” group alone.  
2.    Remove rows of “Job positions” group along with below highlighted table header row  .

 
 
 
Regards, 
Dilli babu. 


Marcelo
Replied On February 15, 2019 12:41 PM UTC

Hi Marcelo,

Thank you for your patience.

While executing Mail merge with the given template, if the data(sublist) of “Job positions” merge field group is empty and RemoveEmptyGroup API is true, then all the rows of “Job positions” group is removed as expected. Please find the example project from below link,
http://www.syncfusion.com/downloads/support/forum/142502/ze/Sample_MailMerge-86268251
  
Could you please confirm us you expected requirement?   
1.    Remove rows of “Job positions” group alone.  
2.    Remove rows of “Job positions” group along with below highlighted table header row  .

 
 
 
Regards, 
Dilli babu. 


Your solution repeat department name

I need exactly this behavior



Other solution? By code? Identify table or title name and remove?

Dilli Babu Nandha Gopal [Syncfusion]
Replied On February 18, 2019 12:28 PM UTC

Hi Marcelo, 

We have modified the sample based on your requirement which can be available in the following link. 

Please let us know if the sample fulfills your requirement. 

Regards, 
Dilli babu. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;