Hi Team,
I want to impliment a class which will export the data to powerpint ,to achieve this i want to use Aspose.we struck with below problem and not able to proceed furthur.Please provide solution .
i want to export data to powerpoint template having editable chart for that i wrote the below code.
I have a problem of messege "Object changed" after exporting,for removing this messge i added image to my object.But i don't want this method ,please suggest if any other method is aviable to remove the messege.
The below code(using spreadsheet) is supporting for Office 2007 ,it is not supporting office 2003.please provide solution in office 2003.
void AddMSGraphObject()
{
//Create powerpoint file and find the
Aspose.Slides.Presentation srcPres = new Aspose.Slides.Presentation();
srcPres = new Aspose.Slides.Presentation(Server.MapPath("PPTTemplates/Template.ppt"));
Slide fstSlide = srcPres.GetSlideByPosition(1);
Aspose.Slides.Shape srcShape = fstSlide.FindShape("Chart");
OleObjectFrame msGrphObj = srcShape as OleObjectFrame;
byte[] xlsData = msGrphObj.ObjectData;
MemoryStream memst = new MemoryStream(xlsData, true);
System.Data.DataTable dt = GetData();
WorkbookDesigner wbd = new WorkbookDesigner();
wbd.Open(memst);
wbd.SetDataSource(dt.DefaultView.ToTable(true, "Region", "Spend"));
Workbook wb = wbd.Workbook;
msGrphObj.ObjectData = wb.SaveToStream().ToArray();
Aspose.Cells.Chart objChart = wb.Worksheets[0].Charts[0];
string tempPath = Path.GetTempFileName();
objChart.ToImage(tempPath, System.Drawing.Imaging.ImageFormat.Png);
Aspose.Slides.Picture pic = new Aspose.Slides.Picture(srcPres, tempPath);
int picid = srcPres.Pictures.Add(pic);
msGrphObj.PictureId = picid;
Response.Clear();
Response.ContentType = "application/vnd.ms-powerpoint";
Response.AppendHeader("Content-Disposition", "attachment; filename=Account monthly Sales.ppt");
srcPres.Write(Response.OutputStream);
Response.Flush();
Response.End();
}
Thanks & Regards
Kumar Reddy