CopyToExcelFormat: Boolean;
The CopyToExcelFormat property determines whether data of table cell is copied to the clipboard as a table layout.
Use JSON or the setCopyToExcelFormat method to set the property value and the getCopyToExcelFormat method to get the property value.
If the property is set to True, table cells data is copied to the clipboard as a table layout, otherwise it is copied as a plain text (default).
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Disable selection of multiple table cells, then get a cell range, convert it into a plain text and into table layout text.
// Disable the selection of several table cells tabSheet.setMultiCellSelectionEnable(false); // Get the cell range var range = tabSheet.getRangeFromString("A0:A0"); // Transform the range data into plain text console.log("Plain text: " + range.toPlainText()); // Transform the range data into table format text tabSheet.setCopyToExcelFormat(true); console.log("Text in table format: " + range.toPlainText()); // Get the table cell style var style = tabSheet.getModel().getCell(tabSheet.getCoordFromString("A1")).getStyle();
After executing the example selection of multiple cells at the same time is disabled.
The browser console also shows cell range text as a plain text and in table layout:
Plain text: 16905
Text in table layout: <table><tr><td style='background-color: #D2DFEE; font-family: Arial; font-size: 10.67px; color: #000000; text-decoration: underline ; vertical-align: top; text-align: left; word-wrap: break-word; padding: 5px 0px 5px 5px; '>16905</td></tr></table>
See also: