NXOpen .NET Reference Guide
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Protected Member Functions | List of all members
NXOpen.SpreadsheetExternal Class Reference

Represents a class for external spreadsheet. More...

Inheritance diagram for NXOpen.SpreadsheetExternal:
NXOpen.TransientObject NXOpen.Utilities.NXRemotableObject IDisposable IMessageSink

Public Member Functions

unsafe int AddWorksheet (string sheetname)
 Add worksheet in excel. More...
 
unsafe void AppendRow (int worksheet, NXOpen.SpreadsheetCellData[] data)
 Appends a new row of data to the Excel file. More...
 
unsafe void AutofitColumns (int worksheet, int colstart, int colend)
 Autofits columns in excel. More...
 
unsafe void CloseFile (bool save)
 Closes an excel file with an option to save the file before close. More...
 
unsafe int GetNumberofsheets ()
 GetWorkSheetCount in excel. More...
 
unsafe int GetWorksheetIndex (string sheetname)
 Returns worksheet ID. More...
 
unsafe void InsertImage (int worksheet, int rowstart, int colstart, int rowend, int colend, string imagepath)
 Inserts image in specified range of the spreadsheet. More...
 
unsafe void MergeCellRange (int worksheet, int rowstart, int colstart, int rowend, int colend)
 Merges cells to the specified range of the spreadsheet. More...
 
unsafe void ReadNamedRange (int worksheet, string rangename, out NXOpen.SpreadsheetCellData[] v2)
 Reads a named range. More...
 
unsafe void ReadRange (int worksheet, int rowstart, int colstart, int rowend, int colend, out NXOpen.SpreadsheetCellData[] v2)
 Reads the spreadsheet file and returns the data in the specified ranges of the cells. More...
 
unsafe void SaveAs (int worksheet, string fileName, NXOpen.ExcelFileFormatT fileFormat)
 Saves excel file. More...
 
unsafe void SetRangeAlignment (int worksheet, int rowstart, int colstart, int rowend, int colend, NXOpen.AlignmentStyleT alignStyle, NXOpen.TextAlignmentModeT alignMode)
 Sets range alignment. More...
 
unsafe void SetRangeBackgroundColor (int worksheet, int rowstart, int colstart, int rowend, int colend, double[] cellBackgroundColor)
 Sets the background color to the specified range of the spreadsheet. More...
 
unsafe void SetRangeBordersProperty (int worksheet, int rowstart, int colstart, int rowend, int colend, double[] cellBorderColor, NXOpen.BorderLineStyleT borderLineStyle)
 Sets the borders property to the specified range of the spreadsheet. More...
 
