PPT Chart Shows Redundant Categories

Hi,
We are trying to create a PowerPoint (.pptx) export using a workbook by using the following code. But in the PowerPoint slide the chart shows redundant categories up to which the data source template of the chart selected previously. We had hidden the redundant columns from the code. But still the redundant categories/columns upto which the data source of chart are selected, are shown.

The code has given below-

var pptx = new PresentationEx("..\\..\\Template\\Template.pptx");
ShapeEx shape = pptx.GetShape("ChartHolder");
ChartEx chart = (ChartEx)shape;

int prevSeries = chart.ChartData.Series.Count;
int prevCat = chart.ChartData.Categories.Count;

Workbook wb = new Workbook(chart.ChartData.ReadWorkbookStream());
wb.Worksheets[0].Cells[0, 0].PutValue("");
wb.Worksheets[0].Cells[0, 1].PutValue("Series1");
wb.Worksheets[0].Cells[0, 2].PutValue("Series2");
wb.Worksheets[0].Cells[0, 3].PutValue("Series3");

wb.Worksheets[0].Cells[1, 0].PutValue("Category1");
wb.Worksheets[0].Cells[1, 1].PutValue(2);
wb.Worksheets[0].Cells[1, 2].PutValue(6);
wb.Worksheets[0].Cells[1, 3].PutValue(0);

wb.Worksheets[0].Cells[2, 0].PutValue("Category2");
wb.Worksheets[0].Cells[2, 1].PutValue(6);
wb.Worksheets[0].Cells[2, 2].PutValue(2);
wb.Worksheets[0].Cells[2, 3].PutValue(6);

wb.Worksheets[0].Cells[3, 0].PutValue("Category3");
wb.Worksheets[0].Cells[3, 1].PutValue(6);
wb.Worksheets[0].Cells[3, 2].PutValue(8);
wb.Worksheets[0].Cells[3, 3].PutValue(3);

wb.Worksheets[0].Cells[4, 0].PutValue("Category4");
wb.Worksheets[0].Cells[4, 1].PutValue(7);
wb.Worksheets[0].Cells[4, 2].PutValue(-8);
wb.Worksheets[0].Cells[4, 3].PutValue(-5);

wb.Worksheets[0].Cells[5, 0].PutValue("Category5");
wb.Worksheets[0].Cells[5, 1].PutValue(3);
wb.Worksheets[0].Cells[5, 2].PutValue(4);
wb.Worksheets[0].Cells[5, 3].PutValue(15);

if (prevCat >= 3)
{
for (int i = prevCat; i >= 3; i--)
wb.Worksheets[0].Cells.HideColumn(i); // Hide the extra columns
}

MemoryStream ms2 = new MemoryStream();
wb.Save(ms2, SaveFormat.Xlsx);

wb.Save("D:\\ExportedNew.xlsx", SaveFormat.Xlsx);
ms2.Position = 0;
chart.ChartData.WriteWorkbookStream(ms2);

if (prevSeries >= 5)
{
for (int i = prevSeries; i >= 5; i--)
chart.ChartData.Series.RemoveAt(4); //Delete the extra row
}
chart.PlotVisibleCellsOnly = true;

pptx.Save("D:\\ExportedNew.pptx", Aspose.Slides.Export.SaveFormat.Pptx);

If we select the chart object and right click and select "edit data" then it shows in the correct format i.e. with exact category number shows in the chart.

The template(Template.pptx) we used, real output file(OutputWithError.pptx) and the output should be like file(OutputShdBe) are attached with this post.

Need help and feedback urgently regarding this...Thanks!

Hi Mandy,

Thank you for sharing the sample code and template file.

I am able to reproduce your mentioned issue with the latest version of Aspose.Slides for .NET. An issue has been registered in our issue tracking system with issue id: SLIDESNET-35592. You will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,

Hi,

Is there any update on this issue? We have been stuck on a stage for this issue for a long time. Eagerly waiting for response regarding this issue. Thanks.

Hi Mandy,

Your issue is reported very recently and is pending for investigation. Once the issue gets investigated, we will be able to share an ETA regarding your issue.

Thanks & Regards,

Hi,

Is there any update regarding this issue? It would be immensely helpful if we hear something positive. Eagerly waiting for a reply. Thanks.

Hi Mandy,

I am afraid, your reported issue is still pending for investigation on the development team’s end. Once they share any update, I will share with you via this forum thread.

Thanks & Regards,

Hi,

Eagerly looking forward to hearing from you. We are requesting to investigate this issue with some priorities as we are holding for this issue for a long time. Thanks.

Hi Mandy,

I have verified from our issue tracking system and like to share that the issue has already been added with High priority which is maximum priority level for normal support forums. Our development team will schedule and investigate the issue on their end on its due turn. I also suggest you to please try considering our paid enterprise or priority support options for expedite investigation and resolution of the issue. Please visit this documentation link for available support services options.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-35592) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.