Skip to content

Allow to calculate expression even when report is not running #810

@Bykiev

Description

@Bykiev

Is your feature request related to a problem? Please describe.
Right now it's not possible to get report parameter value with specified expression (for ex. Year([Date])). When you calling Report.Calc(parameter.Expression) the null value will be returned:

private bool TryCalc(string expression, Variant value, out object result)
{
    result = null;
    
    if (!IsRunning)
        return true;

Describe the solution you'd like
When the TryCalc is called, don't check if report is running, because Parameter.Value prop already has this check:

public virtual object Value
{
    get
    {
        if (!String.IsNullOrEmpty(Expression) && !Expression.Contains("[" + Name + "]") && Report != null && Report.IsRunning)
            value = Report.Calc(Expression);
        return value;
    }

Describe alternatives you've considered
As a workaround I'm calling hidden method:
report..PreparePhase1();

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions