It implements a module for the creation and management of excel spreadsheets.
It includes the following objects:
Generators: .NET, Java
event "Excel"
//opens an excel sheet
&excelSpreadsheet.Open("C:\testExcel\test.xlsx")
//&excelSpreadsheet.Open("C:\testExcel\test.xls")
//select a cell
&excelcellrange = &excelSpreadsheet.Cell(1,2)
//sets a value in the cell
&excelcellrange.ValueText = "hidden"
//sets the style of a cell
&excelCellStyle = new()
&excelCellStyle.Hidden = true
&excelCellStyle.Indent = 5
&excelCellStyle.Alignment.Horizontal = CellHorizontalAlignment.Left
//sets the border in the style (diagonal down and bottom borders)
&ExcelCellStyle.Border.DiagonalDown.Type = CellBorderType.DOUBLE
&ExcelCellStyle.Border.DiagonalDown.Color.SetColorRGB(200,20,50)
&ExcelCellStyle.Border.Bottom.Type = CellBorderType.DOUBLE
&ExcelCellStyle.Border.bottom.Color.SetColorRGB(200,20,50)
//sets the new style in the cell
&excelcellrange.SetCellStyle(&excelCellStyle)
//saves the changes in the sheet and close
&boolean =&excelSpreadsheet.Save()
if &boolean
&excelSpreadsheet.Close()
else
msg("Error code:"+&excelSpreadsheet.ErrCode.ToString())
msg("Error description:"+&excelSpreadsheet.ErrDescription.ToString())
endif
endevent
Please note that Excel spreadsheets with .xls and .xlsx extensions are supported.
This module has more features to customize spreadsheets and workbooks than the ExcelDocument data type. But, on the other side, it does not support (by the design of the implementation on which it lies, called POI XSSF in Java) creating spreadsheets with thousands of rows and hundreds of columns.
You may use one or another depending on your needs.
This feature is available in the .NET Generator since GeneXus 18 Upgrade 5