How to set location for builder.StartTable()

Hi,

I am trying to show a Table in center of the page using
Aspose.Word (9.1.0.0) in word document. Can you please help me how to
set the location for a table.

Thanks & Regards,
Kalyan D

Hi Gautham,
Thanks for your inquiry. I suggest you please read following documentation link for your kind reference.
https://docs.aspose.com/words/net/document-builder-overview/
https://docs.aspose.com/words/net/navigation-with-cursor/
Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.

Hi Tahir,

Thanks for your replay. Please find the attached sample file (sampleFile.docx) we need to generate report in this format.

Issue 2:-
Using Aspose.words Dll we need to generate the report in two formats word and PDF.
I am facing the issue is PDF generation. In word document header section is showing properly but in pdf, header information is not showing properly. please find the attached RPT1.doc and RPT1.pdf.

Please suggest me how to proceed.

Thanks,
Kalyan D.

Hi Kalyan,

Thanks for your inquiry.
gtheegala:

Please find the attached sample file (sampleFile.docx) we need to generate report in this format.

Please use Table.Alignment property to specify how an inline table is aligned in the document. Use Table.Alignment as TableAlignment.Center. Please check the highlighted code below.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Table table = builder.StartTable();
// Insert a cell
builder.InsertCell();
// Use fixed column widths.
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
builder.Write("This is row 1 cell 1");
// Insert a cell
builder.InsertCell();
builder.Write("This is row 1 cell 2");
builder.EndRow();
// Insert a cell
builder.InsertCell();
// Apply new row formatting
builder.RowFormat.Height = 100;
builder.RowFormat.HeightRule = HeightRule.Exactly;
builder.CellFormat.Orientation = TextOrientation.Upward;
builder.Writeln("This is row 2 cell 1");
// Insert a cell
builder.InsertCell();
builder.CellFormat.Orientation = TextOrientation.Downward;
builder.Writeln("This is row 2 cell 2");
builder.EndRow();
builder.EndTable();
table.Alignment = TableAlignment.Center;
doc.Save(MyDir + "Out.docx");

gtheegala:

Using Aspose.words Dll we need to generate the report in two formats word and PDF.
I am facing the issue is PDF generation. In word document header section is showing properly but in pdf, header information is not showing properly. please find the attached RPT1.doc and RPT1.pdf.

I have converted the shared document to Pdf and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10351. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,

Thanks for your replay.

Thanks,
Kalyan D.

Hi Tahir,

The PDF generation problem was resolved?

“I have converted the shared document to Pdf
and have managed to reproduce the same issue at my side. For the sake of
correction, I have logged this problem in our issue tracking system as
WORDSNET-10351. I have linked this forum thread to the same issue and
you will be notified via this forum thread once this issue is resolved.”

Please let us know.

Thanks,
Kalyan D.

Hi Kalyan,

Thanks for your inquiry. I regret to share with you that your issue (WORDSNET-10351) has been postponed due to missing feature WORDSNET-832 (Make table layout as close to Word as possible) which is related to your issue.

After
the fix of WORDSNET-832, our development team will look into your
issue. I will be sure to inform you via this forum thread as soon as
this feature is available.

We apologize for your inconvenience.

@gtheegala,
Thanks for your patience. This issue has been resolved in latest version of Aspose.Words for .NET 18.4. Please use Aspose.Words for .NET 18.4.

The issues you have found earlier (filed as WORDSNET-10351) have been fixed in this Aspose.Words for .NET 18.5 update and this Aspose.Words for Java 18.5 update.