-
getIntersectingMergedRanges(cellRange)
-
Retrieves all merged cell regions that intersect with the specified cell range.
Parameters:
Returns:
An array of CellRange objects representing merged regions that intersect with the specified range.
-
Type
-
Array.<Core.SpreadsheetEditor.CellRange>
Example
const { Core } = window.getInstance();
const workbook = Core.documentViewer.getDocument().getSpreadsheetEditorDocument().getWorkbook();
const sheet = workbook.getSheet('Invoice');
const mergedCellRanges = sheet.mergedCellRanges;
const cellRange = new (Core.SpreadsheetEditor).CellRange(
{
firstRow: 0,
lastRow: 3,
firstColumn: 1,
lastColumn: 4
}
);
const intersectingRanges = mergedCellRanges.getIntersectingMergedRanges(cellRange);
-
isRangeMerged(cellRange)
-
Determines if the specified cell range is already merged as a single region.
Parameters:
Returns:
Returns true if the cell range exactly matches an existing merged region, false otherwise.
-
Type
-
boolean
Example
const { Core } = window.getInstance();
const workbook = Core.documentViewer.getDocument().getSpreadsheetEditorDocument().getWorkbook();
const sheet = workbook.getSheet('Invoice');
const mergedCellRanges = sheet.mergedCellRanges;
const cellRange = new (Core.SpreadsheetEditor).CellRange(
{
firstRow: 0,
lastRow: 3,
firstColumn: 1,
lastColumn: 4
}
);
const isMerged = mergedCellRanges.isRangeMerged(cellRange);
-
mergeRange(cellRange)
-
Merges the specified cell range and any intersecting merged regions into a single merged region.
If the specified range intersects with existing merged regions, those regions are removed and
a new merged region encompassing all affected cells is created.
Parameters:
Returns:
This method does not return a value. It modifies the state of the merged cell regions.
-
Type
-
void
Example
const { Core } = window.getInstance();
const workbook = Core.documentViewer.getDocument().getSpreadsheetEditorDocument().getWorkbook();
const sheet = workbook.getSheet('Invoice');
const mergedCellRanges = sheet.mergedCellRanges;
const cellRange = new (Core.SpreadsheetEditor).CellRange(
{
firstRow: 0,
lastRow: 3,
firstColumn: 1,
lastColumn: 4
}
);
mergedCellRanges.mergeRange(cellRange);
-
unmergeRange(cellRange)
-
Removes the merge from the specified cell range if it exactly matches an existing merged region.
Parameters:
Returns:
This method does not return a value. It modifies the state of the merged cell regions.
-
Type
-
void
Example
const { Core } = window.getInstance();
const workbook = Core.documentViewer.getDocument().getSpreadsheetEditorDocument().getWorkbook();
const sheet = workbook.getSheet('Invoice');
const mergedCellRanges = sheet.mergedCellRanges;
const cellRange = new (Core.SpreadsheetEditor).CellRange(
{
firstRow: 0,
lastRow: 3,
firstColumn: 1,
lastColumn: 4
}
);
mergedCellRanges.unmergeRange(cellRange);