通過 C# 將 XBRL 轉換為 XLSX
XBRL 到 Microsoft® Excel XLSX 格式的轉換,無需安裝 Microsoft Office。
Aspose.Finance for .NET 是一種API處理XBRL、iXBRL格式,開發人員可以輕鬆構建業務流程管理、財務分析和報告軟件應用程序來轉換、創建、讀取、查看和驗證XBRL和iXBRL與財務相關的文件。
如何將 XBRL 轉換為 XLSX
- 使用加載輸入 XBRL 文件 XbrlDocument 類 .2.設置 保存選項 通過選擇相關的輸出文件 保存格式 .
- 調用 保存方法 通過提供目標文件和相關的 SaveOptions 作為參數。
轉換要求
要進行 XBRL 到 XLSX 的轉換,.NET Finance API 是主要要求。通過命令行將其安裝為 nuget install Aspose.Finance
或通過 Visual Studio 的包管理器控制台使用 ``Install-Package Aspose.Finance``` 安裝。
或者,從 ZIP 文件中獲取離線 MSI 安裝程序或 DLL 下載 .
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
string sourcePath = RunExamples.Get_SourceDirectory(); | |
string outputPath = RunExamples.Get_OutputDirectory(); | |
XbrlDocument sourceFile = new XbrlDocument(sourcePath + @"Id-Scope-Context-Period-Start-After-End.xml"); | |
// Set save options | |
SaveOptions Opts = new SaveOptions(); | |
Opts.SaveFormat = SaveFormat.XLSX; | |
// Save file to XLSX format | |
sourceFile.Save(outputPath + @"Converted-Xbrl-To-Xlsx_out.xlsx", Opts); |