HotXLS 文件

活頁簿檢視、連線與 XML 對應

本參考涵蓋位於儲存格格線之外的可編輯活頁簿中繼資料,這些中繼資料在工作表、範圍、篩選器與套件組件變更時必須保持一致性

傳統自訂檢視

TXLSWorksheet.CustomViews 傳回 TXLSCustomViews,其 Count、 Items、 Invalidate與 SyncToRaw 成員保留有型別與未知的自訂檢視記錄

TXLSCustomView 公開 ViewId、 Zoom、 GridColorIndex、 ActivePane、 ShowPageBreaks、 ShowFormulas、 ShowGridLines、 ShowHeadings、 ShowOutlineSymbols、 ShowZeroValues、 CenterHorizontally、 CenterVertically、 PrintHeadings、 PrintGridLines、 FitToPage、 FilterMode、 AutoFilterVisible、 FrozenPanes、 FrozenNoSplit、 SplitVertically、 SplitHorizontally、 TopLeftRow、 TopLeftColumn、 SplitX、 SplitY、 RightPaneColumn、 BottomPaneRow、 SelectionCount、 Selections、 HorizontalPageBreaks、 VerticalPageBreaks、 HasPageSetup、 PaperSize、 PrintScale、 FirstPageNumber、 FitToPagesWide、 FitToPagesTall、 PageSetupFlags與 HorizontalResolution, VerticalResolution, HeaderMargin, FooterMargin, Copies, FilterFieldCount, FilterActive, FilterCriteria1, FilterCriteria2, FilterOperators, ClearFilterCriteria, RawRecordCount, RawRecordIds, and RawRecordData

TXLSCustomViewCellRange、 TXLSCustomViewCellRanges、 TXLSCustomViewSelectionInfo、 TXLSCustomViewPageBreak與 TXLSCustomViewPageBreaks 承載檢視所擁有的選取與分頁符承載

XLSX 活頁簿視窗

TXLSXWorkbook.WorkbookViews 擁有由 TXLSXWorkbookView 設定的有序 TXLSXWorkbookViewVisibility

TXLSXWorkbookViewAssign, ActiveTab、 FirstSheet、 Visibility、 Minimized、 ShowHorizontalScroll、 ShowVerticalScroll、 ShowSheetTabs、 XWindow、 YWindow、 WindowWidth、 WindowHeight、 TabRatio、 AutoFilterDateGrouping、 UnknownAttributes與 Extensions
TXLSXWorkbookViewsAdd、 Insert、 Delete、 Move、 Clear、 Count與 Items

工作表插入、刪除與移動會重新對應每個視窗的作用中與第一個可見索引標籤,同時保留獨立的幾何與顯示設定

逐窗格選取

TXLSXWorksheet.Selections 傳回 TXLSXSelections; TXLSXSelectionPane 識別目標窗格,每個 TXLSXSelection 儲存 Pane、 ActiveCell、 ActiveCellId與多區域 Sqref

TXLSXSelection.Assign 複製單一選取, TXLSXSelections.Add、 AddSelection、 Assign、 Clear、 Delete、 IndexOfPane、 Count與 Items 則維護有序的工作表檢視集合

連線子模型

TXLSConnection 保留資料庫、Web、文字與 OLAP 中繼資料。其 Web 模型使用 WebParsePre、 WebHtmlTables與 WebTables;其固定文字模型使用 TextSourceFile 與 TextFields;其 OLAP 模型使用 HasOlapProperties、 OlapLocal、 OlapLocalConnection、 OlapLocalRefresh、 OlapSendLocale、 OlapRowDrillCount、 OlapServerFill、 OlapServerNumberFormat、 OlapServerFont、 OlapServerFontColor、 OlapExtraAttributesXml與 OlapChildrenXml

SourceFile 儲存最上層的連線來源, TextSourceFile 儲存獨立的 textPr 匯入來源;空的 TextSourceFile 會為相容性遞補至 SourceFile for compatibility

TXLSWebTableSelectorKind 設定 TXLSWebTableSelector,其 Kind、 Name、 Index、 ExtraAttributesXml、 ChildrenXml、 Assign與 Validate 成員保留具名、索引式與完整資料表選取器

TXLSWebTableSelectors 提供 Add、 AddExisting、 Assign、 Validate、 Delete、 Clear、 Count、 Items、 ExtraAttributesXml與 UnknownChildrenXml

TXLSTextImportFieldType configures TXLSTextImportField設定 FieldType,其 Position、 ExtraAttributesXml、 ChildrenXml、 Assign與 Validate 成員定義單一固定文字欄位

TXLSTextImportFields 提供 Add、 AddExisting、 Assign、 Validate、 Delete、 Clear、 Count、 Items、 ExtraAttributesXml與 UnknownChildrenXml

完整連線成員

TXLSConnection 的通用屬性為 Id、 TypeCode、 SourceFile、 OdcFile、 SingleSignOnId、 KeepAlive、 Interval、 BackgroundRefresh、 RefreshOnLoad、 SaveData、 SavePassword、 NewConnection、 Deleted、 OnlyUseConnectionFile、 ReconnectionMethod、 RefreshedVersion、 MinRefreshableVersion、 ConnectionString、 CommandText、 ServerCommandText、 CommandType、 Parameters與 ExtensionXml

Web 屬性為 WebUrl、 WebPost、 WebEditPage、 WebHtmlFormat、 WebXml、 WebSourceData、 WebConsecutive、 WebFirstRow、 WebXl97、 WebTextDates、 WebXl2000、 WebExtraAttributesXml與 WebChildrenXml

文字屬性為 TextSourceFile、 TextPrompt、 TextDelimited、 TextCodePage、 TextFirstRow、 TextCharacterSet、 TextQualifier、 TextFileType、 TextDecimal、 TextThousands、 TextTab、 TextSpace、 TextComma、 TextSemicolon、 TextConsecutive、 TextDelimiter、 TextExtraAttributesXml與 TextChildrenXml;資料庫保留使用 DbExtraAttributesXml 與 DbChildrenXml

TXLSConnections.Assign 複製集合, IndexOfId 尋找穩定的連線識別碼, RootAttributesXml 加上 UnknownChildrenXml 則保留不支援的根內容

連線參數

TXLSConnectionParameter 使用 Name、 ParameterType、 SqlType、 RefreshOnChange、 Prompt、 CellReference、 IntegerValue、 DoubleValue、 BooleanValue、 StringValue、 ValueKind、 ExtraAttributesXml與 Assign

TXLSConnectionParameters 提供 Add、 AddExisting、 Assign、 Delete、 Clear、 Count與 Items

查詢資料表與欄位

TXLSQueryTable 使用 Assign、 ConnectionId、 ResultTableName、 ResultRange、 RowNumbers、 DisableRefresh、 BackgroundRefresh、 FirstBackgroundRefresh、 RefreshOnLoad、 GrowShrinkType、 FillFormulas、 RemoveDataOnSave、 DisableEdit、 PreserveFormatting、 Intermediate、 AutoFormatId、 ApplyNumberFormats、 ApplyBorderFormats、 ApplyFontFormats、 ApplyPatternFormats、 ApplyAlignmentFormats、 ApplyWidthHeightFormats、 PreserveSortFilterLayout、 FieldIdWrapped、 AdjustColumnWidth、 HeadersInLastRefresh、 MinimumVersion、 UnboundColumnsLeft、 UnboundColumnsRight、 DeletedFields、 SortStateXml、 ExtensionXml、 RefreshExtensionXml與 UnknownChildrenXml, ExtraAttributesXml, RefreshExtraAttributesXml, and RefreshUnknownChildrenXml

TXLSQueryTableField uses Id使用 Name、 TableColumnId、 DataBound、 RowNumbers、 FillFormulas、 Clipped、 ExtraAttributesXml、 Assign與 Validate

TXLSQueryTableFields 提供 Add、 AddExisting、 Assign、 FindById、 FindByTableColumnId、 NextId、 Validate、 Delete與 Clear; Count複製工作表的查詢資料表集合 Items; TXLSQueryTables.Assign copies the worksheet query-table collection

明確的查詢資料表重新整理

不需要呼叫端提供者即可明確重新整理、註冊、原生繫結與外部操作限制,請見自動查詢提供者

TXLSXWorksheet.RefreshQueryTable 依名稱或其以 0 為基數的集合索引選取既有查詢資料表,接受呼叫端自有的 TXLSQueryTableProvider、預設 1,000,000 筆資料列的正數 AMaxRows 上限,以及選用的 TXLSQueryRefreshProgress 回呼

實作 TXLSQueryTableProvider.Fetch(Connection, Query, MaxRows, out Data, var Abort) 回傳 TXLSQueryResultData 記錄,含 ColumnCount 與純量 Variant 值的矩形 Rows; TXLSQueryResultRow 是 variant 陣列, TXLSQueryResultRows 則是這些列的陣列;列不包含既有標頭且必須符合目標寬度,數值、日期、Boolean、字串、錯誤、空值與 null 保留其型別,以 = 開頭的字串仍是常值

提供者收到只在呼叫期間有效的分離連線與查詢中繼資料快照,且必須遵守列數上限;程式庫會拒絕超量列、參差不齊的矩陣、不受支援的值型別、無效寬度,以及超出 1,048,576 列 × 16,384 欄工作表格線的結果,不做截斷

重新整理保留既有標頭與儲存格格式,清除縮小結果的舊資料尾端,調整附加 Excel 資料表與受支援篩選或排序範圍的大小,更新查詢資料表中繼資料,並使相依計算失效;結果區域之外的公式與樣式維持不變

已停用的查詢、已刪除的連線、重疊的合併儲存格或陣列公式、其他資料表或查詢結果、被佔用的擴張儲存格、計算的資料表欄、總計列、列號欄、填公式行為或未繫結欄位,都會在結果儲存格變更前阻止重新整理

進度會在擷取前、套用結果前以及每列套用或清除後回報;在提供者或進度回呼中設定 Abort 即可取消,回傳值 1 代表成功、 0 取消、 -1 失敗,診斷碼 1401 與 1400 在 xlsOperationRefresh 下分別識別取消與失敗

取消,或提供者、驗證或回呼例外,會還原結果儲存格與查詢或資料表中繼資料,包括既有儲存格 handle;明確的呼叫端提供者自行負責其外部存取;受支援的 Windows Text、ADO、ODBC 與 Web 查詢的自動選擇可透過活頁簿派送器取得,而開啟活頁簿或保留 RefreshOnLoad 中繼資料不會呼叫任一提供者路徑

XML 對應與自訂 XML

TXLSXWorkbook.XmlMaps 傳回 TXLSXXmlMaps, TXLSXWorksheet.XmlCellBindings 則傳回工作表繫結集合

TXLSXXmlDataBinding儲存將對應連至自訂 XML 組件的關聯識別碼與重新整理中繼資料 Enabled, DataBindingName, FileBinding, FileBindingName, ConnectionId, DataBindingLoadMode, and ExtensionXml mirror the OOXML dataBinding attributes
TXLSXXmlSchema儲存單一結構描述識別碼、命名空間與保留的結構描述 XML Id, SchemaRef, NamespaceUri, Language, and Xml round-trip the schema part
TXLSXXmlMapStores map identity, root element and namespace, and its DataBinding; import behaviour is configured by RootElement, SchemaId, ShowImportExportValidationErrors, AutoFit, Append, PreserveSortAFLayout儲存對應身分、根元素與命名空間,以及其 PreserveFormat
TXLSXXmlMapsAddSchema、 AddMap、 FindSchema、 FindMap、 DeleteSchema、 DeleteMap、 Clear、 Validate、 SelectionNamespaces與 SchemaCount, Schemas, and MapCount
TXLSXXmlCellBindingMaps one worksheet range to an XPath and XML map identifier; CellReference, XPath, XmlDataType, MapId, XmlCellPropertyId, ConnectionId, and UniqueName 將一個工作表範圍對應至 XPath 與 XML 對應識別碼
TXLSXXmlCellBindingsAdd 多載、 Delete、 Clear、 Validate、 Count與 Items
TXLSXCustomXmlPartAddSchemaRef associates a custom XML item with a schema reference; Xml holds the item payload, ItemId the data-store item identifier, and SchemaRefs 將自訂 XML 項目與結構描述參照關聯

進階複製、HTML 與影像成員

TXLSXRangeClonePart、 TXLSXRangeCloneParts與 TXLSXRangeCloneSourceCounts 定義感知相依性的範圍複製。 TXLSXWorksheet.CaptureRangeCloneSourceCounts、 AuthorizeRepeatedDisjointRangeClones、 ResizeTableRows與 TileRangeAxisMetadata 是編譯式報表展開與自訂參與者所使用的進階結構編輯掛鉤

TXLSXHtmlExportSessionState 描述 TXLSXHtmlExportSession;使用 BeginExport、 ExportNextSheet與 Reset,然後檢查 State、 Active、 ExportedSheetCount與 TotalSheetCount。設定 TXLSXHtmlExportOptions.IncludeDrawings 可將支援的工作表物件轉譯至 HTML 工作階段

TXLSXImage 為共用的 PDF、SVG、HTML、點陣圖與中繼檔轉譯公開 Gamma、 ShadowColor、 ShadowOpacity、 ShadowBlur、 ShadowOffsetX與 ShadowOffsetY for shared PDF, SVG, HTML, bitmap, and metafile rendering

另請參閱