Workbook Related Settings for GridJs

Settings for GridJs

Overview

GridJs provides comprehensive configuration options through the GridWorkbookSettings class. These settings allow developers to customize various aspects of Excel file processing, including calculation behavior, metadata management, and performance optimization.

GridWorkbookSettings Class

The GridWorkbookSettings class serves as the central configuration hub for GridJs operations.

Key Configuration Areas

  • Calculation Settings: Control formula recalculation behavior
  • Metadata Management: Set file properties and author information
  • Performance Optimization: Configure caching and resource management

Basic Usage Examples

Disabling Recalculation on File Open

GridJsWorkbook gw = new GridJsWorkbook();
GridWorkbookSettings gws = new GridWorkbookSettings();
// Do not re-calculate all formulas on opening the file
gws.setReCalculateOnOpen(false);
gw.setSettings(gws);
gw.importExcelFile(@"c:\test.xlsx");

Setting File Metadata

GridJsWorkbook gw = new GridJsWorkbook();
GridWorkbookSettings gws = new GridWorkbookSettings();
// Set author information
gws.setAuthor("peter");
gw.setSettings(gws);
gw.importExcelFile(@"c:\test.xlsx");

Common Settings Reference

Calculation‑Related Settings

  • setReCalculateOnOpen: Controls whether formulas are recalculated when opening files, default is true.
  • setForceFullCalculate: Enables forced full calculation cycles.
  • setCreateCalcChain: Controls whether to create a calculated formulas chain, default is false.
  • setIteration: Controls whether to use iteration to resolve circular references, default is true.
  • setMaxIteration: Sets the maximum number of iterations to resolve a circular reference; the default value is 100.

Metadata Settings

  • setAuthor: Specifies the file author.

Performance Settings

  • setCheckCustomNumberFormat: Validates custom number format when setting Style.Custom.
  • setCheckExcelRestriction: Controls whether to check restrictions of the Excel file when the user modifies cell‑related objects.

Advanced Configuration

Batch Settings Application

GridJsWorkbook gw = new GridJsWorkbook();
GridWorkbookSettings gws = new GridWorkbookSettings();

// Configure multiple settings simultaneously
gws.setReCalculateOnOpen(false);
gws.setAuthor("peter");
gws.setCheckCustomNumberFormat(true);
gws.setCheckExcelRestriction(true);
gw.setSettings(gws);
gw.importExcelFile(@"c:\test.xlsx");

Demo and Examples

For comprehensive implementation examples and detailed usage scenarios, refer to the official demo repository:

https://github.com/aspose-cells/Aspose.Cells.Grid-for-Java/tree/main/Examples.GridJs

Additional Resources