When using the C# SDK CreateAnalysis fails when using a definition from DescribeAnalysisDefinition containing a Paginated Report

The C# SDK does not handle Paginated Report definitions correctly. Even an empty sheet causes validation errors.

When the analysis contains a Paginated Report sheet, the validation complains about null values:

Unhandled exception. Amazon.QuickSight.AmazonQuickSightException: 3 validation errors detected: Value null at 'definition.sheets.1.member.layouts.1.member.configuration.sectionBasedLayout.headerSections.1.member.layout.freeFormLayout.elements' failed to satisfy constraint: M
ember must not be null; Value null at 'definition.sheets.1.member.layouts.1.member.configuration.sectionBasedLayout.footerSections.1.member.layout.freeFormLayout.elements' failed to satisfy constraint: Member must not be null; Value null at 'definition.sheets.1.member.layout
s.1.member.configuration.sectionBasedLayout.bodySections.1.member.content.layout.freeFormLayout.elements' failed to satisfy constraint: Member must not be null

Below is a sample C# Code that demonstrates the issue:

var awsAccountId = "123";
var sourceAnalysisId = "345";
var newAnalysisId = Guid.NewGuid().ToString();

var quickSight = new AmazonQuickSightClient(RegionEndpoint.GetBySystemName("eu-west-1"));

var describeDefinitionResponse = await quickSight.DescribeAnalysisDefinitionAsync(
    new DescribeAnalysisDefinitionRequest
    {
        AwsAccountId = awsAccountId,
        AnalysisId = sourceAnalysisId
    });

// This will throw a validation exception
var createAnalysisResponse = await quickSight.CreateAnalysisAsync(
    new CreateAnalysisRequest
    {
        AwsAccountId = awsAccountId,
        AnalysisId = newAnalysisId,
        Name = "A copy",
        Definition = describeDefinitionResponse.Definition
    });

I could not create a sample analysis in Arena as that does not support paginated reports, but any blank paginated report will already cause these validation errors.

The more complex the report the more validation errors.

Hello @rjadroncik, welcome to the Quicksight Community!

In the part below, do you mean that the paginated report that is causing this issue has no sheet visuals or objects at all or that the portions that are blank are the ones causing the error?

Also, it looks from the error that this might be caused by the free form layout, have you tried troubleshooting with the paginated report set to tiled layout instead?

1 Like

Hello @rjadroncik !

Were you able to find a solution for this issue or are you still running into this problem?

I believe it’s a null handling issue where the C# SDK is not in line with the API, but that’s not for me to determine.

Have not explored this further, the API/SDK needs to work regardless of what layout is used.

There is nothing we can fix on our side here, issue needs fixing in API/SDK.

Hello @rjadroncik !

Based on what you have said above I would suggest creating a support ticket. I can mark this as a feature request for now in case there are features around paginated reporting that are not working with SDK.

Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf.