Aspose.words use through .docx Template

Hi,

I need a example where i have 50 data table in doc template and 45 images in doc template to display

I need a example how to set a field a in .docx format through data table, and how to set a images and its alignment .

I need to create a document around 85 pages for a client.

I need a fastest solution that i can create a document in less time,according to you mail merge functionality this seems to be better option for creating a doc template and generate the doc for clients.

Kindly do the needful,ASAP

Regards
Jagdish K

Hi
Jagdish,

Thanks for your inquiry.

Jagdish:

I need a example where i have 50 data table in doc template and 45 images in doc template to display

You can insert 50 mail merge regions and 45 image merge fields in your template document to be able to merge data from 50 DataTables into your document. Please read the following articles on How-to: Execute Mail Merge with Regions and How to Insert Images from a Database:
https://docs.aspose.com/words/java/types-of-mail-merge-operations/
https://docs.aspose.com/words/net/types-of-mail-merge-operations/

Jagdish:

I need a example how to set a field a in .docx format through data table, and how to set a images and its alignment .

I would suggest you please read the Mail Merge and Reporting section here. Moreover, you can use the following code snippet for inserting and aligning the Images during Mail Merge:

void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs args)
{
    DocumentBuilder builder = new DocumentBuilder(args.Document);
    builder.MoveToMergeField(args.FieldName);
    Shape shape = builder.InsertImage(args.FieldValue.ToString());
    shape.Width = 100;
    shape.Height = 100;
    // Align the inline Image as follows
    builder.CurrentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Center;
    // shape.HorizontalAlignment =
    HorizontalAlignment.Center;
}

Please let me know if I can be of any further assistance.

Best Regards,

Hi,

Thank u for your quick reply.

Hi,

Please let us know any time you have any further queries. We are always glad to help you.

Best Regards,