Document Solutions for Excel, Java Edition | Document Solutions
Features / Workbook / Enable or Disable Calculation Engine
In This Topic
    Enable or Disable Calculation Engine
    In This Topic

    DsExcel Java provides you with comprehensive computing features via a built-in calculation engine that is capable of performing even the most complex operations on the data in the spreadsheets. This calculation engine can be integrated with spreadsheets to achieve the desired results with complete accuracy and within fraction of seconds.

    Some of the advantages of using calculation engine are shared below:

    1. Bulk Data Analysis:

      Involves significantly less programming effort to handle complex spreadsheet calculations and display accurate results for effective analysis of tons of data.

    2. Ease of Use:

      Easy-to-configure calculation engine with the ability to quickly fetch data from cells within the spreadsheets and perform accurate calculations on the data.

    3. Saves Time and Efforts:

      Pre-defined functions and built-in methods to save implementation time and minimize programming efforts.

    Enable calculation engine

    In order to enable the calculation engine, refer to the following example code.

    Java
    Copy Code
    // Enable the calculation engine
    worksheet.getRange("A1").setValue(1);
    worksheet.getRange("A2").setFormula("=A1");
    workbook.setEnableCalculation(true);
            
    // Calculates formula while getting values. A2's value is 1
    Object value1 = worksheet.getRange("A2").getValue();

    Disable calculation engine

    In order to disable calculation engine, refer to the following example code.

    Java
    Copy Code
    // Disable the calculation engine
    workbook.setEnableCalculation(false);
    worksheet.getRange("A1").setValue(1);
    worksheet.getRange("A2").setFormula("=A1");
            
    // A2's value is zero
    Object value = worksheet.getRange("A2").getValue();

    See Also