The XlsxWorkbook class enables writing xlsx files. More...
The PRIMER JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Type | Description |
| filename (read only) | string | Name of the xlsx file |
Detailed DescriptionThe XlsxWorkbook class provides functions to enable you to create xlsx files. The following simple example shows how to write a xlsx file: |
var workbook = new XlsxWorkbook("C:/temp/test.xlsx");
var worksheet = new XlsxWorksheet(workbook);
worksheet.AddText(0, 0, "Hello world!");
worksheet.AddNumber(1, 0, 1.2345);
worksheet.AddImage(2, 0, "image.png");
workbook.Close();
Constructornew XlsxWorkbook(filename[string])DescriptionCreate a new XlsxWorkbook object for writing xlsx files. |
Filename of the xlsx file you want to write. The file will be overwritten (if it exists).
ReturnsXlsxWorkbook object Return typeXlsxWorkbook |
ExampleTo create a new XlsxWorkbook object to write Xlsx file "/data/test/file.xlsx" var workbook = new XlsxWorkbook("/data/test/file.xlsx");
|
Details of functionsClose()DescriptionClose a Xlsx file |
No arguments
ReturnsNo return value |
ExampleTo close Xlsx file workbook:
workbook.Close();
|