Aspose.Finance.Xbrl.ContextSenario not in save output

If i add a Aspose.Finance.Xbrl.ContextSenario (btw there is a typo it should be ContextSCenario) to my Aspose.Finance.Xbrl.Context like this:

Concept explicitMemberConcept = xbrlInstance.GetConceptById(explicitMemberConceptId);
Concept dimensionConcept = xbrlInstance.GetConceptById(dimensionConceptId);
context.Scenario = new ContextSenario();
context.Scenario.DimensionMemberList.Add(new DimensionMember(dimensionConcept, explicitMemberConcept));

And then save it like this:

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!

<xbrli:context id="D-2023_domain_58030">
  <xbrli:entity>
	<xbrli:identifier scheme="http://standards.iso.org/iso/17442">12345</xbrli:identifier>
  </xbrli:entity>
  <xbrli:period>
	<xbrli:startDate>2023-01-01</xbrli:startDate>
	<xbrli:endDate>2023-12-31</xbrli:endDate>
  </xbrli:period>
  MISSING
  <!-- <xbrli:scenario>
	  <xbrldi:explicitMember dimension="ifrs-full:ComponentsOfEquityAxis">ifrs-full:RetainedEarningsMember
	  </xbrldi:explicitMember>
  </xbrli:scenario> -->
  MISSING
</xbrli:context>

@Developer0815,

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

AsposeFinanceScenarioBug.zip (2.2 KB)

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;
}

@Developer0815,

Thanks for the sample project.

We will look into it and get back to you soon.

@Developer0815,

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.

This issue has been fixed in the new version (Aspose.Finance for .NET v23.11).