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

Remove Rows if table is empty

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?



6 Replies

MA Marcelo replied to Marcelo 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


DB Dilli Babu Nandha Gopal Syncfusion Team 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. 



MA Marcelo replied to Dilli Babu Nandha Gopal 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?



DB Dilli Babu Nandha Gopal Syncfusion Team 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. 



MA Marcelo replied to Dilli Babu Nandha Gopal 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?


DB Dilli Babu Nandha Gopal Syncfusion Team 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. 


Loader.
Live Chat Icon For mobile
Up arrow icon