Graph/Save Issue

I have an excel template that I use which is per-formatted with a “Data” tab and a “Graph” tab. My .Net program writes values to the data tab and the graph tab picks up the data and charts it. The only thing I’m using aspose for is to load the file and write the data from a database to the data tab. Then I save the file using aspose. The issue I’m having is the graph I’ve created in the template doesn’t have the “Trendline” equation and R-squared value checked. (I don’t want them to display). However after writing the data and saving the file (as a new file), when looking at the graph the “Trendline” stuff shows up. In the attached image (Capture.jpg) you’ll see what I’m talking about. In Capture2.jpg I show that the equation and R-squared is checked after saving the file. The attachment OLAP_Item_Analysis.xlsx is the template I use to load the data. The attachment Southwest_05100006514.xlsx is the file after loading the data and saving with aspose. To demonstrate that nothing is wrong with the template, you can take the data in Southwest_05100006514.xlsx E5:J108 and copy/paste to the OLAP_Item_Analysis.xlsx data tab and you’ll see the equation and R-squared doesn’t show up. The attachment Code.txt is the code I use to load the file, populate the data tab and save the file. Any help would be appreciated.

Landon

Hi,


Thanks for the files and screen shots.

Which Ms Excel version you are using for displaying the Excel files? I have opened your “Southwest_05100006514.xlsx” file into Excel and the trendlines stuff (“equation and R-squared value are not checked”) is not displayed. Also, make sure that you have posted your right files.

Also, we cannot evaluate your sample code as it depends on some backend data source and other objects for which we are not sure. We recomend you to kindly download and try our latest fix/version: Aspose.Cells for .NET v7.3.5.3 and let us know your feedback.

If you still find any issue, kindly create a sample runnable console application (Regarding your backend data source, you may create some DataTables dynamically and fill your desired data into the fields accordingly if you can, lastly input data into the worksheet cells accordingly), zip the project and post it here to reproduce the issue on our end. We will check your issue soon.

As a side note, you may try to hide the trendline stuff in your code.
e.g
Chart chart = workbook.Worksheets[“Graph”].Charts[0];
chart.NSeries[0].TrendLines[0].DisplayEquation = false;
chart.NSeries[0].TrendLines[0].DisplayRSquared = false;

Thank you.