Alexey, thank you for the reply. I will try to create an image of the excel sheet and have users double-click when they would like to edit.
Yes, we can export an HTML formatted .xls file to powerpoint. Powerpoint recognizes the formatting and does it's best to match text, background colors, font colors, lines, etc...If it's an Office product that isn't below 2K, it should be able to interpret the HTML. Otherwise, might have to go with the tab delimited formatting.
The problem here is that when I create an Oleobject in Aspose and pass the HTML formatted XL worksheet, and I double-click the "Object Changed" image, it gives me the generic error everyone gets ("cannot find file/other error/please reinstall server app"). However, when I create a brand new, UNFORMATTED excel worksheet and read it in Aspose, I can go ahead a see the excel worksheet. I mean it works when I do it without Aspose, but with your product, it seems it can't handle the extra HTML information included in the excel file. Can you help find a solution for this?
(I've actually went to the COM route of embedding an excel worksheet into powerpoint directly until I came across the Aspose.Slides product.)
1. This is how you can embed an html formatted excel object in powerpoint:
private void PPT()
{
String strTemplate, strPic;
strTemplate = "C:\\Program Files\\Microsoft Office\\Templates\\Presentation Designs\\Blends.pot";
PowerPoint.Application objApp;
PowerPoint.Presentations objPresSet;
PowerPoint._Presentation objPres;
PowerPoint.Slides objSlides;
PowerPoint._Slide objSlide;
PowerPoint.TextRange objTextRng;
PowerPoint.Shapes objShapes;
PowerPoint.Shape objShape;
PowerPoint.SlideShowWindows objSSWs;
PowerPoint.SlideShowTransition objSST;
PowerPoint.SlideShowSettings objSSS;
PowerPoint.SlideRange objSldRng;
Graph.Chart objChart;
//Create a new presentation based on a template.
objApp = new PowerPoint.Application();
objApp.Visible = MsoTriState.msoTrue;
objPresSet = objApp.Presentations;
objPres = objPresSet.Open(strTemplate,
MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
objSlides = objPres.Slides;
//Build Slide #1:
//Add text to the slide
objSlide = objSlides.Add(1,PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "My Sample Presentation";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
objSlide.Shapes.AddPicture(strPic, MsoTriState.msoFalse, MsoTriState.msoTrue, 150, 150, 500, 350);
//Datagrid(formatted with colors, etc) written to xls (formatting is passed through to XL):
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
this.ClearControls(dg);
dg.RenderControl(oHtmlTextWriter);
StreamWriter sw = new StreamWriter("c:\test.xls");
sw.Write(oStringWriter());
sw.Close();
//Insert formatted xls object into powerpoint.(Format is retained)
objSlide = objSlides.Add(2,PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
.
.
objSlide.Shapes.AddOleobject(w,x,y,z,"","c:\test.xls",msotrue, "",0,"", msofalse);
Can you explain if there is a way to view an excel worksheet in Aspose formatted from the datagrid?
How do I change the "Object Changed" graphic to display an image? Example?
Thanks,