var saveOptions = new SaveOptions()
{
SaveFormat = SaveFormat.IXBRL,
SaveLinkbasesToDesticationFolder = false,
SaveSchemasToDesticationFolder = false,
};
var tempPath = Path.GetTempFileName();
// Save the xbrlInstance to a temp-file
xbrlInstance.XbrlDocument.Save(tempPath, saveOptions);
Then there are no xbrli:scenario or xbrldi:explicitMember elements in the XbrlInstance output file but there should be!
Could you please create and share a standalone sample console application (complete source code without compilation errors) to demonstrate the issue. You may zip the project, input(if any) and output files in the archive. Also, attach your expected output file for reference. We will check your issue soon.
Here is a quick console application that adds a context with a scenario to the xbrlInstance. There is a quick bool check in the end that checks the generated file for the existance of a xbrli:scenario element.
This should return True. Currently its False
using Aspose.Finance.Xbrl;
// Create a new xbrlInstance
var xbrlInstances = new XbrlDocument().XbrlInstances;
var xbrlInstance = xbrlInstances[xbrlInstances.Add()];
// Add taxonomy
xbrlInstance.SchemaRefs.Add("https://xbrl.ifrs.org/taxonomy/2022-03-24/full_ifrs_entry_point_2022-03-24.xsd", "thisStringDoesntMatter", "thisStringDoesntMatter");
var contextEntity = new ContextEntity("http://standards.iso.org/iso/17442", "123456");
var contextPeriod = new ContextPeriod(new DateTime(2022, 01, 01), new DateTime(2022, 12, 31));
var context = new Context(contextPeriod, contextEntity);
context.Id = "Context_1";
// Typo in 'Senario'
context.Scenario = new ContextSenario()
{
DimensionMemberList =
{
new DimensionMember(
dimensionConcept: xbrlInstance.GetConceptById("ifrs-full_ComponentsOfEquityAxis"),
explicitMemberConcept: xbrlInstance.GetConceptById("ifrs-full_RetainedEarningsMember")
)
}
};
xbrlInstance.Contexts.Add(context);
// Declare SaveOptions
var saveOptions = new SaveOptions()
{
SaveFormat = SaveFormat.IXBRL,
SaveLinkbasesToDesticationFolder = false,
SaveSchemasToDesticationFolder = false,
};
var tempPath = Path.GetTempFileName();
// Save the xbrlInstance to a temp-file
xbrlInstance.XbrlDocument.Save(tempPath, saveOptions);
var xbrlInstanceHtmlString = Read(tempPath);
var xbrlInstanceHtmlStringContainsScenario = xbrlInstanceHtmlString.Contains("xbrli:scenario");
Console.WriteLine($"Check if XbrlInstance contains xbrli:scenario element: {xbrlInstanceHtmlStringContainsScenario}");
Console.WriteLine("Should be 'True'");
Console.ReadLine();
string Read(string path)
{
// read it to string
var xbrlInstanceAsString = File.ReadAllText(path);
// Cleanup the temp-file
if (File.Exists(path)) File.Delete(path);
return xbrlInstanceAsString;
}
I am able to reproduce the issue as you mentioned by using your sample application. I found Aspose.Finance.Xbrl.ContextSenario is not in save output. We need to evaluate your issue in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): FINANCENET-301
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.