Reports not handling NAN values

I have a report that takes an array of records as a table.

rpt.AddTable<TValues>('Details', Details.ToArray);

It works really well, except if one of the Double values is NAN. Here is the record in question:

(8, 23, 17, 0, 0, 7.47938491860236e-307, 32.0000076591969, 1.69873027156365e-295, 0, +NAN, 1.04301580343872e-309, 1.69876853537201e-295, 1.14945056849938e-305, 8.91746743648873e-85)

Notice the +NAN, indicating that the double value is not a number. Ideally this should be accepted, and the value in that cell should be the equivalent Excel error: #NUM!

I don't know if there is a good way around it. The report uses the <#Table.*> tag, which precludes default values. I don't want to hard code each column because this page in the reports is for displaying diagnostics, and the record fields change often as a result. I'm not even sure if adding defaults would work anyway.

Is there anything I can do to harden the report against NAN values?

Hi,
Have you tried this with 7.17? We did some extra NAN handling in 7.17, and I the test I did here worked as expected. This is the code I tried:

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses VCL.FlexCel.Core, FlexCel.XlsAdapter, FlexCel.Report, Generics.Collections;

{$R *.dfm}

type
  TData = record
    public
    Data: double;
    constructor Create(const aData: double);
  end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  var data:= TList<TData>.Create;
  try
    data.Add(TData.Create(7));
    data.Add(TData.Create(double.NaN));
    var report := TFlexCelReport.Create(true);
    try
      report.AddTable<TData>('data', data);
      report.Run('..\..\template.xlsx', '..\..\result.xlsx');
    finally
      report.Free;
    end;
  finally
    data.Free;
  end;

end;

{ TData }

constructor TData.Create(const aData: double);
begin
  Data := aData;
end;

end.

The template is just a <#data> tag, and the result is #NUM:

image