how to exported null values as blank cell?

edited November 2018 in FastReport .NET
When the report is exported to Excel all the null values are exported as empty strings("") and addition will not work on them. Any way around this?

Comments

  • Hello!

    Disable automatic conversion of null values in the report settings (Report -> Options... -> uncheck “Convert null values”) or in the code:

    report.ConvertNulls = false;

    For numeric fields, make sure the TextObject is set to a numeric format (Format -> Number), and to hide zeros if necessary, set TextObject.HideZeros = true (or explicitly substitute 0 in the expression: [IIf(IsNull([Table.Field]), 0, [Table.Field])]).

    In Excel formulas, use the SUM(A1:B1) function instead of the + operator, as it correctly ignores empty text cells.

    Check that you are using the latest version of FastReport.Net / FastReport.Core (Excel2007Export), as newer versions have improved handling of empty cells when exporting to .xlsx

This discussion has been closed.