Blank Row Inserted in Table despite no data

Last post 01-19-2011, 6:44 AM by alexey.noskov. 6 replies.
Sort Posts: Previous Next
  •  11-03-2010, 12:48 PM 267202

    Blank Row Inserted in Table despite no data .NET

    We are a long time user of Aspose.Words.  Our current production system is using Aspose.Words 8.0.  We have a new release scheduled shortly and would like to upgrade to Aspose.Words 9.5.  However, during testing we've discovered that the table merge process is behaving differently.  Specifically, if you have a table and merge with an empty list apparently you get a blank row.  I'm not sure when this bug was introduced, but I did test with as early as version 9.1 and got the same results (i.e. bogus blank row).  This is aesthetically unacceptable and I may need to revert to Aspose.Words 8.0 unless you can provide a fix or workaround.  Please advise.

    Thanks,

    Ed 

    Filed under: Blank Row;Merge;Table
     
  •  11-03-2010, 3:30 PM 267250 in reply to 267202

    Re: Blank Row Inserted in Table despite no data

    Hello

    Thanks for your inquiry. Could you please show me your code and attach your input and output documents here for testing? I will investigate the problem on my side and provide you more information.

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  11-03-2010, 5:40 PM 267277 in reply to 267250

    Re: Blank Row Inserted in Table despite no data .NET

    Attachment: Present (inaccessible)
    I put together a quick & dirty test that illustrates the problem.  Attached is a zip file containing a Visual Studio 2010 solution.  There are two tests: (1) with Aspose.Words v8 and another (2) with v9.5.  The tests save their output to a hard-wired path (change as needed for your purposes).  I also attached sample output from each test so you can see the difference.
     
  •  11-03-2010, 7:06 PM 267282 in reply to 267277

    Re: Blank Row Inserted in Table despite no data

    Attachment: Present (inaccessible)

    Hi Ed,

    Thanks for your inquiry

    This is happening because the behaviour of how unmerged regions are handled changed between the older and more recent versions of Aspose.Words. We are looking to reincorporate this behaviour again. We will keep you informed of when this fix is avaliable.

    In the mean time you can use the class attached to this post to manually remove the unmerged regions from your document. You use the code like below. You should call RemoveEmptyRegions before or instead of calling DeleteFields().

    // Open the document.

    Document doc = new Document("Document Out.doc");

     

    // Execute mail merge. Will have no affect as there is no data.

    doc.MailMerge.ExecuteWithRegions(data);

     

    // Remove the unmerged mail merge regions from the document. Pass a boolean false value so to not remove the parent container of the region i.e the row or table.

    doc.Accept(new RemoveEmptyRegions(false));

     

    // Save the output document to disk.

    doc.Save(dataDir + "Document Out.doc");

     

    Thanks,

     


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  11-03-2010, 9:43 PM 267292 in reply to 267282

    Re: Blank Row Inserted in Table despite no data .NET

    Thank you for your quick reply. I will try the workaround you provided.

    I would strongly encourage you to reincorporate the original merge behavior. It's disconcerting when we upgrade your product and encounter unanticipated side affects. I'm assuming this issue is undocumented, unless I overlooked something.

    Anyway, thanks again for your help.
     
  •  11-03-2010, 9:50 PM 267294 in reply to 267292

    Re: Blank Row Inserted in Table despite no data

    Hi Ed,

    Sure, we are planning to implement this behaviour once again. We will inform you as soon as it is resolved.

    You can find details on this in the documentation page here.

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  01-19-2011, 6:44 AM 279565 in reply to 267294

    Re: Blank Row Inserted in Table despite no data

    The issues you have found earlier (filed as 17666) have been fixed in this update


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
View as RSS news feed in XML