Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Apr 24, 2023 12:35 pm

Hello,
I'm converting XLSB file into PDF file using Java spire.office-8.3.5 API.
The source file "Portfolio Valuation_Permira_Jun22_Atman_Term Loan_Final.xlsm" has been ended in error without converting a file.

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
----------------- Excel to PDF conversion END ------------------
at com.spire.office.packages.sprvvf.spr▐━(Unknown Source)
at com.spire.office.packages.sprvvf.spr▎│(Unknown Source)
at com.spire.office.packages.sprvvf.spr▔│(Unknown Source)
at com.spire.office.packages.sprvvf.spr┹│(Unknown Source)
at com.spire.office.packages.spryzf.spr┹│(Unknown Source)
at com.spire.office.packages.sprnog.spr┅┓(Unknown Source)
at com.spire.xls.core.spreadsheet.XlsWorksheet.CalculateAllValue(Unknown Source)
at com.cs.Sample.doConversion(Sample.java:83)
at com.cs.Sample.main(Sample.java:42)


The sample source code and screenshot of the log detail are attached for your reference.
I could not upload the source file in this thread. I will share the same to the support email.

I appreciate your help on this.

Permira-IndexError.zip
(30.11 KiB) Downloaded 402 times

UshaThavasiappan
 
Posts: 109
Joined: Sat Oct 08, 2022 9:23 am

Tue Apr 25, 2023 5:59 am

Hi,

Thanks for your feedback.
After testing, I have reproduced the issue you mentioned and logged it into our issue tracking system with the ticket number SPIREXLS-4634, our developers will investigate and fix this issue, apologize for any inconvenience caused, once the issue is fixed, I will inform you asap.
Thanks for your understanding.

Best regards,
Triste
E-iceblue support team
User avatar

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

Tue Apr 25, 2023 7:59 am

Hi Triste,
I figured the issue. In the sample source I have shared earlier, the below code is causing the error. When I remove/comment this code snippet, I could able to convert the file.

Code: Select all
if (worksheet.getPivotTables().getCount() == 0) {
    worksheet.CalculateAllValue();
}


But I just want to know, why it is like this?
I'm processing more than 100 files per day. So, I could not change the source code for a particular file. I need generic source for converting all of my files.

I hope you understand my point. Please help on this.

UshaThavasiappan
 
Posts: 109
Joined: Sat Oct 08, 2022 9:23 am

Tue Apr 25, 2023 9:33 am

Hi,

Thanks for your feedback.
When the CalculateAllValue() method is called, it refreshes all cells in the workbook, including function calculations. If there are invalid or missing formulas in the worksheet, this can cause issues with the calculation. In fact, we discovered that in the document you provided, there was an example where an invalid formula caused a problem.

Our development team investigated your document and found that the Filter function was nested within the YEAR function, which caused our product to incorrectly calculate the data, resulting in the error you experienced.

We apologize for any inconvenience this may have caused and appreciate your patience. I have given your issue the highest priority, once the issue is fixed, I will inform you asap.

Best regards,
Triste
E-iceblue support team
User avatar

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

Thu May 25, 2023 7:11 am

Hi,

Thanks for your patience.
Glad to inform you that we just released Spire.Office for java 8.5.6, which has fixed your issue SPIREXLS-4634 and SPIREXLS-4635. Please download from the following links and have a test.
Website link: https://www.e-iceblue.com/Download/office-for-java.html
Maven:
Code: Select all
<repositories>
    <repository>
        <id>com.e-iceblue</id>
        <name>e-iceblue</name>
        <url>https://repo.e-iceblue.com/nexus/content/groups/public/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.office</artifactId>
        <version>8.5.6</version>
    </dependency>
</dependencies>


If you have any further questions or concerns, just feel free to contact us.

Best regards,
Triste
E-iceblue support team
User avatar

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

Thu May 25, 2023 12:15 pm

Hi,
Thank you for the update. Downloaded already and testing the issues.

UshaThavasiappan
 
Posts: 109
Joined: Sat Oct 08, 2022 9:23 am

Fri May 26, 2023 2:56 am

Hi,

Thank you for your feedback regarding the update we provided. We appreciate your kind words. We would like to take this opportunity to express our gratitude for your patience throughout the process.
Your continued support and understanding mean a great deal to us, and we look forward to meeting your needs in the future. If you have any further questions or concerns, please do not hesitate to contact us anytime.

Have a good day! :D

Best regards,
Triste
E-iceblue support team
User avatar

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

Return to Spire.XLS