NXOpen C++ Reference Guide
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
NXOpen::SpreadsheetExternal Class Reference

Represents a class for external spreadsheet. More...

Inheritance diagram for NXOpen::SpreadsheetExternal:
NXOpen::TransientObject

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

virtual NXOpen::SpreadsheetExternal::~SpreadsheetExternal ( )
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

Member Function Documentation

int NXOpen::SpreadsheetExternal::AddWorksheet ( const NXString sheetname)

Add worksheet in excel.

Returns
Worksheet ID
Created in NX1847.0.0.

License requirements : None
Parameters
sheetnameSheet name to be set
int NXOpen::SpreadsheetExternal::AddWorksheet ( const char *  sheetname)

Add worksheet in excel.

Returns
Worksheet ID
Created in NX1847.0.0.

License requirements : None
Parameters
sheetnameSheet 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

Parameters
worksheetWorksheet ID
dataThe 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

Parameters
worksheetWorksheet ID
colstartStarting column
colendEnding 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

Parameters
saveIf true, the file will be saved. If false, the file will not be saved.
int NXOpen::SpreadsheetExternal::GetNumberofsheets ( )

GetWorkSheetCount in excel.

Returns
num Of sheets
Created in NX1847.0.0.

License requirements : None
int NXOpen::SpreadsheetExternal::GetWorksheetIndex ( const NXString sheetname)

Returns worksheet ID.

Returns
worksheet ID
Created in NX11.0.0.

License requirements : None
Parameters
sheetnameSheet name to get Index
int NXOpen::SpreadsheetExternal::GetWorksheetIndex ( const char *  sheetname)

Returns worksheet ID.

Returns
worksheet ID
Created in NX11.0.0.

License requirements : None
Parameters
sheetnameSheet 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
imagepathImage 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
imagepathImage 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding 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

Parameters
worksheetworksheet ID
rangenameRange name
v2Data 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

Parameters
worksheetworksheet ID
rangenameRange name
v2Data 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
v2Data 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

Parameters
worksheetWorksheet ID
fileNameFile name to be set
fileFormatFile 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

Parameters
worksheetWorksheet ID
fileNameFile name to be set
fileFormatFile 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
alignStyleAlign Style
alignModeAlign 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
cellBackgroundColorArray 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
cellBorderColorArray of 3 RGB values
borderLineStyleBorder 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
fontNameSheet name to be set
fontSizefont size
cellFontColorArray of 3 RGB values
boldIf true, the letters will be bold.
italicIf true, the letters will be bItalic.
underlineunderline
strikethroughIf true, the letters will be bStrikethrough.
superscriptIf true, the letters will be bSuperscript.
subscriptIf 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

Parameters
worksheetWorksheet ID
rowstartStarting row of the range
colstartStarting column of the range
rowendEnding row of the range
colendEnding column of the range
fontNameSheet name to be set
fontSizefont size
cellFontColorArray of 3 RGB values
boldIf true, the letters will be bold.
italicIf true, the letters will be bItalic.
underlineunderline
strikethroughIf true, the letters will be bStrikethrough.
superscriptIf true, the letters will be bSuperscript.
subscriptIf 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

Parameters
worksheetWorksheet ID
tabBackgroundColorArray 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

Parameters
worksheetWorksheet ID
sheetnameSheet 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

Parameters
worksheetWorksheet ID
sheetnameSheet 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

Parameters
dataThe data list to be written to external Excel worksheet.

The documentation for this class was generated from the following file:
Copyright 2019 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.