unsafe void SetRangeFontProperty (int worksheet, int rowstart, int colstart, int rowend, int colend, string fontName, int fontSize, 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...
 
unsafe void SetSheetTabBackgroundColor (int worksheet, double[] tabBackgroundColor)
 Sets the background color to the specified worksheet tab of the spreadsheet. More...
 
unsafe void SetWorksheetName (int worksheet, string sheetname)
 Add worksheet name in spreadsheet. More...
 
unsafe void WriteRange (NXOpen.SpreadsheetCellData[] data)
 Writes the data to the specified range of the spreadsheet. More...
 
- Public Member Functions inherited from NXOpen.TransientObject
void Dispose ()
 Frees the object from memory. More...
 
void PrintTestData (String variableName)
 <exclude> More...
 
void PrintTestData (String variableName, int lineNumber)
 <exclude> More...
 
new string ToString ()
 Returns a String that represents the current Object. More...
 
- Public Member Functions inherited from NXOpen.Utilities.NXRemotableObject
IMessageCtrl AsyncProcessMessage (IMessage msg, IMessageSink replySink)
 Asynchronously processes the given message. More...
 
IMessage SyncProcessMessage (IMessage msg)
 Synchronously processes the given message. More...
 

Protected Member Functions

override void FreeResource ()
 Free resources associated with the instance. More...
 

Additional Inherited Members

- Properties inherited from NXOpen.TransientObject
IntPtr Handle [get]
 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

Member Function Documentation

unsafe int NXOpen.SpreadsheetExternal.AddWorksheet ( string  sheetname)
inline

Add worksheet in excel.

Created in NX1847.0.0

License requirements: None.

Parameters
sheetnameSheet name to be set
Returns
Worksheet ID
unsafe void NXOpen.SpreadsheetExternal.AppendRow ( int  worksheet,
NXOpen.SpreadsheetCellData[]  data 
)
inline

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.
unsafe void NXOpen.SpreadsheetExternal.AutofitColumns ( int  worksheet,
int  colstart,
int  colend 
)
inline

Autofits columns in excel.

Created in NX1847.0.0

License requirements: None.

Parameters
worksheetWorksheet ID
colstartStarting column
colendEnding column
unsafe void NXOpen.SpreadsheetExternal.CloseFile ( bool  save)
inline

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.
override void NXOpen.SpreadsheetExternal.FreeResource ( )
inlineprotectedvirtual

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.

Implements NXOpen.TransientObject.

unsafe int NXOpen.SpreadsheetExternal.GetNumberofsheets ( )
inline

GetWorkSheetCount in excel.

Created in NX1847.0.0

License requirements: None.

Returns
num Of sheets
unsafe int NXOpen.SpreadsheetExternal.GetWorksheetIndex ( string  sheetname)
inline

Returns worksheet ID.

Created in NX11.0.0

License requirements: None.

Parameters
sheetnameSheet name to get Index
Returns
worksheet ID
unsafe void NXOpen.SpreadsheetExternal.InsertImage ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend,
string  imagepath 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.MergeCellRange ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.ReadNamedRange ( int  worksheet,
string  rangename,
out NXOpen.SpreadsheetCellData[]  v2 
)
inline

Reads a named range.

Created in NX11.0.0

License requirements: None.

Parameters
worksheetworksheet ID
rangenameRange name
v2Data list for given range name
unsafe void NXOpen.SpreadsheetExternal.ReadRange ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend,
out NXOpen.SpreadsheetCellData[]  v2 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.SaveAs ( int  worksheet,
string  fileName,
NXOpen.ExcelFileFormatT  fileFormat 
)
inline

Saves excel file.

Created in NX1847.0.0

License requirements: None.

Parameters
worksheetWorksheet ID
fileNameFile name to be set
fileFormatFile format to be set
unsafe void NXOpen.SpreadsheetExternal.SetRangeAlignment ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend,
NXOpen.AlignmentStyleT  alignStyle,
NXOpen.TextAlignmentModeT  alignMode 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.SetRangeBackgroundColor ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend,
double[]  cellBackgroundColor 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.SetRangeBordersProperty ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend,
double[]  cellBorderColor,
NXOpen.BorderLineStyleT  borderLineStyle 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.SetRangeFontProperty ( int  worksheet,
int  rowstart,
int  colstart,
int  rowend,
int  colend,
string  fontName,
int  fontSize,
double[]  cellFontColor,
bool  bold,
bool  italic,
NXOpen.UnderlineStyleT  underline,
bool  strikethrough,
bool  superscript,
bool  subscript 
)
inline

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.
unsafe void NXOpen.SpreadsheetExternal.SetSheetTabBackgroundColor ( int  worksheet,
double[]  tabBackgroundColor 
)
inline

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
unsafe void NXOpen.SpreadsheetExternal.SetWorksheetName ( int  worksheet,
string  sheetname 
)
inline

Add worksheet name in spreadsheet.

Created in NX1847.0.0

License requirements: None.

Parameters
worksheetWorksheet ID
sheetnameSheet name to be set
unsafe void NXOpen.SpreadsheetExternal.WriteRange ( NXOpen.SpreadsheetCellData[]  data)
inline

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.