Web generated ppt charts not showing

B

Brian Campbell

I have a .net web application which generates ppt
documents for users. Everything works except the charts
do not show up (ie slide titles, footer, textboxes are all
on the slide). I created a web form application and the
charts do show up. Can anyone give me some guidance on
how to get the web app to work properly?

Here is some sample code which works for the form app but
not the web app.

....
//Slide #2:
objSlide = objSlides.Add(2,
PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "Chart Test";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
objChart = (Graph.Chart) objSlide.Shapes.AddOLEObject
(150,150,480,320,"MSGraph.Chart", "",
MsoTriState.msoFalse, "", 0, "",
MsoTriState.msoFalse).OLEFormat.Object;

objChart.HasDataTable = true;
objChart.ChartType = Graph.XlChartType.xlXYScatterLines;
objChart.BarShape = Graph.XlBarShape.xlCylinder;
objDataSheet = objChart.Application.DataSheet;

objDataSheet.Cells.Clear();

objDataSheet.Cells[2,2] = 3;
objDataSheet.Cells[3,2] = 10;
objDataSheet.Cells[4,2] = 4;
objDataSheet.Cells[2,3] = 6;
objDataSheet.Cells[3,3] = 7;
objDataSheet.Cells[4,3] = 9;

objChart.HasLegend = true;
objChart.Application.Update();
objChart.HasTitle = true;
objChart.ChartTitle.Text = "The title";
....
objPres.SaveAs( directoryPath + "MicrosoftExample.ppt",
PowerPoint.PpSaveAsFileType.ppSaveAsPresentation,
Microsoft.Office.Core.MsoTriState.msoTrue );
 
A

Alvin Bruney [MVP]

this has caught my attention, i'll get to it tonight or tomorrow. i'll let
you know
 
A

Alvin Bruney [MVP]

let's eliminate the obvious first. can your web application create a chart
on its own?
do you have read permissions on the directory for the aspnet worker process?

i just realized that this is an msgraph chart. i know zip about that so i
won't be able to help u. i thought this was an owc chart. sorry
 
B

Brian Campbell

Yes I do have read permission. I never tried using owc
charts. I will check it out and let you know.

Thanks for the tip.

-----Original Message-----
let's eliminate the obvious first. can your web application create a chart
on its own?
do you have read permissions on the directory for the aspnet worker process?

i just realized that this is an msgraph chart. i know zip about that so i
won't be able to help u. i thought this was an owc chart. sorry

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I have a .net web application which generates ppt
documents for users. Everything works except the charts
do not show up (ie slide titles, footer, textboxes are all
on the slide). I created a web form application and the
charts do show up. Can anyone give me some guidance on
how to get the web app to work properly?

Here is some sample code which works for the form app but
not the web app.

...
//Slide #2:
objSlide = objSlides.Add(2,
PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "Chart Test";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
objChart = (Graph.Chart) objSlide.Shapes.AddOLEObject
(150,150,480,320,"MSGraph.Chart", "",
MsoTriState.msoFalse, "", 0, "",
MsoTriState.msoFalse).OLEFormat.Object;

objChart.HasDataTable = true;
objChart.ChartType = Graph.XlChartType.xlXYScatterLines;
objChart.BarShape = Graph.XlBarShape.xlCylinder;
objDataSheet = objChart.Application.DataSheet;

objDataSheet.Cells.Clear();

objDataSheet.Cells[2,2] = 3;
objDataSheet.Cells[3,2] = 10;
objDataSheet.Cells[4,2] = 4;
objDataSheet.Cells[2,3] = 6;
objDataSheet.Cells[3,3] = 7;
objDataSheet.Cells[4,3] = 9;

objChart.HasLegend = true;
objChart.Application.Update();
objChart.HasTitle = true;
objChart.ChartTitle.Text = "The title";
...
objPres.SaveAs( directoryPath + "MicrosoftExample.ppt",
PowerPoint.PpSaveAsFileType.ppSaveAsPresentation,
Microsoft.Office.Core.MsoTriState.msoTrue );


.
 
P

pargunan

Hi Alvin,

Can you explain me, how we can create PPT files on Web. Currently I
have installed OWC11, but there is no components for creating PPT file
as Mr.Brian explained in his sample code below.

Is there any more component to be installed. You earlier reply will
make me helpful.

Thanks in advance.

Regards,
Pargunan P
 
A

Alvin Bruney [MVP]

here's a link you can use
http://support.microsoft.com/default.aspx?scid=kb;EN-US;303717

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Hi Alvin,

Can you explain me, how we can create PPT files on Web. Currently I
have installed OWC11, but there is no components for creating PPT file
as Mr.Brian explained in his sample code below.

Is there any more component to be installed. You earlier reply will
make me helpful.

Thanks in advance.

Regards,
Pargunan P


Brian Campbell said:
I have a .net web application which generates ppt
documents for users. Everything works except the charts
do not show up (ie slide titles, footer, textboxes are all
on the slide). I created a web form application and the
charts do show up. Can anyone give me some guidance on
how to get the web app to work properly?

Here is some sample code which works for the form app but
not the web app.

...
//Slide #2:
objSlide = objSlides.Add(2,
PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "Chart Test";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
objChart = (Graph.Chart) objSlide.Shapes.AddOLEObject
(150,150,480,320,"MSGraph.Chart", "",
MsoTriState.msoFalse, "", 0, "",
MsoTriState.msoFalse).OLEFormat.Object;

objChart.HasDataTable = true;
objChart.ChartType = Graph.XlChartType.xlXYScatterLines;
objChart.BarShape = Graph.XlBarShape.xlCylinder;
objDataSheet = objChart.Application.DataSheet;

objDataSheet.Cells.Clear();

objDataSheet.Cells[2,2] = 3;
objDataSheet.Cells[3,2] = 10;
objDataSheet.Cells[4,2] = 4;
objDataSheet.Cells[2,3] = 6;
objDataSheet.Cells[3,3] = 7;
objDataSheet.Cells[4,3] = 9;

objChart.HasLegend = true;
objChart.Application.Update();
objChart.HasTitle = true;
objChart.ChartTitle.Text = "The title";
...
objPres.SaveAs( directoryPath + "MicrosoftExample.ppt",
PowerPoint.PpSaveAsFileType.ppSaveAsPresentation,
Microsoft.Office.Core.MsoTriState.msoTrue );
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top