Upgrade fromversion 5.1 to 7.0.3

Hi,

I’m trying to upgrade my projects from Aspose.Cells 5.1 to Aspose.Cells 7.03. I have already accommodated my source code. The report generated with the new version looks a lot better, but I have two small problems.

I’m using charts with dynamically created milestones. Each milestone (represented as a simple square) is shown at the top of the chart. Finally, a line connects the milestone with the x-Axis. In the old version, the line touched the x-Axis MilestonesOld.JPG. If I use the latest version, there is a small gap visible (MilestonesNew.JPG). How can I avoid this? I have not changed the code (code.txt) that draws the milestones and lines.

The second issue deals with the x-Axis labels. In some cases I have to print a week and a year. If I consider the result in an xls or xlsx file the week is shown on the first line and the year on the second line (Labelxlsx.jpg). If I save the report as a pdf document, the label is split into three lines where the third contains the last number of the year (Labelpdf.xlsx).

Thanks for your support

Erik

Hi Erik,


Thanks for the screen shots.

You have provided the generic code that cannot be evaluated properly. We appreciate if you could create a sample console Application, zip it and post it here. Also, provide us the template Excel file(s) here. It will help us to evaluate your issue.

Also, we recommend you to use our latest version/fix: Aspose.Cells for .NET v7.0.3.4 if it makes any difference on your end.

Thank you.

Hi,

please find attached the required files. I hope that you can integrate the two methods into a sample project. Building the sample project has drawn up a new problem. If I change the height of the plotarea, the whole plotarea appears shrunken. I would like to use the space at the top of the chart to display the required milestones (see example2.xlsx).

Regards

Erik

Hi,


I can notice the issues you mentioned after an initial test. But, we need to investigate and evaluate your code thoroughly. I have logged a ticket with an id: CELLSNET-40167. Our concerned developer of the feature will look into it soon. Once we have any update about it, we will let you know here.

thank you.

Hi,

In the current version, setting customized position for the chart objects (chart tile, plot area, legend and shape) is not supported fine. We have a plan i.e. within about 2 months or so, we will improve this feature.

Thank you.

Hi,

Can you please provide me a date or a release for this fix?

Thanks in advance

Erik

Hi,.

Please download and try the latest version:
Aspose.Cells
for .NET v7.1.0.4

and let us know your feedback.

Hi,

Compared to the last version, there are no changes. All mentioned issues are still available. When will you fix the issues??

Erik

Hi,

Thanks for your feedback.

I have added your comments in our database against the above issue id. Hopefully, your issues will be fixed soon or we will provide you ETA.

Hi,

when will you fix this issue?

Regards

Erik

Hi,

Please download and try this new release:

Aspose.Cells for .NET 7.1.1.1



Your issue should be fixed now.

Hi,

I can’t see any improvement with the latest version. As soon as I change the size of the plotarea, the whole chart looks shrunken and moves to the right. It is also interesting, that this process is independent of the new height value.

chart.PlotArea.Height += 10;
chart.PlotArea.Y = chart.PlotArea.Y + 550;

Any idea?

Erik

Hi,

I have created these output files after running your code.

Can you please provide me your expected output file? You can create such files using Ms-Excel and rename them and post here.

Please also highlight the differences with red circles in a screenshot, which you can create using Ms-Paint.

I need all these things to sort out and escalate your issue.

C#

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Aspose.Cells;

using Aspose.Cells.Rendering;

using Aspose.Cells.Charts;

using Aspose.Cells.Drawing;

using System.Drawing;

using System.IO;


namespace AsposeProject

