java.lang.StackOverflowError on saving as pdf

Posted by: ravi.jasti on 30 July 2019, 3:45 pm EST

  • Posted 30 July 2019, 3:45 pm EST

    Hi .
    i have excel file where i am trying to save it as PDF , but during the process i am getting below error

    java.lang.StackOverflowError: null
    at java.lang.String.equals(Unknown Source)
    at com.grapecity.documents.excel.drawing.y.a(Unknown Source)

    this is My Code :

    Workbook finalOut = null;
    String tempFile ="E:\\ExcelFile.xlsx";
    String outFile ="excelPdf.pdf";
    try {
    finalOut = getWorkbook(new FileInputStream((tempFile)));
    if (finalOut != null) {
    finalOut.save(new FileOutputStream(outFile), SaveFileFormat.Pdf);
    }
    } catch (Exception e) {
    System.err.println("Error => {} "+ e.toString());
    }



    FYI :
    Excel file has conditional formats , cell styles ..


    My Notice when more than 1 conditional format this issue is coming ..

    i am also attaching the excel file for your reference .

    template.zip

    Please fix this ASAP
  • Replied 30 July 2019, 5:05 pm EST

    Hello,

    We are able to replicate the issue and hence we are escalating the same to the concerned team for the fix.

    We will update you as soon as we hear anything from our concerned team.

    Tracking id for your issue is #DOCXLS-1315

    In the meantime I would to clarify how did you create this Excel file? As this seems to be an issue with the way this Excel file is created, because we are getting this exception on loading Excel at first. However, when we open this Excel file in MS Excel and save it again using "Save As" option and then load the new Excel file then it is working absolutely fine.

    Hence, please confirm how this Excel file was created?

    Thanks,
    Reeva
  • Replied 30 July 2019, 5:08 pm EST

    This Excel file was create Dynamically by Grapecity only and we used expressions for Conditional format .
  • Replied 31 July 2019, 6:02 pm EST

    Hello,

    Thanks for sharing how the Excel was created.Our developers are investigating your issue further and we will update you as soon as we hear anything from them.

    Thanks,
    Reeva
  • Replied 5 August 2019, 1:59 pm EST

    Any Update?
  • Replied 5 August 2019, 9:28 pm EST

    Hello,

    Your issue has been fixed by our developers and it will be out in the next hotfix build.

    Thanks,
    Reeva
  • Replied 8 August 2019, 2:42 pm EST

    Hello,

    Please test your case against the latest build v2.2.3 and let us know if it solves your issue. Latest build can be downloaded from this link:-

    https://search.maven.org/remotecontent?filepath=com/grapecity/documents/gcexcel/2.2.3/gcexcel-2.2.3.jar

    Hope it helps.

    Thanks,
    Reeva
  • Replied 8 September 2019, 5:15 pm EST

    when i convert excel to pdf . some cell values are not showing.

    below i am attaching the excel file and pdf output file ..
    excel_to_pdf.zip

    this is My Code :

    Workbook finalOut = null;
    String tempFile ="E:\\ExcelFile.xlsx";
    String outFile ="excelPdf.pdf";
    try {
    finalOut = getWorkbook(new FileInputStream((tempFile)));
    if (finalOut != null) {
    finalOut.save(new FileOutputStream(outFile), SaveFileFormat.Pdf);
    }
    } catch (Exception e) {
    System.err.println("Error => {} "+ e.toString());
    }


  • Replied 8 September 2019, 5:26 pm EST

    Hello,

    We are able to replicate the issue and hence we are escalating the same to the concerned team for the fix. 

    We will update you as soon as we hear anything from our concerned team.

    Thanks,
    Reeva
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels