Product Catalog Demo--Question about appending sections

I am simulating nested merge regions (i.e. master-child report) using the ProductCatalogDemo as a guide and I have everything working great. My one question is how can I append the new document sections continuously on the page, without each new section becoming a new page in the document? For example, how would you modify the ProductCatalog demo to append each Category continuously on the page, rather than have each Category on its own page?

Hi,

Thank you for considering Aspose.

You can use Section.AppendContent instead of Sections.Add. For example, in the ProductCatalog demo you could change the AppendDoc method to something like that:

private void AppendDoc(Document dstDoc, Document srcDoc)
{
    while (srcDoc.Sections.Count > 0)
    {
        Section section = srcDoc.Sections[0];
        srcDoc.Sections.RemoveAt(0);
        if (dstDoc.Sections.Count == 0)
            dstDoc.Sections.Add(section);
        else
            dstDoc.Sections[dstDoc.Sections.Count - 1].AppendContent(section);
    }
}

Thanks for your reply, it’s exactly what I needed! The example makes perfect sense to me–I should have figured that out on my own;-)

And I did actually purchase a copy of Aspose.Word, so I definitely considered it!

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(76)