Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Aspose PDF (Aspose.Pdf.Document) : How do set width for cells ? I need to set different width for each cell.

$
0
0
Aspose PDF (Aspose.Pdf.Document) : How do set width for cells ? I need to set different width for each cell.

                                //Instantiate a table object

                               Table tabRprtData = newTable();

                               tabRprtData.DefaultCellTextState = RegularTextFont();

 

                               //Create MarginInfo object and set its left, bottom, right and top margins

                               Aspose.Pdf.MarginInfo margin = new Aspose.Pdf.MarginInfo();

                               margin.Top = 5f;

                               margin.Left = 5f;

                               margin.Right = 5f;

                               margin.Bottom = 5f;

 

                               tabRprtData.DefaultCellPadding = margin;

                               //Set default cell border using BorderInfo object                               

                               tabRprtData.Border = newBorderInfo(BorderSide.All, 0.1F);

 

                               //Set default cell border using BorderInfo object

                               tabRprtData.DefaultCellBorder = newBorderInfo(BorderSide.All, 0.1F);

 

                               //CREATE ROW

                               Row currentRow;

                               currentRow = tabRprtData.Rows.Add();

                               // HtmlTableCell tc;

                               Cell tc;

 

                               tc = currentRow.Cells.Add(" ");

                               tc.IsWordWrapped = true;

                              

                               tc = currentRow.Cells.Add("Distribution of Scores");

                               tc.ColSpan = 9;

                               tc = currentRow.Cells.Add("Total Institution");

                               tc.ColSpan = 3;

                               tc = currentRow.Cells.Add("Total Test Population");

                               tc.ColSpan = 3;

 

                               foreach (var itm in item.GenTestVReasonQReason)

                               {

                                   currentRow = tabRprtData.Rows.Add();

                                   tc = currentRow.Cells.Add(itm.TestType);

                                   tc = currentRow.Cells.Add(itm.ScoreRange1);

                                   tc.IsWordWrapped = true;

                                   tc = currentRow.Cells.Add(itm.ScoreRange2);

                                   tc.IsWordWrapped = true;

                                   tc = currentRow.Cells.Add(itm.ScoreRange3);

                                   tc.IsWordWrapped = true;

                                   tc = currentRow.Cells.Add(itm.ScoreRange4);

                                   tc = currentRow.Cells.Add(itm.ScoreRange5);

                                   tc = currentRow.Cells.Add(itm.ScoreRange6);

                                   tc = currentRow.Cells.Add(itm.ScoreRange7);

                                   tc = currentRow.Cells.Add(itm.ScoreRange8);

                                   tc = currentRow.Cells.Add(itm.ScoreRange9);

                                   tc = currentRow.Cells.Add(itm.TotalInst);

                                   tc = currentRow.Cells.Add(itm.MeanInst);

                                   tc = currentRow.Cells.Add(itm.SDInst);

                                   tc = currentRow.Cells.Add(itm.TotalAllTestPop);

                                   tc = currentRow.Cells.Add(itm.MeanAllTestPop);

                                   tc = currentRow.Cells.Add(itm.SDAllTestPop);                               

                               }

 

                               paragraphs.Add(tabRprtData);


Viewing all articles
Browse latest Browse all 3131

Latest Images

Trending Articles



Latest Images