Hi Aspose
As my requirement i have to create tables in slide with dynamic no. of rows and columns which depends on my datatable. This thing was easy in doing with Power Point 2003 but in Power Point 2007 i am not getting the way to achieve my requirement.
Through the below example code which is in your Demo, i am not able to achieve my requirement
//Instantiate PresentationEx class that represents PPTX file
PresentationEx pres = new PresentationEx();
//Access first slide
SlideEx sld = pres.Slides[0];
//Define columns with widths and rows with heights
double[] dblCols = { 50,50,50 };
double[] dblRows = { 50,30,30,30,30 };
//Add table shape to slide
int idx = sld.Shapes.AddTable(100, 50, dblCols, dblRows);
TableEx tbl = (TableEx)sld.Shapes[idx];
//Set border format for each cell
foreach( RowEx row in tbl.Rows )
foreach (CellEx cell in row)
{
cell.BorderTop.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderTop.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderTop.Width = 5;
cell.BorderBottom.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderBottom.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderBottom.Width = 5;
cell.BorderLeft.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderLeft.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderLeft.Width = 5;
cell.BorderRight.FillFormat.FillType = FillTypeEx.Solid;
cell.BorderRight.FillFormat.SolidFillColor.Color = Color.Red;
cell.BorderRight.Width = 5;
}
Beacause while creating table i can not specify no. of rows/columns as it is dynamic in my case.
Please suggest me how to do it ASAP.
Thanks a lot.
Waiting for your reply.