Click here to Skip to main content
15,913,944 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
Can anyone suggest me how to make multiple dynamic pie chart in powerpoint in asp.net C#?


What I have tried:

Can anyone suggest me how to make multiple dynamic pie chart in powerpoint in asp.net C#?
Posted
Updated 17-Jun-16 21:24pm
Comments
Anand Saini 18-Jun-16 2:39am    
i tried something like this but it show this error on line

" objApp = new Microsoft.Office.Interop.PowerPoint.Application();"


"Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

bool bAssistantOn;
Microsoft.Office.Interop.PowerPoint.Application objApp;
Presentations objPresSet;
_Presentation objPres;
Slides objSlides;
_Slide objSlide;
TextRange objTextRng;
Microsoft.Office.Interop.PowerPoint.Shapes objShapes;
Microsoft.Office.Interop.PowerPoint.Shape objShape;
SlideShowWindows objSSWs;
SlideShowTransition objSST;
SlideShowSettings objSSS;
SlideRange objSldRng;
Microsoft.Office.Interop.Graph.Chart objChart;
Microsoft.Office.Interop.Graph.DataSheet dataSheet;

//Create a new presentation based on a template.
objApp = new Microsoft.Office.Interop.PowerPoint.Application();
objApp.Visible = MsoTriState.msoTrue;
objPresSet = objApp.Presentations;
objPres = objPresSet.Open(@"D:\xyz\Template.potx", MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
//.potx file is the template file of powerpoint.
//Take a template file remove all it's slides and save it.
//Then give it's physical path instead of it.
objSlides = objPres.Slides;
Richard MacCutchan 18-Jun-16 3:36am    
The message tells you that Powerpoint is not installed. And you cannot use the interop without it. I guess the bottom line suggestion is, do not copy code from the internet unless you understand how it works.

1 solution

What you are trying to do makes no sense at all. You are trying to use Office interop, which means that PowerPoint should work on the server side. And who will watch the presentation there, on the Web factory? :-)

There are less obvious reasons why Interop is not suitable for ASP.NET; this is how Microsoft explained it: http://support.microsoft.com/kb/257757/en-us.

What to do? It's not so difficult to develop some basic presentation software based on Web, or even the Web browser along, with presentation data supplied on the client side directly, or on the server side. This is so because the HTTP + CSS rendering, with dynamic modification of content using JavaScript is already a kind of presentation, and, by its nature, a lot more flexible and robust than PowerPoint, and also cross-platform. But if some ridiculous business setting require the use of PowerPoint files, you would need to upload them on the server side, where you can use .NET to parse the files, using Microsoft Open XML format API and use the data to compose corresponding HTML + CSS + JavaScript content which would show the presentation in browser. This aspect of possibly required compatibility with PowerPoint files might be needed, but it will make the work a lot more complicated and limited in functionality.

I'm not familiar with any products like that (by a simple reason: I never need PowerPoint for my presentations — why? :-)), but perhaps you can do your search and find something suitable to your purpose.

—SA
 
Share this answer
 
Comments
Anand Saini 18-Jun-16 3:32am    
i am new to use that, that's why i don't know how to do that all
i just used that codes from google search and just use it.
Sergey Alexandrovich Kryukov 18-Jun-16 4:02am    
You need to understand one simple thing: programming is not done via Google search. The search is always helpful but never gives you a solution. If you write code, you always have to create some value, otherwise some available products would be used, without any help of a software engineer.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900