[]
        
(Showing Draft Content)

Set Spill Direction

Spill direction refers to the direction in which data automatically overflows from one cell to the adjacent cells, and the cell expands as needed to accommodate the results. To control how the data is spilled into cells in a ReportSheet, set the value of the spillDirection property of the setTemplateCell method.

SpreadJS supports the following values for the spillDirection property:

Property Value

Output

spillDirection: 'Vertical'

SpillDerection_vertical

spillDirection: 'Horizontal'

SpillDerection_Horizontal

spillDirection: 'None'

SpillDerection_none

Steps to set the spill direction in TemplateSheet:

  1. Define the table source in the DataManager.

  2. Configure the type and binding options in the template cell.

  3. Set the spillDirection property value in the template cell.

The following code samples show how to set different spill directions for the cells.

// Vertical Spill Direction
templateSheet.setTemplateCell(1, 0, {
     type: 'Group',
     binding: `Orders[CustomerId]`,
     spillDirection: 'Vertical',  
});

// Horizontal Spill Direction
templateSheet.setTemplateCell(1, 0, {
     type: 'Group',
     binding: `Orders[CustomerId]`,
     spillDirection: 'Horizontal',  
});

// No Spill Direction
templateSheet.setTemplateCell(1, 0, {
     type: 'Group',
     binding: `Orders[CustomerId]`,
     spillDirection: 'None',  
});