Unplanned
Last Updated: 03 Apr 2023 13:46 by Oliver
Oliver
Created on: 03 Apr 2023 13:46
Type: Bug Report
1
A Table Cell with TextBox with Height=0 breaks the report with a Message that doesn't Indicate the Exact Problem

The old report that I have has the following table cell definition:

<TableCell RowIndex="2" ColumnIndex="0" RowSpan="1" ColumnSpan="1">
  <ReportItem>
    <TextBox Width="7.471cm" Height="0cm" Left="0cm" Top="0cm" Value="= Iif(Fields.NutzungMaschinenbreite &gt; 0, Fields.NutzungMaschinenbreite, &quot;&quot;)" Name="Z2S3NutzungMaschinenbreite" StyleName="">
      <Style TextAlign="Center" VerticalAlign="Middle">
        <BorderStyle Default="Solid" />
        <BorderWidth Default="2px" />
      </Style>
      <ConditionalFormatting>
        <FormattingRule>
          <Style BackgroundColor="LightGray" />
          <Filters>
            <Filter Expression="Fields.Eigene" Operator="Equal" Value="= True" />
          </Filters>
        </FormattingRule>
      </ConditionalFormatting>
      <Bindings>
        <Binding Path="Height" Expression="= Iif(First(Fields.Typ) = 'H', '0,66cm', '0,003cm')" />
        <Binding Path="Visible" Expression="= Iif(First(Fields.Typ) = 'H', 'True', 'False')" />
      </Bindings>
    </TextBox>
  </ReportItem>
</TableCell>

Since the Height of the inner TextBox is '0cm' the corresponding processing cell becomes Null when processing the Table and the Reporting code throws a NullReferenceException:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Reporting.Processing.Table.ForEachCell(Action`1 action) +121
   Telerik.Reporting.Processing.Table.MeasureDataItemContent(IMeasureContext context, SizeLU availableClientSize) +622
   Telerik.Reporting.Processing.DataItem.MeasureContent(IMeasureContext context, SizeLU availableClientSize) +86
...

The error message may be made more informative, stating that the table row should be at least '10px', as the designer warns in design time.

0 comments