We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Latest version problem

Hi Team,Today I have updated the latest version of aspose.slide dll in my code.Now the problem is that my older code to generate ppt stopped working and giving error.Why this is happening.

For Example the below code was working in older version but not working in latest version.

so will latest version will require redevelopment of existing things?

int Table2_Position = table1.Y + table1.Height + 50;

//Adding a new table to the slide using specified table parameters

Aspose.Slides.

Table table2 = slide.Shapes.AddTable(80, Table2_Position, TableWidth, 10, 3, 2, 1, Color.FromArgb(191, 191, 191));

int Table2_Position = table1.Y + table1.Height + 50;

//Adding a new table to the slide using specified table parameters

Aspose.Slides.

Table table2 = slide.Shapes.AddTable(80, Table2_Position, TableWidth, 10, 3, 2, 1, Color.FromArgb(191, 191, 191));

Hi Gopal,

I have observed the requirements shared by you and like to share that in new API one need to modify the code if he is using PPT table. Please visit this documentation link for your kind reference in this regard. Please share, if I may help you further in this regard.

Many Thanks,

not only table it is giving error in each line ie textfram,css in textframe,way to render ppt to client browser,adding shapes line rectangle.

so will it require re-development of whole existing code?

Please reply ASAP.

Aspose.Slides.Rectangle rectangle1 = slide.Shapes.AddRectangle(75, 5, TableWidth, 200);

// string ProjStatus = "Project Status:";

// ProjStatus += " " + ProjectName;

// rectangle1.LineFormat.ShowLines = false;

// rectangle1.AddTextFrame(ProjStatus);

// rectangle1.TextFrame.Paragraphs[0].Portions[0].FontBold = true;

// rectangle1.TextFrame.Paragraphs[0].Portions[0].FontItalic = true;

// rectangle1.TextFrame.MarginLeft = 0;

v

Hi Gopal,


I am sorry for your inconvenience. Please share the sample application with us along with desired output or share the sample application based on old API and I will investigate that and port that w.r.t new API.

Many Thanks,

I have attached .aspx and .aspx.cs file which generates ppt based on old API version 2.0.

I have also attached the all ppt templates designed by this code.

Please reply ASAP on future course of action as I am waiting on this.

Hi Gopal,


I am sorry for your inconvenience. I am working over your requirements and will share my feedback shortly for this.

Many Thanks,

Hi Gopal,


I have observed the project code shared by you and unfortunately it is not possible to develop the understanding of that as there are many custom things involved in it. However, I have understood the basis requirement of creating the table w.r.t to new API. As shared earlier that in new API the legacy code of old API for PPT will not work. You need to use the sample code w.r.t to new API. Please use the following sample code for your kind reference in this regard and develop an understanding. I hope you can easily port the things w.r.t to this.

public static void addTables()
{
Presentation pres = new Presentation();

ISlide slide=pres.Slides [0];
//The default slide size has width 720 and height 540
float xPos=100;
float yPos=50;

//Now defining rows and columns where the values in arrays define the height and width respectively
//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
ITable table1 = slide.Shapes.AddTable(xPos, yPos, dblCols, dblRows);

//Set border format for each cell
foreach (IRow row in table1.Rows)
foreach (ICell cell in row)
{
cell.BorderTop.FillFormat.FillType = FillType.Solid;
cell.BorderTop.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderTop.Width = 5;

cell.BorderBottom.FillFormat.FillType = FillType.Solid;
cell.BorderBottom.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderBottom.Width = 5;

cell.BorderLeft.FillFormat.FillType = FillType.Solid;
cell.BorderLeft.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderLeft.Width = 5;

cell.BorderRight.FillFormat.FillType = FillType.Solid;
cell.BorderRight.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderRight.Width = 5;
}
//*Table2 ****************************************Start
float Table2_Position = table1.Y + table1.Height + 50;
//Adding a new table to the slide using specified table parameters

double[] dblCols2 = { 30, 60, 90 };
double[] dblRows2 = { 40, 20, 50, 20, 60 };

//Add table shape to slide
ITable table2 = slide.Shapes.AddTable(xPos, Table2_Position, dblCols2, dblRows2);

//Set border format for each cell
foreach (IRow row in table2.Rows)
foreach (ICell cell in row)
{
cell.BorderTop.FillFormat.FillType = FillType.Solid;
cell.BorderTop.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderTop.Width = 5;

cell.BorderBottom.FillFormat.FillType = FillType.Solid;
cell.BorderBottom.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderBottom.Width = 5;

cell.BorderLeft.FillFormat.FillType = FillType.Solid;
cell.BorderLeft.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderLeft.Width = 5;

cell.BorderRight.FillFormat.FillType = FillType.Solid;
cell.BorderRight.FillFormat.SolidFillColor.Color = Color.FromArgb(191, 191, 191);
cell.BorderRight.Width = 5;
}
// Aspose.Slides.Table table2 = slide.Shapes.AddTable(80, Table2_Position, TableWidth, 10, 3, 2, 1, Color.FromArgb(191, 191, 191));
//columns, rows, borderWidth, Color.Black);

pres.Save(“C:\Presentations\TestTable.ppt”, SaveFormat.Ppt);

}

Also, in new API there are no direct method for adding Rectangle or Ellipse shapes. All these shapes are Autoshapes and that have types Rectangle, Ellipse or others. Please visit this documentation link for your kind reference in this regard.

I hope the shared information will be helpful. Please share, if I may help you further in this regard.

Many Thanks,