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.

Fri Mar 03, 2023 3:55 pm

I have an existing chart which I want to populate with new data. However, this chart has a cell which is referencing a cell which the chart is using.

Chart ref.png


When I populate this chart using spire, the chart updates fine but when you click on 'edit data' it shows an error message.

Linked file.png


Here is my pptx with the chart

slides_as_template ref ex.zip

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Mon Mar 06, 2023 6:08 am

Hi,

Thanks for your feedback.
After testing, I reproduced your issue and logged it into our issue tracking system with the ticket number SPIREPPT-2205, our developers will investigate and fix it, sorry for the inconvenience caused. Once the issue is fixed, I will inform you asap.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Apr 03, 2023 1:27 am

Hi,

Thanks for your patience.
We just released Spire.Presentation 8.3.2 hotfix, which fixed your issue SPIREPPT-2205, please download from the following links and have a test.
Website link:https://www.e-iceblue.com/Download/download-presentation-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.Presentation/8.3.2

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Apr 17, 2023 3:24 pm

We've upgraded to 8.3.2 but the problem still persists, can you confirm if the problem is resolved for you?

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Tue Apr 18, 2023 2:32 am

Hi,

Thanks for your feedback.
I have tested both 8.3.2 and 8.4.1, but this issue did not recur. To further investigate and diagnose the problem, could you please provide us with the testing code that you used?
Thank you for your cooperation in this matter. Please let us know if you have any further concerns or questions.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Tue Apr 18, 2023 6:03 pm

Would you mind sharing your code for us to test please? and the pptx files.

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Wed Apr 19, 2023 7:44 am

Hi,

Thanks for your feedback.
Apologize for any inconvenience this issue may have caused. I have attached my test code and result documents for your reference.
Code: Select all
            Presentation ppt = new Presentation();
            ppt.LoadFromFile(@"slides_as_template ref ex.pptx");
            IChart Chart = ppt.Slides[1].Shapes[0] as IChart;
            Chart.ChartData[0, 1].Text = "chart";
            Chart.ChartData[0, 2].Text = "table";
            Chart.ChartData[0, 3].Text = "picure";
            Chart.ChartData[0, 4].Text = "textbox";
            Chart.ChartData[1, 0].Text = "jan";
            Chart.ChartData[2, 0].Text = "feb";
            Chart.ChartData[3, 0].Text = "mar";
            Chart.ChartData[4, 0].Text = "april";
            for (int i = 1; i <= 3; i++)
            {
                for (int j = 1; j <= 3; j++)
                {
                    Chart.ChartData[j, i].Value = i;
                }
            }
            ppt.SaveToFile(@"version832test.pptx", FileFormat.Pptx2013);

There may be some differences between your and my code, if the issue still persists in your side, please share us with your test code, thanks for your assistance.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed Apr 19, 2023 2:53 pm

2 comments/errors:

1. The error only appears IF you have less columns than what was originally in the chart. If the chart originally had 4 columns but you update it with 2 columns then the error appears.

2. If you have the same number of columns or more then the error does not appear HOWEVER the cell reference in the external calcuations fail. They show `=#REF!`

boosted_d16
 
Posts: 34
Joined: Wed Apr 19, 2023 11:41 am

Thu Apr 20, 2023 6:46 am

Hi,

Thanks for your feedback.
We apologize for any inconvenience this may have caused and would like to resolve the issue as soon as possible.
In order to better understand and reproduce the problem, we kindly request that you provide us with the testing code and document used to replicate the issue. This will enable us to identify and address the issue more accurately. You can send them to us via email(support@e-iceblue.com) or attach them here.
Our team will thoroughly investigate the provided information and work towards a solution promptly.
Thank you for your cooperation in helping us resolve this matter. Please let us know if you have any further questions or concerns.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Apr 20, 2023 11:21 am

To test the 2 issues Ive outlined above, please do this:

1. use the pptx template attached at the top of this thread - slides_as_template ref ex.pptx
2. now run the code below: 2 columns x 4 rows. Now check the pptx and share the output here so we can check

Code: Select all
            Presentation ppt = new Presentation();
            ppt.LoadFromFile(@"slides_as_template ref ex.pptx");
            IChart Chart = ppt.Slides[1].Shapes[0] as IChart;
            Chart.ChartData[0, 1].Text = "chart";
            Chart.ChartData[0, 2].Text = "table";
            Chart.ChartData[1, 0].Text = "jan";
            Chart.ChartData[2, 0].Text = "feb";
            Chart.ChartData[3, 0].Text = "mar";
            Chart.ChartData[4, 0].Text = "april";
            for (int i = 1; i <= 2; i++)
            {
                for (int j = 1; j <= 2; j++)
                {
                    Chart.ChartData[j, i].Value = i;
                }
            }
            ppt.SaveToFile(@"cellreftest.pptx", FileFormat.Pptx2013);

boosted_d16
 
Posts: 34
Joined: Wed Apr 19, 2023 11:41 am

Fri Apr 21, 2023 2:01 am

Hi,

Thanks for your feedback.
I have done some tests with your document and code, but I did not reproduce your issue. I have attached my result document for your reference.
testResult.png

