Report layout Caption/Summary exceeds 250-character limit (PC0032)

The Caption and Summary properties on report layout blocks (rendering > layout) are stored in database fields limited to 250 characters. The AL compiler does not enforce this limit, but Business Central will fail at runtime when a user opens the Report Layout Selection page:

The length of the string is N, but it must be less than or equal to 250 characters.

This applies to both report and reportextension objects.

Example

The following report layout has a Caption that exceeds 250 characters:

report 50100 MyReport
{
    DefaultRenderingLayout = MyLayout;

    dataset
    {
        dataitem(MyTable; MyTable)
        {
            column(MyField; MyField) { }
        }
    }

    rendering
    {
        layout(MyLayout)
        {
            // PC0032: Caption is 251 characters, maximum is 250
            Caption = 'This is a very long caption text that exceeds the maximum allowed length of two hundred and fifty characters in the Business Central Report Layout Selection page causing a runtime error when any user tries to open or select this specific report layout';
            Type = Word;
            LayoutFile = 'MyReport.docx';
        }
    }
}

To fix this, shorten the Caption (or Summary) to 250 characters or fewer.

Properties checked

PropertyLimitStored in
Caption250 characters“Report Layout Selection”.“Caption” field
Summary250 characters“Report Layout Selection”.“Description” field

Scenarios that are not flagged

  • Caption or Summary at exactly 250 characters (the limit is inclusive)
  • Caption or Summary shorter than 250 characters
  • Layout blocks without Caption or Summary properties
  • Obsolete reports (standard ALCops convention)

See also