Provides read/write access to Excel .xls files.
Workbook(const char* szRegistrationKey)Provides access to cells and other stuff of a worksheet.
const char* GetName()Cell objects give access to the properties of a single cell.
bool Equals(const FileScribe::Cell* pCell) constUsed for styling cells.
const char* GetFont()RGB color information. Used by the Style class.
Color(uint8_t nRed, uint8_t nGreen, uint8_t nBlue)Represents an embedded picture inside a worksheet.
uint16_t GetX()Provides read/write access to Excel .xls files.
Unassuming constructor.
If you have purchased Number Duck, pass in your registration key here to remove annoying watermarks, otherwise just pass in an empty string or NULL.
Resolute destructor.
Clears this workbook back to defaults. The same result as deleting the object and constructing it again.
Loads a .xls file from disk.
Currently only simple Excel .xls formatted files are supported.
Returns false on error.
A common error in loading is that the file is locked because it is already open in Excel.
Saves the current workbook to disk in Excel .xls format.
Returns false on error.
Eg: pWorkbook->Save("BananaReport.xls");
Returns the number of worksheets available.
Returns a pointer to the Worksheet from the given index.
Returns NULL if the given index is out of range.
Creates a new Worksheet and returns a pointer to it.
If the workbook already has the maximum allowed number of worksheets, this function returns null.
Deletes the Worksheet at the given index.
Returns the number of created styles available.
More styles may be created with the CreateStyle function.
Returns the Style at the given index.
Returns NULL if you give an out of range index like a silly person.
Returns the default Style for this Workbook.
This is a simple wrapper for GetStyleByIndex(0).
Creates a new style and returns a pointer to it.
Using this pointer you can set all the pretties.
Provides access to cells and other stuff of a worksheet.
Returns the name of the worksheet in UTF8.
Sets the name of the worksheet. Returns false if the name is already in use by another Worksheet.
szName is a UTF8 string.
Returns the width of the given column in pixels.
Sets the width of the column in pixels.
Inserts a column before the given one.
The 255th column is removed to make room for it.
Deletes the given column.
Returns the height of the given row in pixels.
Sets the pixel height of the given row of the worksheet.
Inserts a row before the given one.
The 65535th row is removed to make room for it.
Deletes the given row.
Returns the Cell at the address given.
Eg: pWorksheet->GetCell("B5");
Returns the Cell at the zero based coordinates given.
Eg: pWorkSheet->GetCell(1, 4); // same as pWorksheet->GetCell("B5");
Returns the number of pictures embedded in this worksheet.
Returns a pointer to the Picture from the given index.
Returns NULL if the given index is out of range.
Creates a new Picture and returns a pointer to it.
szFileName is the path to a PNG or JPEG file.
Returns NULL if szFileName file cannout be found or is the wrong format.
Deletes the Picture at the given index.
Cell objects give access to the properties of a single cell. This is all pretty straightforward right?
Comparison function, returns true if this cell matches the one given.
Eg: If both cells contain the same number.
Returns the type of the contents of this cell.
Possible types are:
Clears this cell back to a pristine untouched state.
Stores the given string in the cell.
A cell may only store a single type of value at a time, eg: string, float, boolean, formula etc.
Returns the string stored in this cell.
If the cell type is not TYPESTRING this function will return an empty string. Use _GetType to check.
Stores the given float in the cell.
A cell may only store a single type of value at a time, eg: string, float, boolean, formula etc.
Returns the float stored in this cell.
If the cell type is not TYPEFLOAT this function will return 0.0. Use _GetType to check.
Stores the given boolean in the cell.
A cell may only store a single type of value at a time, eg: string, float, boolean, formula etc.
Returns the boolean stored in this cell.
If the cell type is not TYPEBOOLEAN this function will return false. Use _GetType to check.
Stores the given formula in the cell.
A cell may only store a single type of value at a time, eg: string, float, boolean, formula etc.
Eg: pCell->SetFormula("=SUM(A1:A5)");
Returns the formula stored in this cell. The formula will be prefixed with "=".
If the cell type is not TYPEFORMULA this function will return "=". Use _GetType to check.
Gets the current custom Style applied to this cell.
Compare with Workbook::GetDefaultStyle() to see if this cell is using default styling.
Sets the Style used by this cell.
Use Workbook::CreateStyle to create a new style.
Or use Cell::GetStyle or Workbook::GetStyleByIndex to use an existing style.
Returns false on error, usually if you try to pass in a NULL pointer or a Style that comes from a different workbook.
Used for styling cells.
Use Workbook::CreateStyle to create a new style.
Or use Cell::GetStyle or Workbook::GetStyleByIndex to use an existing style.
Returns the name of the current font face used by this Style.
Sets the font face to be used by this Style.
Eg: pStyle->SetFont("Comic Sans MS");
Returns the font size, in pixels, used by this Style.
Sets the font size of this Style, in pixels.
Eg: pStyle->SetSize(10);
Returns the current font color.
Sets the font color to be used by this Style.
Eg: pStyle->SetColor(FileScribe::Color(0xFF, 0x00, 0xFF));
Clears the font color to be used by this Style back to the default.
The default is usually black, but may be different based on the users system settings when viewing the spreadsheet.
Returns the emboldment status for this Style.
Used to set whether the font used by this Style is bold or not.
Eg: pStyle->SetBold(true);
Returns true if the font used by this Style is italicized.
Used to set whether the font used by this Style is italic or not.
Eg: pStyle->SetItalic(true);
Returns the type of underline used by this _Style.
Possible types are:
Sets the type of underline used by this Style.
See Style::GetUnderline for the list of possible underline types.
Eg: pStyle->SetUnderline(FileScribe::Style::UNDERLINE_SINGLE);
Returns the background color.
Sets the background color.
Eg: pStyle->SetBackgroundColor(FileScribe::Color(0x00, 0x00, 0xFF));
Clears the background color.
Note that clear is different from white. The white comes from the users system settings so it could in fact be any color.
RGB color information. Used by the Style class.
Constructor.
Eg: pStyle->SetColor(FileScribe::Color(0x00, 0xFF, 0x00));
Returns true if this Color matches the one given.
Returns the red value of this color.
Sets the red value of this color.
Returns the green value of this color.
Sets the red value of this color.
Returns the blue value of this color.
Sets the blue value of this color.
Returns the this color as a 32bit RGBA int.
Represents an embedded picture inside a worksheet.
Use Workbook::CreatePicture to create a new picture from an image on disk. Or use Workbook::GetPictureByIndex to get an existing picture.
Pictures can only be created from PNG or JPEG files. Existing pictures already embedded in the spreadsheet can be any format.
Returns the column where the top left corner of the picture is anchored.
Sets the column where top left corner of the picture is anchored.
Returns false if an out of bounds column is given.
Returns the row where the top left corner of the picture is anchored.
Sets the row where top left corner of the picture is anchored.
Returns false if an out of bounds row is given.
Returns the horizontal pixel offset of the picture within the cell given by GetX() and GetY().
Sets the horizontal pixel offset of this picture inside the cell.
Returns the vertical pixel offset of the picture within the cell given by GetX() and GetY().
Sets the vertical pixel offset of this picture inside the cell.
Returns the width of the pitcure, in pixels.
Sets the width of the picture, in pixels.
Returns the height of the pitcure, in pixels.
Sets the height of the picture, in pixels.
Returns the binary data for this image.
See GetFormat() for what image format this data is in.
Returns the size of the binary data returned by GetData().
Returns the image format of the data given by GetData().
Possible types are: