Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.
Mon Jan 22, 2018 10:00 pm
I've created a powerpoint. For slide #6, all the data is not displayed until i click "Edit Data" I'm not sure why this is happening. NewTemplate.pptx is the template i'm using. Test.pptx is the presenation created. However, slide #6 isn't displaying all the data until i click on "Edit Data"
- Code: Select all
var sld = pres.Slides[5];
IAutoShape title = sld.Shapes[0] as IAutoShape;
title.TextFrame.Text = ddlSurvey.SelectedItem.Text;
IChart chart = pres.Slides[5].Shapes[1] as IChart;
int i = 1;
var lst = PowerpointHelper.GetCandidateScoreBySectionAndClusterPP((int)PSD.Data.Linq.GrowthLineEnums.Section.Leadership, this.SurveyID, Convert.ToInt32(SessionManager.SurveyBatchID));
var lstCandidates = lst.OrderBy(x=>x.CandidateLastName).Select(x => x.CandidateLastName).Distinct().ToList();
int totalCandidates = lstCandidates.Count();
string lx = letters[totalCandidates];
var grps = lst.GroupBy(x => x.SectionClusterName);
chart.Series.SeriesLabel = chart.ChartData["B1", lx + "1"];
for (int c = 1; c <= totalCandidates; c++)
{
chart.ChartData[0, c].Text = lstCandidates[c - 1].ToString();
string x1 = letters[c];
chart.Series[c - 1].Values = chart.ChartData[x1 + "2", x1 + (grps.Count()+1).ToString()];
}
int cnt = 1;
foreach (var grp in grps)
{
i = 1;
chart.ChartData[cnt, 0].Value = grp.FirstOrDefault().SectionClusterName;
foreach (var itm in grp)
{
if (itm.CandidateLastName == chart.ChartData[0, i].Text)
chart.ChartData[cnt, i].Value = Convert.ToDecimal(itm.Pct);
i++;
}
cnt++;
}
chart.Categories.CategoryLabels = chart.ChartData["A2", "A" + (grps.Count()+1).ToString()];
Login to view the files attached to this post.
-
ghoff12
-
- Posts: 11
- Joined: Wed Dec 20, 2017 7:12 pm
Mon Jan 22, 2018 10:27 pm
I figured out the issue. This can be closed
-
ghoff12
-
- Posts: 11
- Joined: Wed Dec 20, 2017 7:12 pm
Tue Jan 23, 2018 1:36 am
Hello,
Thanks for your feedback. If there is any other query, please write it back to us.
Best regards,
Simon
E-iceblue support team
-
Simon.yang
-
- Posts: 620
- Joined: Wed Jan 11, 2017 2:03 am