[<TotalPages#>-1]

edited 10:34PM in FastReport .NET
Hi how can i get [<TotalPages#>-1] like this gives error.
Thank you

Comments

  • Hello!

    [TotalPages#] is a deferred string macro substitution (if you subtract one directly from it [[TotalPages#] - 1], the engine will throw an InvalidCastException: Unable to cast System.String to Int32).

    Use the numeric variable [TotalPages] (without the #) and be sure to enable double pass (DoublePass = true):

    [[TotalPages] - 1]

    (Or [Report.Engine.TotalPages - 1] but in any case, with DoublePass = true)

This discussion has been closed.