{

class Charts

{


public static void Createchart1()

{

//License l = new License();

//l.SetLicense(“Aspose.Total.lic”);


string filePath = @“F:\Shak-Data-RW\Downloads\test”;


Workbook wb = new Workbook(filePath + “example.xlsx”);

Worksheet wsChart = wb.Worksheets[0];

Worksheet wsData = wb.Worksheets[1];

wsData.IsVisible = false;


//Erzeugen des Diagramms und setzen der wesentlichen Eigenschaften

int chartIndex = wsChart.Charts.Add(ChartType.Line, 23, 0, 62, 84);

Chart chart = wsChart.Charts[chartIndex];

//Hauptgridzeielen einblenden

//chart. MajorGridLines.IsVisible = true;

//Grundfarbe weiß

chart.PlotArea.Area.ForegroundColor = Color.White;

//Kein umschließender Rahmen

chart.ChartArea.Border.IsVisible = false;


//Festlegung der Datenquelle

chart.NSeries.Add("’" + wsData.Name + “’!D2:D” + Convert.ToString(216), true);

chart.NSeries.Add("’" + wsData.Name + “’!C2:C” + Convert.ToString(212), true);

chart.NSeries.Add("’" + wsData.Name + “’!F2:F” + Convert.ToString(216), true);

chart.NSeries.Add("’" + wsData.Name + “’!E2:E” + Convert.ToString(212), true);

chart.NSeries.CategoryData = “’” + wsData.Name + “’!B2:B” + Convert.ToString(216);



//Anpassen der Farben der einzelnen Datenreihen

chart.NSeries[1].Line.Color = Color.DarkBlue;

chart.NSeries[1].Line.Weight = WeightType.WideLine;

chart.NSeries[0].Line.Color = Color.Yellow;

chart.NSeries[0].Line.Weight = WeightType.WideLine;

chart.NSeries[3].Line.Color = Color.Red;

chart.NSeries[3].Line.Weight = WeightType.WideLine;

chart.NSeries[2].Line.Color = Color.Orange;

chart.NSeries[2].Line.Weight = WeightType.WideLine;




//Legende Ausblenden

chart.ShowLegend = false;


chart.ValueAxis.MinValue = 0;

chart.ValueAxis.MaxValue = 1;

chart.ValueAxis.MajorUnit = 0.1;

chart.ValueAxis.TickLabels.NumberFormat = “0%”;



//Formatierung der Label der X-Achse

chart.CategoryAxis.TickLabels.Font.Size = 8;

chart.CategoryAxis.AxisBetweenCategories = false;

chart.CategoryAxis.TickLabelSpacing = 5;

chart.CategoryAxis.TickLabels.RotationAngle = 0;


//chart.Calculate();


//Neuausrichten der Plotarea

chart.PlotArea.Height -= 450;

chart.PlotArea.Y -= 550;


chart.Calculate();


//Wasserzeichen / Quelllabel einstellen

FileStream stream = new FileStream(filePath + “logochart.bmp”, FileMode.Open, FileAccess.Read);

Picture pic0 = chart.Shapes.AddPictureInChart(chart.PlotAreaWithoutTickLabels.Y + 25, chart.PlotAreaWithoutTickLabels.X + 15, stream, 90, 90);


//AddTextbox(chart, Color.Black, Color.LightGray, 300, 0, “01-2008”, 0);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 5, “06-2008”, 190);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 10, “11-2008”, 0);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 15, “16-2008”, 190);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 20, “21-2008”, 0);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 25, “26-2008”, 190);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 30, “31-2008”, 0);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 35, “36-2008”, 190);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 40, “41-2008”, 0);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 45, “46-2008”, 190);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 50, “51-2008”, 0);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 55, “04-2009”, 190);

//AddTextbox(chart, Color.Black, Color.LightGray, 300, 60, “09-2009”, 0);



wb.Save(filePath + “reportAspose.xlsx”, SaveFormat.Xlsx);

wb.Save(filePath+ “reportAspose.pdf”, SaveFormat.Pdf);


//System.Diagnostics.Process.Start(Path.Combine(System.Windows.Forms.Application.StartupPath, “reportAspose.pdf”));

}


private void AddTextbox(Chart chart, Color line, Color background, int widthbox, int index, string text, int top)

{


int tickSpacing = chart.CategoryAxis.TickLabelSpacing;

int dataCount = chart.NSeries[0].CountOfDataValues;

if (!chart.CategoryAxis.AxisBetweenCategories)

{

dataCount -= 1;

}

int x = chart.PlotAreaWithoutTickLabels.X;

int y = chart.PlotAreaWithoutTickLabels.Y;

int width = chart.PlotAreaWithoutTickLabels.Width;

int height = chart.PlotAreaWithoutTickLabels.Height;

int unit = (int)(width / (dataCount));


//Erst die Linie, damit diese später durch die Textbox überlagert werden kann

Shape s = chart.Shapes.AddShapeInChart(MsoDrawingType.Line, PlacementType.MoveAndSize, x + (int)(unit * index) + (int)(index), top + 80, x + (int)(unit * (index)), 4000 - (4000 - y - height + 80));

s.LineFormat.ForeColor = line;





//Jetzt die Textbox integrieren

TextBox t = chart.Shapes.AddTextBoxInChart(top, x + (int)(unit * (index)), 150, widthbox);



t.LineFormat.ForeColor = line;

t.FillFormat.ForeColor = background;

t.Text = text;

t.Font.Size = 6;

t.TextHorizontalAlignment = TextAlignmentType.Center;

t.TextVerticalAlignment = TextAlignmentType.Center;

}

}

}

Hi,

First of all, the main issue regarding the position of the plot area seems to be fixed. I believe that my test project had referred to an old version of Aspose.Cells. Nevertheless there are still some differences between the two versions. I tried to illustrate the main differences by one page of a report. The attached files contains the following files

  • ErgebnisXls_5.1.0.1:basic excel file created by Aspose.Cells 5.1.0.1
  • ErgebnisPDF_5.1.0.1 final pdf file created by Aspose.Cells 5.1.0.1
  • ErgebnisXls_7.1.1.1 basic excel file created by Aspose.Cells 7.1.1.1
  • ErgebnisPDF_7.1.1.1 final pdf file created by Aspose.Cells 7.1.1.1

These are the final issues (using the same code but different versions of Aspose.Cells)

  • The vertical lines should connect a textbox above the chart with the x-Axis of the chart. The line should start at the x-Axis and not above. In excel there is an difference in both Aspose.Cells versions. But in the resulting pdf output file there is a big difference.
  • In upper right quarter of the page is a small chart, indicating the progress of the release process. With the new version, the label above the chart consumes a lot of space. Additionally in final pdf file I don’t see the current value of the shown data point.
  • Some problems with x-Axis label. Here I’m able to fix this issue by using different rotation angles.

Thanks in advance.

Best regards

Erik

Hi,

Please download and try this fix:
Aspose.Cells
for .NET v7.1.1.2

and let us know your feedback.

Hi,

I created the report with the latest version of Aspose.Cells. I can’t see any difference to version 7.1.1.1. Please find an according screenshot attached.

I also attached a small project.

Regards

Erik

Hi,

Thanks for your feedback and testing it with latest version and providing us your sample project.

I have logged all of this in our database. Development team will look into it and once, we will have some update relating to it, we will let you know asap.

The comment has been logged against the issue id: CELLSNET-40167

Hi,



We have fixed this issue. Please download: Aspose.Cells for .NET v7.1.2.2

Please run the attached code.

We have improved the chart feature.

We have added InnerX, InnerY, InnerWidth, InnerHeight properties to replace PlotAreaWithoutTickLabels.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.