通过 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) |