This is a migrated thread and some comments may be shown as answers.
Can not align a table
3 Answers 19 Views
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 09 Mar 2020, 02:47 PM

Hello,

I have a problem. I want to create a table which should be right-aligned.

But when I try to set table.Alignment to Right It does not work.

I export this document into PDF.

 

Here is a sample code and the result screenshot.

 

1.RadFlowDocument document = new RadFlowDocument();
2.Table table = document.Sections.First().Blocks.AddTable();
3.table.Alignment = Alignment.Right;
4.TableRow row = table.Rows.AddTableRow();
5.TableCell cell = row.Cells.AddTableCell();
6.cell.Blocks.AddParagraph().Inlines.AddRun("sample text");

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 10 Mar 2020, 01:28 PM

Hi Daniel,

I am sorry to hear you are experiencing issues because of a missing functionality. Currently, the WordsProcessing library doesn't support the export of the table alignment (different from Left) when exporting to PDF. We have this feature request logged in our backlog: WordsProcessing: Support for Table.Alignment when exporting to PDF. You can cast you vote for the implementation as well as to subscribe to the task by clicking the Follow button to receive updates about status changes.

Regards,
Martin
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Daniel
Top achievements
Rank 1
answered on 22 Jun 2020, 12:24 PM

Hi Martin,

thank you for your answer.

Furthermore, I would like to ask you if there is a way to set TextDirection to right in the table cell while exporting to pdf.

I need numbers to be right aligned.

I will appreciate even if you advise me some hack to do that.

0
Martin
Telerik team
answered on 23 Jun 2020, 07:23 AM

Hi Daniel,

The right (or central) alignment of a table is related to a specific layout which should be calculated while drawing the content in the PDF document. I am afraid I cannot suggest an alternative which will allow you to achieve this in the current implementation. I am sorry I couldn't help more.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Asked by
Daniel
Top achievements
Rank 1
Answers by
Martin
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or