Hello everyone! I’m a newbie in both C# and Aspose Finance. I’m trying to add a context scenario, with a typedMember dimension.
For instance, I’m trying to achieve something like this:
<xbrli:context id="c-4">
<xbrli:entity>
<xbrli:identifier scheme="http://standards.iso.org/iso/17442">efrag</xbrli:identifier>
</xbrli:entity>
<xbrli:period>
<xbrli:startDate>2026-01-01</xbrli:startDate>
<xbrli:endDate>2026-12-31</xbrli:endDate>
</xbrli:period>
<xbrli:scenario>
<xbrldi:typedMember dimension="esrs:IdentifierOfImpactRiskAndOpportunityTypedAxis">
<esrs:LIT>Impact1</esrs:LIT>
</xbrldi:typedMember>
</xbrli:scenario>
</xbrli:context>
I was able generate an explicitMember element in the XBRL file with this code:
Context context = new Context(contextPeriod, contextEntity);
context.Scenario = new ContextSenario()
{
DimensionMemberList =
{
new DimensionMember(
dimensionConcept: dimensionConcept,
explicitMemberConcept: explicitMemberConcept
)
}
};
However, when I put typeMember as the second argument in the DimensionMember constructor, it doesn’t work.
new DimensionMember(
dimensionConcept: dimensionConcept,
typeMember: xbrlInstance.GetConceptByName("CurrentlyStatedCorrectedOrRevisedRetrospectiveMember");
)
If anyone has experienced similar challenges or has suggestions on how to effectively implement typedMember in XBRL using Aspose, I would truly appreciate your insights
@chrisarele25090
To add a typedMember
dimension element in your XBRL context using Aspose Finance, you can follow the approach outlined below. It seems you are already familiar with creating a Context
and adding an explicitMember
. To include a typedMember
, you need to ensure that you are correctly initializing the DimensionMember
with the appropriate parameters.
Here’s an example of how you can achieve this:
// Create the context with the specified period and entity
Context context = new Context(contextPeriod, contextEntity);
// Create the scenario and add the typed member
context.Scenario = new ContextSenario()
{
DimensionMemberList =
{
new DimensionMember(
dimensionConcept: dimensionConcept,
typeMember: xbrlInstance.GetConceptByName("esrs:IdentifierOfImpactRiskAndOpportunityTypedAxis") // Ensure this is the correct dimension
)
}
};
// Add the typed member content
context.Scenario.DimensionMemberList[0].TypedMemberElement = new TypedMemberElement
{
TextContent = "Impact1" // Set the content for the typed member
};
In this code snippet:
- You create a
Context
object with the desired period and entity.
- You then create a
ContextSenario
and add a DimensionMember
to its DimensionMemberList
.
- Make sure to replace
"esrs:IdentifierOfImpactRiskAndOpportunityTypedAxis"
with the correct dimension name you intend to use.
- Finally, you set the
TextContent
of the TypedMemberElement
to the desired value, which in your case is "Impact1"
.
If you encounter issues with the TypedMemberElement
, ensure that the dimension concept you are using is correctly defined in your XBRL instance.
This should help you successfully add a typedMember
dimension element to your XBRL context. If you have further questions or run into specific errors, feel free to ask!
Sources:
[1]: How to initialise TypedMemberElement for DimensionMember?
@chrisarele25090,
We will look into on how to effectively implement typedMember in XBRL using Aspose.Finance for your requirements. We have opened the following new ticket(s) in our internal issue tracking system and will either devise code snippet or deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): FINANCENET-395
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 occurs because dimensionConcept or typeMember is null. Please check the data of dimensionConcept or typeMember again.