Category axis labels are pushed together

I have an issue ever since upgrading to the newest version of aspose.cells. For the last chart that is created from the data. It pushes all the data together on the category axis of the chart. I have loaded examples of what I’m talking about. Did or does anybody else have this same issue? I have noticed that it only happens on the last page of multiple charts or on the report that only has 1 chart.

Hi,


Please try our latest version/fix: Aspose.Cells for .NET v7.3.2.1

If you still find the issue, kindly paste your runnable sample code or attach a sample console application(you may zip it prior attaching here) to reproduce the issue on our end. Also attach your template file, output file and your desired file (containing your desired chart—> you may create in MS Excel manually). We will check your issue soon.

Thank you.

Amjad,


I got the same results with the new DLL. I did talk to the end users again that told me about the issue. I have 2 different that are getting different results. One user has Excel 2007 V12.0.6661.5000 SP2 and the other user has Excel 2007 V12.0.6661.5000 SP3. The reports are coming out correctly with the SP2. It is the person with the SP3 that reports are incorrect.

Shawn

Hi Shawn,


Please make sure that both users are using the same code with same Aspose.Cells.Dll version (the code that works very well with SP2 user). Anyways, could you attach the template Excel file which shows fine with SP2 user(s) but not with SP3 Excel user(s), we may investigate it a bit.

Thank you.

Amjad,

I found something out what might be causing the issue. Here is my code that sets the tick mark and label values.

oChart.CategoryAxis.TickLabels.NumberFormat = "MM/dd/yy HH:mm"

oChart.CategoryAxis.TickLabelSpacing = CType((CHART_MINUTE_INTERVAL / 24), Int32)

oChart.CategoryAxis.TickMarkSpacing = CType((CHART_MINUTE_INTERVAL / 24), Int32)

oChart.CategoryAxis.MajorTickMark = Charts.TickMarkType.Cross

oChart.CategoryAxis.TickLabels.Font.Size = 8

oChart.CategoryAxis.TickLabels.Offset = 100

oChart.CategoryAxis.TickLabels.RotationAngle = 45

oChart.CategoryAxis.CategoryType = Charts.CategoryType.CategoryScale

oChart.CategoryAxis.MajorGridLines.IsVisible = True

oChart.CategoryAxis.MajorGridLines.Style = Drawing.LineType.Solid

The ticklabelspacing and tickmarkspacing are both set to 60 when the code is generates the value. But when going into the settings on the excel document I see 2 different results. I'm attaching screen shots of the properties of each excel document. You will see that I get 2 different results in the setting with the same code. Is this an excel issue or is this an aspose issue? Now these 2 PCs have the same version of excel on them.

Thank you,

Shawn

Hi Shawn,


Thanks for your further screen shots.

Well, it looks strange to us, it might be MS Excel’s behavior for different versions. For investigation, we require you kindly attach the template Excel file (you may create with dummy data if you want) which shows fine with one user but not with other user for his Excel version.

We will log a ticket and look into your issue.

Thank you.

Amjad,

Here is the excel files from both pcs.

Shawn

Amajd,

I found something else out. In my code I was still using SaveFormat.Excel97To2003 as my format. I changed my code to use Xlsx as my format and everything looks good except for gettting this message. I think I resolved the pushing of the data together but how to I resolve the error message I keep on getting? Here is my code for that part of the process.

outputFileName = job & "." & workOrder & "." & beam.Replace(",", "-").Replace(" ", "") & "." & steamLine & "." & valve & ".xlsx"

oExcel.Save(memoryStream, SaveFormat.Xlsx)

Me.Response.ContentType = "vnd.openxmlformats(-officedocument.spreadsheetml.sheet)"

Me.Response.AddHeader("Content-Disposition", "Attachment; filename=" & outputFileName)

bytebuffer = memoryStream.GetBuffer()

Me.Response.OutputStream.Write(bytebuffer, 0, bytebuffer.Length)

Me.Response.Flush()

Me.Response.End()

Thank you,

Shawn

Hi,


Thanks for the sample files.

It looks to me that you are not using the same code on both PCs, also it is quite possible that different versions of Aspose.Cells for .NET were used to generate the files on those machines. See the attached screen shot of Pc2 and Pc1 files (comparing them both) when opening the file into my MS Excel 2007.

We really appreciate if you could create a separate application with v7.3.2 to reproduce the issue on our end. Please zip the application and post it here to show the issue. We will check your code and then just run it on different machines having different MS Excel versions to trace the issue. If we found the issue, we will log it and figure it out soon.

Thank you.
Hi,

AutomationNESL:

I found something else out. In my code I was still using SaveFormat.Excel97To2003 as my format. I changed my code to use Xlsx as my format and everything looks good except for gettting this message. I think I resolved the pushing of the data together but how to I resolve the error message I keep on getting? Here is my code for that part of the process.

outputFileName = job & "." & workOrder & "." & beam.Replace(",", "-").Replace(" ", "") & "." & steamLine & "." & valve & ".xlsx"

oExcel.Save(memoryStream, SaveFormat.Xlsx)

Me.Response.ContentType = "vnd.openxmlformats(-officedocument.spreadsheetml.sheet)"

Me.Response.AddHeader("Content-Disposition", "Attachment; filename=" & outputFileName)

bytebuffer = memoryStream.GetBuffer()

Me.Response.OutputStream.Write(bytebuffer, 0, bytebuffer.Length)

Me.Response.Flush()

Me.Response.End()

Please try our latest version/fix: Aspose.Cells for .NET v7.3.2.1

Also, you may replace the lines of code with just one line of code i.e..,

//Save in xlsx format and send the file to user so that he may open the file in
//some application or save it to some location
oExcel.Save(this.Response, "Report.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions());
Response.End();


If you still find the issue, kindly give us sample project to show the issue on our end. We will check this issue as well.

Thank you.

Amjad,

I did what you suggested and everything worked correctly. Thank you for the help.

Shawn

Hi Shawn,


Good to know that your issue is resolved now.

Feel free to contact us any time if you need further help or have some other queries, we will assist you soon.

Thank you.