[]
ReportSheet supports row layout and column layout. In SpreadJS, only the PaginatedPreview render mode allows you to configure the row and column layout in the TemplateSheet.
To configure layout settings in a template sheet, first, create the template sheet and configure the template cell information. After that, configure the layout settings using the setLayoutSetting
method of the GC.Spread.Report.TemplateSheet class.
Note: For scenarios with fewer columns and vertically spilled data, the row layout is beneficial for space optimization. Whereas in cases of fewer columns and horizontally spilled data, the column layout proves more efficient use of space when displaying the data.
You can use the following code samples to set the layout settings.
// Set the row layout settings.
templateSheet.setLayoutSetting({
type: 'RowLayout',
dataRange: 'A3:E3',
rowCount: 25,
repeatRows: {
start: 1,
end: 1
}
});
reportSheet.renderMode('PaginatedPreview');
// Set the column layout settings.
templateSheet.setLayoutSetting({
type: 'ColumnLayout',
dataRange: 'B2:B6',
columnCount: 10,
repeatCols: {
start: 0,
end: 0
}
});
reportSheet.renderMode('PaginatedPreview');
The following images depict the row and column layouts of a sales report in paginated preview mode.