Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active May 6, 2022 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/8a42ccd9d8e34d8f87b21535ab34dfd4 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/8a42ccd9d8e34d8f87b21535ab34dfd4 to your computer and use it in GitHub Desktop.
Convert XBRL to HTML using C#
// This code example demonstrates how to convert XBRL to HTML webpages.
// Working directory
string workingDir = @"D:\Files\Finance\";
// Load XBRL document
XbrlDocument document = new XbrlDocument(workingDir + @"sample.xbrl");
// Set save options
Aspose.Finance.Xbrl.SaveOptions saveOptions = new Aspose.Finance.Xbrl.SaveOptions();
saveOptions.SaveFormat = Aspose.Finance.Xbrl.SaveFormat.XLSX;
// Save XBRL as XLSX in File Stream
FileStream fs = new FileStream("onvertXbrlToXlsx_out.xlsx", FileMode.Create);
document.Save(fs, saveOptions);
// Open an Excel file
Workbook workbook = new Workbook(fs);
// Save the document in HTML format
workbook.Save(workingDir + "output.html", Aspose.Cells.SaveFormat.Html);
// This code example demonstrates how to convert XBRL to HTML webpages.
// Working directory
string workingDir = @"D:\Files\Finance\";
// Load XML document
XbrlDocument document = new XbrlDocument(workingDir + @"sample.xml");
// Set save options
Aspose.Finance.Xbrl.SaveOptions saveOptions = new Aspose.Finance.Xbrl.SaveOptions();
saveOptions.SaveFormat = Aspose.Finance.Xbrl.SaveFormat.XLSX;
// Save XBRL as XLSX in File Stream
FileStream fs = new FileStream("onvertXbrlToXlsx_out.xlsx", FileMode.Create);
document.Save(fs, saveOptions);
// Open an Excel file
Workbook workbook = new Workbook(fs);
// Save the document in HTML format
workbook.Save(workingDir + "output.html", Aspose.Cells.SaveFormat.Html);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment