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