|
NX Open C++ 参考指南 2406 v1.1
|
外部电子表格接口 更多...
#include <SpreadsheetExternal.hxx>
Public 成员函数 | |
| int | AddWorksheet (const char *sheetname) |
| int | AddWorksheet (const NXString &sheetname) |
| void | AppendRow (int worksheet, const std::vector< NXOpen::SpreadsheetCellData * > &data) |
| void | AutofitColumns (int worksheet, int colstart, int colend) |
| void | CloseFile (bool save) |
| void | DeleteColumn (int worksheet, int columnnumber) |
| void | DeleteRange (int worksheet, int columnstart, int columnend, int rowstart, int rowend) |
| void | DeleteRow (int worksheet, int rownumber) |
| int | GetNumberofsheets () |
| int | GetWorksheetIndex (const char *sheetname) |
| int | GetWorksheetIndex (const NXString &sheetname) |
| void | GetWorksheetNames (std::vector< NXString > &sheetnames) |
| void | InsertImage (int worksheet, int rowstart, int colstart, int rowend, int colend, const char *imagepath) |
| void | InsertImage (int worksheet, int rowstart, int colstart, int rowend, int colend, const NXString &imagepath) |
| void | MergeCellRange (int worksheet, int rowstart, int colstart, int rowend, int colend) |
| void | ReadNamedRange (int worksheet, const char *rangename, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
| void | ReadNamedRange (int worksheet, const NXString &rangename, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
| void | ReadRange (int worksheet, int rowstart, int colstart, int rowend, int colend, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
| void | ReadSpreadsheetRange (int worksheet, int rowstart, int colstart, int rowend, int colend, std::vector< NXOpen::SpreadsheetCellData * > &v2) |
| void | SaveAs (int worksheet, const char *fileName, NXOpen::ExcelFileFormatT fileFormat) |
| void | SaveAs (int worksheet, const NXString &fileName, NXOpen::ExcelFileFormatT fileFormat) |
| void | SetRangeAlignment (int worksheet, int rowstart, int colstart, int rowend, int colend, NXOpen::AlignmentStyleT alignStyle, NXOpen::TextAlignmentModeT alignMode) |
| void | SetRangeBackgroundColor (int worksheet, int rowstart, int colstart, int rowend, int colend, const std::vector< double > &cellBackgroundColor) |
| void | SetRangeBordersProperty (int worksheet, int rowstart, int colstart, int rowend, int colend, const std::vector< double > &cellBorderColor, NXOpen::BorderLineStyleT borderLineStyle) |
| 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) |
| 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) |
| void | SetSheetTabBackgroundColor (int worksheet, const std::vector< double > &tabBackgroundColor) |
| void | SetWorksheetName (int worksheet, const char *sheetname) |
| void | SetWorksheetName (int worksheet, const NXString &sheetname) |
| void | WriteRange (const std::vector< NXOpen::SpreadsheetCellData * > &data) |
| void | WriteSpreadsheetRange (int worksheet, int rowstart, int colstart, int rowend, int colend, const std::vector< NXOpen::SpreadsheetCellData * > &data) |
| virtual | ~SpreadsheetExternal () |
| Public 成员函数 继承自 NXOpen::TransientObject | |
| void * | GetHandle () |
外部电子表格接口
表示外部电子表格的类。 要调用此类的函数,请使用 SpreadsheetExternal 对象,该对象由 NXOpen::SpreadsheetManager::OpenFile 返回。
仅在 Windows 上可用
创建于 NX11.0.0.
|
virtual |
释放与实例相关的资源。调用此方法后,使用该对象将不合法。在.NET中,当对象被垃圾回收器删除时,此方法会自动调用。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| int NXOpen::SpreadsheetExternal::AddWorksheet | ( | const char * | sheetname | ) |
Add worksheet in excel.
| sheetname | Sheet name to be set |
| int NXOpen::SpreadsheetExternal::AddWorksheet | ( | const NXString & | sheetname | ) |
Add worksheet in excel.
| sheetname | Sheet name to be set |
| void NXOpen::SpreadsheetExternal::AppendRow | ( | int | worksheet, |
| const std::vector< NXOpen::SpreadsheetCellData * > & | data ) |
向Excel文件追加新的数据行。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| worksheet | 工作表ID |
| data | 要追加的数据列表。 |
| void NXOpen::SpreadsheetExternal::AutofitColumns | ( | int | worksheet, |
| int | colstart, | ||
| int | colend ) |
Autofits columns in excel.
Usable only on Windows
Created in NX1847.0.0.
License requirements : None
| worksheet | Worksheet ID |
| colstart | Starting column |
| colend | Ending column |
| void NXOpen::SpreadsheetExternal::CloseFile | ( | bool | save | ) |
关闭Excel文件,并可选择在关闭前保存文件。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| save | 如果为true,则保存文件;如果为false,则不保存文件。 |
| void NXOpen::SpreadsheetExternal::DeleteColumn | ( | int | worksheet, |
| int | columnnumber ) |
Delete column.
Usable only on Windows
Created in NX1899.0.0.
License requirements : None
| worksheet | Worksheet ID |
| columnnumber | Column to be deleted |
| void NXOpen::SpreadsheetExternal::DeleteRange | ( | int | worksheet, |
| int | columnstart, | ||
| int | columnend, | ||
| int | rowstart, | ||
| int | rowend ) |
删除单元格范围。
仅在Windows上可用
创建于NX1899.0.0。
许可要求:无
| worksheet | 工作表ID |
| columnstart | 起始删除列 |
| columnend | 结束删除列 |
| rowstart | 起始删除行 |
| rowend | 结束删除行 |
| void NXOpen::SpreadsheetExternal::DeleteRow | ( | int | worksheet, |
| int | rownumber ) |
Delete row.
Usable only on Windows
Created in NX1899.0.0.
License requirements : None
| worksheet | Worksheet ID |
| rownumber | Row to be deleted |
| int NXOpen::SpreadsheetExternal::GetNumberofsheets | ( | ) |
GetWorkSheetCount in excel.
| int NXOpen::SpreadsheetExternal::GetWorksheetIndex | ( | const char * | sheetname | ) |
返回工作表ID。
| sheetname | 要获取索引的工作表名称 |
| int NXOpen::SpreadsheetExternal::GetWorksheetIndex | ( | const NXString & | sheetname | ) |
返回工作表ID。
| sheetname | 要获取索引的工作表名称 |
| void NXOpen::SpreadsheetExternal::GetWorksheetNames | ( | std::vector< NXString > & | sheetnames | ) |
返回电子表格中现有工作表名称列表。
仅在Windows上可用
创建于NX1899.0.0。
许可要求:无
| sheetnames | 指定电子表格中的工作表名称列表 |
| 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.
Usable only on Windows
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 NXString & | imagepath ) |
Inserts image in specified range of the spreadsheet.
Usable only on Windows
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.
Usable only on Windows
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 char * | rangename, | ||
| std::vector< NXOpen::SpreadsheetCellData * > & | v2 ) |
读取命名范围。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| worksheet | 工作表ID |
| rangename | 范围名称 |
| v2 | 给定范围名称的数据列表 |
| void NXOpen::SpreadsheetExternal::ReadNamedRange | ( | int | worksheet, |
| const NXString & | rangename, | ||
| std::vector< NXOpen::SpreadsheetCellData * > & | v2 ) |
读取命名范围。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| worksheet | 工作表ID |
| rangename | 范围名称 |
| v2 | 给定范围名称的数据列表 |
| void NXOpen::SpreadsheetExternal::ReadRange | ( | int | worksheet, |
| int | rowstart, | ||
| int | colstart, | ||
| int | rowend, | ||
| int | colend, | ||
| std::vector< NXOpen::SpreadsheetCellData * > & | v2 ) |
按行读取电子表格文件,并返回指定单元格范围内的数据。返回的数据列表前五个索引包含工作表、行起始、列起始和列结束的整数值。实际数据(如果有)从第六个索引开始存储,且所有值均为字符串类型。工作表的行和列从索引1开始。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| worksheet | 工作表ID |
| rowstart | 范围起始行 |
| colstart | 范围起始列 |
| rowend | 范围结束行 |
| colend | 范围结束列 |
| v2 | 给定范围的数据列表 |
| void NXOpen::SpreadsheetExternal::ReadSpreadsheetRange | ( | int | worksheet, |
| int | rowstart, | ||
| int | colstart, | ||
| int | rowend, | ||
| int | colend, | ||
| std::vector< NXOpen::SpreadsheetCellData * > & | v2 ) |
按行读取电子表格文件并返回指定单元格范围内的数据。 与NXOpen::SpreadsheetExternal::ReadRange 不同,此方法返回的列表第一个值包含实际数据并保留数据类型信息。 工作表的行和列从索引1开始。
仅在Windows上可用
创建于NX1899.0.0。
许可要求:无
| worksheet | 工作表ID |
| rowstart | 范围起始行 |
| colstart | 范围起始列 |
| rowend | 范围结束行 |
| colend | 范围结束列 |
| v2 | 给定范围的数据列表 |
| void NXOpen::SpreadsheetExternal::SaveAs | ( | int | worksheet, |
| const char * | fileName, | ||
| NXOpen::ExcelFileFormatT | fileFormat ) |
Saves excel file.
Usable only on Windows
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 NXString & | fileName, | ||
| NXOpen::ExcelFileFormatT | fileFormat ) |
Saves excel file.
Usable only on Windows
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.
Usable only on Windows
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 ) |
设置电子表格指定范围的背景颜色。
仅在Windows上可用
创建于NX1847.0.0。
许可要求:无
| worksheet | 工作表ID |
| rowstart | 范围起始行 |
| colstart | 范围起始列 |
| rowend | 范围结束行 |
| colend | 范围结束列 |
| cellBackgroundColor | 3个RGB值的数组 |
| 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.
Usable only on Windows
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 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.
Usable only on Windows
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 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.
Usable only on Windows
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.
Usable only on Windows
Created in NX1847.0.0.
License requirements : None
| worksheet | Worksheet ID |
| tabBackgroundColor | Array of 3 RGB values |
| void NXOpen::SpreadsheetExternal::SetWorksheetName | ( | int | worksheet, |
| const char * | sheetname ) |
Add worksheet name in spreadsheet.
Usable only on Windows
Created in NX1847.0.0.
License requirements : None
| worksheet | Worksheet ID |
| sheetname | Sheet name to be set |
| void NXOpen::SpreadsheetExternal::SetWorksheetName | ( | int | worksheet, |
| const NXString & | sheetname ) |
Add worksheet name in spreadsheet.
Usable only on Windows
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 | ) |
将数据写入电子表格的指定范围。数据列表的前五个值是包含范围信息的整数,如工作表ID、范围起始行、范围起始列、范围结束行和范围结束列。工作表的行和列从索引1开始。
仅在Windows上可用
创建于NX11.0.0。
许可要求:无
| data | 要写入外部Excel工作表的数据列表。 |
| void NXOpen::SpreadsheetExternal::WriteSpreadsheetRange | ( | int | worksheet, |
| int | rowstart, | ||
| int | colstart, | ||
| int | rowend, | ||
| int | colend, | ||
| const std::vector< NXOpen::SpreadsheetCellData * > & | data ) |
将数据写入电子表格的指定范围。 与NXOpen::SpreadsheetExternal::WriteRange 不同,无需在数据列表中传递范围信息。 工作表的行和列从索引1开始。
仅在Windows上可用
创建于NX1899.0.0。
许可要求:无
| worksheet | 工作表ID |
| rowstart | 范围起始行 |
| colstart | 范围起始列 |
| rowend | 范围结束行 |
| colend | 范围结束列 |
| data | 要写入外部Excel工作表的数据列表。 |