NXOpen C++ Reference Guide
|
Represents a class for external spreadsheet. More...
Public Member Functions | |
int | AddWorksheet (const NXString &sheetname) |
Add worksheet in excel. More... | |
int | AddWorksheet (const char *sheetname) |
Add worksheet in excel. More... | |
void | AppendRow (int worksheet, const std::vector< NXOpen::SpreadsheetCellData * > &data) |
Appends a new row of data to the Excel file. More... | |
void | AutofitColumns (int worksheet, int colstart, int colend) |
Autofits columns in excel. More... | |
void | CloseFile (bool save) |
Closes an excel file with an option to save the file before close. More... | |
int | GetNumberofsheets () |
GetWorkSheetCount in excel. More... | |
int | GetWorksheetIndex (const NXString &sheetname) |
Returns worksheet ID. More... | |
int | GetWorksheetIndex (const char *sheetname) |
Returns worksheet ID. More... | |
void | InsertImage (int worksheet, int rowstart, int colstart, int rowend, int colend, const NXString &imagepath) |
Inserts image in specified range of the spreadsheet. More... | |
void | InsertImage (int worksheet, int rowstart, int colstart, int rowend, int colend, const char *imagepath) |
Inserts image in specified range of the spreadsheet. More... | |
void | MergeCellRange (int worksheet, int rowstart, int colstart, int rowend, int colend) |
Merges cells to the specified range of the spreadsheet. More... | |
void | ReadNamedRange (int worksheet, const NXString &rangename, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
Reads a named range. More... | |
void | ReadNamedRange (int worksheet, const char *rangename, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
Reads a named range. More... | |
void | ReadRange (int worksheet, int rowstart, int colstart, int rowend, int colend, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
Reads the spreadsheet file and returns the data in the specified ranges of the cells. More... | |
void | SaveAs (int worksheet, const NXString &fileName, NXOpen::ExcelFileFormatT fileFormat) |
Saves excel file. More... | |
void | SaveAs (int worksheet, const char *fileName, NXOpen::ExcelFileFormatT fileFormat) |
Saves excel file. More... | |
void | SetRangeAlignment (int worksheet, int rowstart, int colstart, int rowend, int colend, NXOpen::AlignmentStyleT alignStyle, NXOpen::TextAlignmentModeT alignMode) |
Sets range alignment. More... | |
void | SetRangeBackgroundColor (int worksheet, int rowstart, int colstart, int rowend, int colend, const std::vector< double > &cellBackgroundColor) |
Sets the background color to the specified range of the spreadsheet. More... | |
void | SetRangeBordersProperty (int worksheet, int rowstart, int colstart, int rowend, int colend, const std::vector< double > &cellBorderColor, NXOpen::BorderLineStyleT borderLineStyle) |
Sets the borders property to the specified range of the spreadsheet. More... | |
void | SetRangeFontProperty (int worksheet, int rowstart, int colstart, int rowend, int colend, const NXString &fontName, int fontSize, const std::vector< double > &cellFontColor, bool bold, bool italic, NXOpen::UnderlineStyleT underline, bool strikethrough, bool superscript, bool subscript) |
Sets the font property to the specified range of the spreadsheet. More... | |
void | SetRangeFontProperty (int worksheet, int rowstart, int colstart, int rowend, int colend, const char *fontName, int fontSize, const std::vector< double > &cellFontColor, bool bold, bool italic, NXOpen::UnderlineStyleT underline, bool strikethrough, bool superscript, bool subscript) |
Sets the font property to the specified range of the spreadsheet. More... | |
void | SetSheetTabBackgroundColor (int worksheet, const std::vector< double > &tabBackgroundColor) |
Sets the background color to the specified worksheet tab of the spreadsheet. More... | |
void | SetWorksheetName (int worksheet, const NXString &sheetname) |
Add worksheet name in spreadsheet. More... | |
void | SetWorksheetName (int worksheet, const char *sheetname) |
Add worksheet name in spreadsheet. More... | |
void | WriteRange (const std::vector< NXOpen::SpreadsheetCellData * > &data) |
Writes the data to the specified range of the spreadsheet. More... | |
virtual | ~SpreadsheetExternal () |
Free resources associated with the instance. More... | |
Public Member Functions inherited from NXOpen::TransientObject | |
void * | GetHandle () |
Handle of the internal object represented by this object. More... | |
Represents a class for external spreadsheet.
To call functions from this class, use SpreadsheetExternal object returned by NXOpen::SpreadsheetManager::OpenFile .
Usable only on Windows
Created in NX11.0.0.
|
virtual |
Free resources associated with the instance.
After this method is called, it is illegal to use the object. In .NET, this method is automatically called when the object is deleted by the garbage collector.
Created in NX11.0.0.
License requirements : None
int NXOpen::SpreadsheetExternal::AddWorksheet | ( | const NXString & | sheetname | ) |
Add worksheet in excel.
sheetname | Sheet name to be set |
int NXOpen::SpreadsheetExternal::AddWorksheet | ( | const char * | sheetname | ) |
Add worksheet in excel.
sheetname | Sheet name to be set |
void NXOpen::SpreadsheetExternal::AppendRow | ( | int | worksheet, |
const std::vector< NXOpen::SpreadsheetCellData * > & | data | ||
) |
Appends a new row of data to the Excel file.
Created in NX11.0.0.
License requirements : None
worksheet | Worksheet ID |
data | The append data list. |
void NXOpen::SpreadsheetExternal::AutofitColumns | ( | int | worksheet, |
int | colstart, | ||
int | colend | ||
) |
Autofits columns in excel.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
colstart | Starting column |
colend | Ending column |
void NXOpen::SpreadsheetExternal::CloseFile | ( | bool | save | ) |
Closes an excel file with an option to save the file before close.
Created in NX11.0.0.
License requirements : None
save | If true, the file will be saved. If false, the file will not be saved. |
int NXOpen::SpreadsheetExternal::GetNumberofsheets | ( | ) |
GetWorkSheetCount in excel.
int NXOpen::SpreadsheetExternal::GetWorksheetIndex | ( | const NXString & | sheetname | ) |
Returns worksheet ID.
sheetname | Sheet name to get Index |
int NXOpen::SpreadsheetExternal::GetWorksheetIndex | ( | const char * | sheetname | ) |
Returns worksheet ID.
sheetname | Sheet name to get Index |
void NXOpen::SpreadsheetExternal::InsertImage | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
const NXString & | imagepath | ||
) |
Inserts image in specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
imagepath | Image path to be inserted |
void NXOpen::SpreadsheetExternal::InsertImage | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
const char * | imagepath | ||
) |
Inserts image in specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
imagepath | Image path to be inserted |
void NXOpen::SpreadsheetExternal::MergeCellRange | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend | ||
) |
Merges cells to the specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
void NXOpen::SpreadsheetExternal::ReadNamedRange | ( | int | worksheet, |
const NXString & | rangename, | ||
std::vector< NXOpen::SpreadsheetCellData * > & | v2 | ||
) |
Reads a named range.
Created in NX11.0.0.
License requirements : None
worksheet | worksheet ID |
rangename | Range name |
v2 | Data list for given range name |
void NXOpen::SpreadsheetExternal::ReadNamedRange | ( | int | worksheet, |
const char * | rangename, | ||
std::vector< NXOpen::SpreadsheetCellData * > & | v2 | ||
) |
Reads a named range.
Created in NX11.0.0.
License requirements : None
worksheet | worksheet ID |
rangename | Range name |
v2 | Data list for given range name |
void NXOpen::SpreadsheetExternal::ReadRange | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
std::vector< NXOpen::SpreadsheetCellData * > & | v2 | ||
) |
Reads the spreadsheet file and returns the data in the specified ranges of the cells.
Created in NX11.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
v2 | Data list for given range |
void NXOpen::SpreadsheetExternal::SaveAs | ( | int | worksheet, |
const NXString & | fileName, | ||
NXOpen::ExcelFileFormatT | fileFormat | ||
) |
Saves excel file.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
fileName | File name to be set |
fileFormat | File format to be set |
void NXOpen::SpreadsheetExternal::SaveAs | ( | int | worksheet, |
const char * | fileName, | ||
NXOpen::ExcelFileFormatT | fileFormat | ||
) |
Saves excel file.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
fileName | File name to be set |
fileFormat | File format to be set |
void NXOpen::SpreadsheetExternal::SetRangeAlignment | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
NXOpen::AlignmentStyleT | alignStyle, | ||
NXOpen::TextAlignmentModeT | alignMode | ||
) |
Sets range alignment.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
alignStyle | Align Style |
alignMode | Align Mode |
void NXOpen::SpreadsheetExternal::SetRangeBackgroundColor | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
const std::vector< double > & | cellBackgroundColor | ||
) |
Sets the background color to the specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
cellBackgroundColor | Array of 3 RGB values |
void NXOpen::SpreadsheetExternal::SetRangeBordersProperty | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
const std::vector< double > & | cellBorderColor, | ||
NXOpen::BorderLineStyleT | borderLineStyle | ||
) |
Sets the borders property to the specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
cellBorderColor | Array of 3 RGB values |
borderLineStyle | Border line style |
void NXOpen::SpreadsheetExternal::SetRangeFontProperty | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
const NXString & | fontName, | ||
int | fontSize, | ||
const std::vector< double > & | cellFontColor, | ||
bool | bold, | ||
bool | italic, | ||
NXOpen::UnderlineStyleT | underline, | ||
bool | strikethrough, | ||
bool | superscript, | ||
bool | subscript | ||
) |
Sets the font property to the specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
fontName | Sheet name to be set |
fontSize | font size |
cellFontColor | Array of 3 RGB values |
bold | If true, the letters will be bold. |
italic | If true, the letters will be bItalic. |
underline | underline |
strikethrough | If true, the letters will be bStrikethrough. |
superscript | If true, the letters will be bSuperscript. |
subscript | If true, the letters will be bSubscript. |
void NXOpen::SpreadsheetExternal::SetRangeFontProperty | ( | int | worksheet, |
int | rowstart, | ||
int | colstart, | ||
int | rowend, | ||
int | colend, | ||
const char * | fontName, | ||
int | fontSize, | ||
const std::vector< double > & | cellFontColor, | ||
bool | bold, | ||
bool | italic, | ||
NXOpen::UnderlineStyleT | underline, | ||
bool | strikethrough, | ||
bool | superscript, | ||
bool | subscript | ||
) |
Sets the font property to the specified range of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
rowstart | Starting row of the range |
colstart | Starting column of the range |
rowend | Ending row of the range |
colend | Ending column of the range |
fontName | Sheet name to be set |
fontSize | font size |
cellFontColor | Array of 3 RGB values |
bold | If true, the letters will be bold. |
italic | If true, the letters will be bItalic. |
underline | underline |
strikethrough | If true, the letters will be bStrikethrough. |
superscript | If true, the letters will be bSuperscript. |
subscript | If true, the letters will be bSubscript. |
void NXOpen::SpreadsheetExternal::SetSheetTabBackgroundColor | ( | int | worksheet, |
const std::vector< double > & | tabBackgroundColor | ||
) |
Sets the background color to the specified worksheet tab of the spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
tabBackgroundColor | Array of 3 RGB values |
void NXOpen::SpreadsheetExternal::SetWorksheetName | ( | int | worksheet, |
const NXString & | sheetname | ||
) |
Add worksheet name in spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
sheetname | Sheet name to be set |
void NXOpen::SpreadsheetExternal::SetWorksheetName | ( | int | worksheet, |
const char * | sheetname | ||
) |
Add worksheet name in spreadsheet.
Created in NX1847.0.0.
License requirements : None
worksheet | Worksheet ID |
sheetname | Sheet name to be set |
void NXOpen::SpreadsheetExternal::WriteRange | ( | const std::vector< NXOpen::SpreadsheetCellData * > & | data | ) |
Writes the data to the specified range of the spreadsheet.
Created in NX11.0.0.
License requirements : None
data | The data list to be written to external Excel worksheet. |