What's wrong with this code ? it doesn't work I obtain only a red simple table, and I want a table with alternate color for each row.... can you please tell me what's wrong with this code ? it becomes urgent....
private void Button3_Click(object sender, System.EventArgs e)
{
System.IO.FileStream fis = new System.IO.FileStream(MapPath(".") + "\\result.ppt", System.IO.FileMode.Open, System.IO.FileAccess.Read);
Presentation pres = new Presentation(fis);
fis.Close();
Slide slide = pres.GetSlideByPosition(1);
Aspose.Slides.Table t = slide.Shapes.AddTable(0, 0, 1000, 1000, 3, 5, 2.0, Color.Red);
// color switcher to alternate the backcolor
bool colorSwitch =false;
// Add 3 new rows to the table to test the color switcher
t.AddRow();
t.AddRow();
t.AddRow();
// Delete last added row
//t.DeleteRow(t.RowsNumber - 1);
// Replace text in the cells
for (int ii = 0; ii < t.ColumnsNumber; ii++)
{
// Skip first row because it's a header
for (int jj = 1; jj < t.RowsNumber; jj++)
{
//setting the background color of the current cell
Aspose.Slides.Cell cell = null;
cell = t.GetCell(ii, jj);
if (cell != null)
{
if (colorSwitch)
{
cell.FillFormat.Type = FillType.Solid;
cell.FillFormat.BackColor = System.Drawing.Color.FromArgb(234,234,234);
}
else
{
cell.FillFormat.Type = FillType.Solid;
cell.FillFormat.BackColor = System.Drawing.Color.White ;
}
colorSwitch = !colorSwitch; //switch the color for the next row
}
}//rows
}//cols
this.Response.ContentType = "application/vnd.ms-powerpoint";
this.Response.AppendHeader("Content-Disposition", "attachment; filename=result.ppt");
this.Response.Flush();
System.IO.Stream st = this.Response.OutputStream;
//
// Write the file
//
pres.Write(st);
this.Response.End();
}