Aspose.slides Table. My cell text is very long. I unfortunately can not get it to wrap. Please help!
Aspose.Slides.Presentation presentation = new Aspose.Slides.Presentation();
Slide slide = presentation.Slides[0];
ArrayList header = new ArrayList();
header.Add(new Element("h1", String.Format(CultureInfo.CurrentCulture, SiteMap.CurrentNode.Title)));
SlideGenerator.DrawList(slide, header, 700, 50, 4200, 550);
using (TimeComplianceTechnicalOrderCollection timeComplianceTechnicalOrderCollection = new TimeComplianceTechnicalOrderCollection())
{
DataTable data = new DataTable();
if (ChartType.Equals("R"))
{
data = timeComplianceTechnicalOrderCollection.GetActiveTCTOsHoldByRescind(ChartEndDate.Date);
}
else
{
data = timeComplianceTechnicalOrderCollection.GetActiveTCTOsHoldByCompliance(ChartEndDate.Date);
}
if (data != null)
{
Table table = slide.Shapes.AddTable(625, 375,2000, 550, 9, 11,1, Color.Black);
for (int i = 0; i < 11;i ++)
{
table.SetRowHeight(i, 50);
}
for (int i = 0; i < 9; i++)
{
table.SetColumnWidth(i, 500);
}
table.SetCellText(0, 1, string.Empty, 8, false);
table.SetCellText(1, 1, "TCTO Number", 8, false);
if (ChartType.Equals("R"))
{
table.SetCellText(2, 1, "TCTO TITLE SAFETY TCTOs", 8, false);
}
else
{
table.SetCellText(2, 1, "TCTO TITLES", 8, false);
}
table.SetCellText(3, 1, "Issue Date", 8, false);
table.SetCellText(4, 1, "Compliance Period", 8, false);
table.SetCellText(5,1, "Rescind Time", 8, false);
table.SetCellText(6, 1, "TCTO Type", 8, false);
table.SetCellText(7, 1, "Previous % Complete", 8, false);
table.SetCellText(8,1, "Current % Complete", 8, false);
for (int c = 0; c < 9; c++)
{
for (int r = 2; r < 11; r++)
{
if (data.Rows[r-2].Field<string>(c) != null)
{
string text = data.Rows[r].Field<string>(c);
if (text != null)
{
Cell cell = table.GetCell(c, r);
cell.TextFrame.WrapText = true;
cell.TextFrame.FitTextToShape();
table.SetCellText(c, r, text, 8, false);
}
}
}
}
}
}
// Use OutputFileName if set. If not, use OutputFileNameFormatString.
// If Title is set, use that too.
string exportFileName = string.Format("{0}.{1}", SiteMap.CurrentNode.Title, "ppt");
this.Page.Response.ContentType = "application/vnd.ms-powerpoint";
this.Page.Response.AppendHeader("content-disposition", string.Format("attachment;filename={0}", exportFileName));
System.IO.Stream output = this.Response.OutputStream;
presentation.Write(output);
this.Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);
this.Page.Response.End();