Set the position of a table absolute

Hi,
i’m checking to buy Aspose.Word to use it for generation files on our server but have one problem.
I have to postion a table absolut on a page but can’t find any way to do this, also i didn’t found any solution in this forum.
Maybe someone can give me a little codehint, because the is “a must” for generation our comlex documents on the server.
Thanks :wink:

Hi

Thanks for your inquiry. Unfortunately, currently there is no way to specify absolute position of table in Word document using Aspose.Words. I linked your request to the appropriate issue. We will notify you as soon as this feature is supported.
Why is it so important to specify absolute position for your table? Could you please attach your document here for investigation? Maybe there is other way to achieve what you need without using absolute positioned tables.
Best regards,

Thanks for the quick response :slight_smile:
I attached the document wich should be generated on the server and should be aviable in different fileformats for downloading :slight_smile:
The big problem is the first page where the two tables can habe different rowcounts and be placed “inside” the page
See you …

Hi

Thank you for additional information. As I can see you do not use Absolute Positioned tables in your document. You told that you need generate this document programmatically, but if all your documents have the same structure, you can just create a template and then fill this template using MailMerge:
https://docs.aspose.com/words/net/types-of-mail-merge-operations/
Also, I wrote the following code to show you how to generate your document programmatically:

// Create document
Document doc = new Document();
// Set page orientation and margins for first section
doc.FirstSection.PageSetup.Orientation = Orientation.Landscape;
doc.FirstSection.PageSetup.RightMargin = 28.35;
doc.FirstSection.PageSetup.BottomMargin = 14.2;
doc.FirstSection.PageSetup.TopMargin = 14.2;
doc.FirstSection.PageSetup.LeftMargin = 28.35;
// Create DocumentBuilder
DocumentBuilder docBuilder = new DocumentBuilder(doc);
// Set default font name
docBuilder.Font.Name = "Arial";
// Create table
docBuilder.StartTable();
docBuilder.InsertCell();
docBuilder.Font.Bold = true;
docBuilder.Font.Size = 18;
docBuilder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
docBuilder.CellFormat.Width = 795.5;
docBuilder.Write("055.0");
docBuilder.EndRow();
docBuilder.RowFormat.Height = 226.8;
docBuilder.CellFormat.ClearFormatting();
docBuilder.InsertCell();
docBuilder.CellFormat.Width = 660.5;
docBuilder.InsertImage(@"Test089\img.jpg");
docBuilder.Font.ClearFormatting();
docBuilder.InsertCell();
docBuilder.CellFormat.Width = 135;
docBuilder.InsertParagraph();
docBuilder.StartTable();
docBuilder.RowFormat.ClearFormatting();
AddBorder(docBuilder);
docBuilder.Font.Bold = true;
docBuilder.Font.Size = 9;
docBuilder.InsertCell();
docBuilder.Write("Anzahl");
docBuilder.InsertCell();
docBuilder.Write("Art.-Nr.");
docBuilder.EndRow();
docBuilder.InsertCell();
docBuilder.Write("Number");
docBuilder.InsertCell();
docBuilder.Write("Part No.");
docBuilder.EndRow();
docBuilder.EndTable();
docBuilder.EndRow();
docBuilder.RowFormat.Height = 198.45;
docBuilder.InsertCell();
docBuilder.CellFormat.Width = 354.5;
docBuilder.InsertCell();
docBuilder.CellFormat.Width = 441;
docBuilder.InsertParagraph();
docBuilder.StartTable();
docBuilder.RowFormat.ClearFormatting();
AddBorder(docBuilder);
docBuilder.Font.Bold = true;
docBuilder.Font.Size = 9;
docBuilder.InsertCell();
docBuilder.Write("Anzahl");
docBuilder.InsertCell();
docBuilder.Write("Art.-Nr.");
docBuilder.EndRow();
docBuilder.InsertCell();
docBuilder.Write("Number");
docBuilder.InsertCell();
docBuilder.Write("Part No.");
docBuilder.EndRow();
docBuilder.EndTable();
docBuilder.EndRow();
docBuilder.EndTable();
doc.Save(@"Test089\out.doc");

Hope this helps.
Best regards,

Hi Andrey,
thanks a lot, this help me very much and I think that i will use a template with MailMerge to generate different documentformats for PDF,Word,OpenOffice…
See you …

The issues you have found earlier (filed as WORDSNET-1940) have been fixed in this .NET update and in this Java update.

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