Error in Excel Exporting

  • Last update:  2024-02-27
  • java.lang.NullPointerException

    Description:

    After exporting the component as Excel, you may find an error occurs when opening this file: "errorCode:500, errorMsg: java.lang.NullPointerException."

    View the FineBI log in %FineBI%/logs/fanruan.log, and you may find the corresponding error displayed as follows.

    java.lang.NullPointerException
    at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
    at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
    at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
    at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
    at sun.font.SunFontManager$2.run(SunFontManager.java:431)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.SunFontManager.<init>(SunFontManager.java:376)
    at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
    at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
    at sun.reflect.GeneratedConstructorAccessor654.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    at java.awt.Font.getFont2D(Font.java:491)
    at java.awt.Font.canDisplayUpTo(Font.java:2060)
    at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
    at java.awt.font.TextLayout.<init>(TextLayout.java:531)
    at com.fr.third.v2.org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:254)
    Cause:

    This error is caused by the lack of related font resources in the Linux system, and a font manager needs to be installed.

    Solution:

    Execute the following command to install the font manager in Linux.

    yum install fontconfig

    If using Docker to create a base image, execute the following command.

    RUN yum -y install fontconfig
    RUN fc-cache --force

    java.lang.IllegalArgumentException: The Workbook Already Contains a Sheet with This Name

    Description:

    After exporting the component as Excel, you may find an error occurs when opening this file.

    Cause:

    Sheet naming in Excel follows the following rules.

    1. The sheet name cannot exceed 31 characters (the character includes English letters, |, (), etc., but does not include \, /, ? , *, [], etc.). When using the POI tool in the program, if you input a string greater than 31 characters, it will be automatically truncated to two substrings whose names are the same, resulting in an error.

    2. The sheet name cannot be empty, otherwise an error will be reported.

    Solution:

    Modify the component name and its corresponding length to comply with Excel naming rules.

    Could not initialize class sun.awt.X11GraphicsEnvironment

    Description:

    Fail to export Excel in Linux, and the following error occurs when you check the log or press F12 to go to the console: Could not initialize class sun.awt.X11GraphicsEnvironment.

    Cause:

    In Linux, when exporting the component as Excel, the Java image package is used to process images. Local X-server is required when you use the Java virtual machine to process images, otherwise this error will occur.

    Solution:

    Directly Installed FineBI

    Find the file finebi.vmoption in the path %FineBI5.1%\binadd -Djava.awt.headless=true into the file, and save the file. 

    FineBI Deployed to Tomcat

    Go to the directory %Tomcat%/bin, find the configuration file catalina.sh, and add the parameter -Djava.awt.headless=true parameterinto the file.

    com.finebi.common.exception.execute.FineOutOfMaxRowException: out of row restriction: xxxxxxx

    Description:

    After exporting the component as Excel, you may find an error occurs when opening this file.

    Cause:

    The exported Excel data exceeds the limit.

    Solution:

    Reduce the amount of exported Excel data through filtering and other methods.

    Data Volume Exceeds Limit: Export Column Out Of Limit!

    Description:

    When exporting the component as Excel, the error message "Export Column Out Of Limit! Contact the administrator." is displayed.

    Cause:

    The number of exported columns exceeds 100.

    Solution:

    Modify parameters in the external database by entering insert into fine_conf_entity(id,'value') values ('SystemOptimizationConfig.crossExportColumnLimit','value'). You are not advised to modify the value to be very large.


    附件列表


    主题: Creating a Visual Component
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy