通過 Python 將 XBRL 轉換為 XLSX
XBRL 到 Microsoft® Excel XLSX 格式的轉換,無需安裝 Microsoft Office。
Aspose.Finance 通過 .NET 為 Python 是一種API處理XBRL、iXBRL格式,開發人員可以輕鬆構建業務流程管理、財務分析和報告軟件應用程序來轉換、創建、讀取、查看和驗證XBRL和iXBRL與財務相關的文件。
如何將 XBRL 轉換為 XLSX
- 使用 XbrlDocument 類加載輸入 XBRL 文件。2. 通過選擇相關的 SaveFormat.XSLX 為輸出文件設置 SaveOptions。 3.通過提供目標文件和相關的SaveOptions作為參數來調用save方法。
轉換要求
要繼續進行 XBRL 到 XLSX 的轉換,請確保您具有以下先決條件。
- 基於 Microsoft Windows 或 Linux 的操作系統。- Python 3.5 或更高版本。- Aspose.Finance 表示您的項目中引用的 Python。
C# 將 XBRL 轉換為 XLSX 文件的源代碼
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Enable cache service, this service will cache schema and link base file, and use the local file directly in the next load | |
LocalCacheService.enable_service("D:\\xbrl\\cache") | |
document = XbrlDocument(sourcePath + "Id-Scope-Context-Period-Start-After-End.xml") | |
# Set save options | |
Opts = SaveOptions() | |
Opts.save_format = SaveFormat.XLSX | |
// Save file to XLSX format | |
document.save(outputPath + "Converted-Xbrl-To-Xlsx_out.xlsx", Opts) |