Free Support Forum - aspose.com

worksheet.getCells().getMaxDisplayRange() often incorrect in Java


#1

Are you aware that in many cases the Java version of Aspose Cells include blank columns on the
right of the actual display range?

While the equivalent C# worksheet.Cells.MaxDisplayRange works correctly.

Are you guys aware of any work-around to sift through long empty columns and determine that they are all
empty?


#2

@russ.nichols,

I have tried to reproduce this issue using blank workbooks but could not observe any problem. Please share your sample file and code snippet with us for our testing. We will reproduce the problem and provide our feedback after analysis.


#3

The first sheet of this file

has a correct display range (2 columns) in C#, but (26 columns) in JAVA


#4

@russ.nichols,

I have tried this scenario using Aspose.Cells for Java, .NET and Interop as well using sample “invisible_text.xlsx” file. In all the cases I get 26 columns. Could you please test this issue using latest version Aspose.Cells for Java 19.2.x and share your feedback? If still issue is there, please share exact code which you are using along with the snapshots showing the wrong number of columns in this sample file. We will review the information and provide assistance accordingly.
Comparison.png (12.0 KB)


#5

Are you looking at MaxDisplayRange?
Your screen shot does not show the value for that


#6

I am using cells 19.1


#7

The C# code is just worksheet.Cells.MaxDisplayRange


#8

String localFilename = @“C:\tmp\invisible.xlsx”;
Workbook workbook = new Workbook(localFilename);
Console.WriteLine(workbook.Worksheets[0].Cells.MaxDisplayRange.ColumnCount);

outputs (correctly)

1

in Java (the equivalent)
outputs (incorrectly)

26


#9

@russ.nichols,

I have again verified it using latest version 19.2.7 and got the same result in both .NET and Java as shown in the attached image. At my end version 19.1.x is also giving same results. You may please reconfirm the version and display it using CellsHelper.GetVersion() function for your reference.
Comparison2.png (20.9 KB)


#10

You are correct … I sent you the wrong file, let me look for a repro file that does not have PII


#11

@russ.nichols,
Thank you for providing the feedback. Feel free to write us back if you have any other query in this regard.