Are there any differences between your code and my code? Did I overlook certain conditions?
Could you share us with the following messages? So that we can quickly locate and solve this issue. Apologize for any inconvenience caused, we would try our best to solve your issue as soon as we can. Thanks for your patience and understanding on this issue.
1) your result document.
2) your application type, such as Console App .NET Framework 4.8.
3) your test environment, such as OS info (E.g., Windows 10 64bit) and region setting (E.g., China, Chinese).

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Fri Apr 28, 2023 4:34 pm

My apologies, I'm not doing a good job of explaining the issue. Can you use the data below and send it to the original chart and let me know what happens please:

chart table
jan 1 2
feb 1 2
mar 3.5 1.8
april 4.5 2.8

The problem occurs when you insert less columns than what was already in the chart template.

For example, if the chart template has 3 columns or data and you add 3 columns of data you will not see the problem. If you add 2 columns of data then you will see it.

boosted_d16
 
Posts: 34
Joined: Wed Apr 19, 2023 11:41 am

Mon May 01, 2023 10:07 am

Hello,

Thanks for your feedback.
Yes, I only add 2 columns of data, as the screenshot below. To help us fast reproduce your issue and work out a solution for you, please offer a simple test project that can reproduce your issue. the project file may be big, you can upload it to OneDrive then share the download link for us. In addition, please also offer your test environment, such as OS info (E.g., Windows 10 64bit) and region setting (E.g., China, Chinese).
Thanks for your assistance in advance.


Sincerely,
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed May 03, 2023 3:27 pm

Code below will generate 2 files:
LessRowsAndColumnsCantEditData - this will show that you cannot edit data when there are less rows and columns than in the dummy chart
SameRowsAndColumnsREFError - this will show the `#REF` error when there are same rows and columns

Try this:
Code: Select all
using Spire.Presentation.Charts;
using Spire.Presentation;
namespace ConsoleApp2
{
 internal class Program
 {
 static void Main(string[] args)
 {
 Console.WriteLine("Hello, World!");
 Presentation ppt = new Presentation();
 ppt.LoadFromFile(@"slides_as_template ref ex.pptx");
 if (ppt.Slides[1].Shapes[0] is IChart)
 {
 IChart chart = ppt.Slides[1].Shapes[0] as IChart;

 chart.ChartData.Clear(0, 0, chart.Categories.Count+1,
chart.Series.Count+1);
 chart.ChartData[0, 1].Text = "chart";
 chart.ChartData[0, 2].Text = "table";
 chart.ChartData[1, 0].Text = "jan";
 chart.ChartData[2, 0].Text = "feb";
 for (int i = 1; i < 3; i++)
 {
 for (int j = 1; j < 3; j++)
 {
 if (i != 0 && j != 0)
 {
 if (i == 0)
 {
 chart.ChartData[i, j].Value = "column" + j;
 }
 else if (j == 0)
 {
 chart.ChartData[i, j].Value = "row" + i;
 }
 else
 {
 chart.ChartData[i, j].Value = i;
 }
 }
 Console.WriteLine(chart.ChartData[i, j].Value);
 }
 Console.WriteLine("======");
 }
 Console.ReadLine();
 }

 ppt.SaveToFile(@"LessRowsAndColumnsCantEditData.pptx",
FileFormat.Pptx2013);
 ///////////////////
 Console.WriteLine("PPT2");
 Presentation ppt2 = new Presentation();
 ppt2.LoadFromFile(@"slides_as_template ref ex.pptx");
 if (ppt2.Slides[1].Shapes[0] is IChart)
 {
 IChart chart2 = ppt2.Slides[1].Shapes[0] as IChart;
 chart2.ChartData.Clear(0, 0, chart2.Categories.Count + 1,
chart2.Series.Count + 1);
 chart2.ChartData[0, 1].Text = "chart";
 chart2.ChartData[0, 2].Text = "table";
 chart2.ChartData[0, 3].Text = "data";
 chart2.ChartData[1, 0].Text = "jan";
 chart2.ChartData[2, 0].Text = "feb";
 chart2.ChartData[3, 0].Text = "mar";
 chart2.ChartData[4, 0].Text = "apr";
 for (int i = 1; i < 5; i++)
 {
 for (int j = 1; j < 4; j++)
 {
 if (i == 0)
 {
 chart2.ChartData[i, j].Value = "column" + j;
 }
 else if (j == 0)
 {
 chart2.ChartData[i, j].Value = "row" + i;
 }
 else
 {
 chart2.ChartData[i, j].Value = i;
 }
 Console.WriteLine(chart2.ChartData[i, j].Value);
 }
 Console.WriteLine("======");
 }
 }
 ppt2.SaveToFile(@"SameRowsAndColumnsREFError.pptx", FileFormat.Pptx2013);
 }
 }
}

boosted_d16
 
Posts: 34
Joined: Wed Apr 19, 2023 11:41 am

Thu May 04, 2023 6:36 am

Hi,

Thanks for your sharing.
I have replicated the problem you reported using the code you provided, and both documents displayed an error message stating "Linked file is not available…". Although the second document did not exhibit the problem you described, I will relay this information to our developers.

Rest assured that we are working on resolving this problem as soon as possible. We will keep you informed if this issue is fixed. Thank you for your patience.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Presentation