In this article:

Web Forms and BI Servers Cluster

Use of Web Forms in Regular Reports

Using Web Forms for Handling Custom Class Operations

Web Form Work Features

The technologies in use and existing restrictions cause some features that should be taken into account when working with web forms. See below the list of features.

Web Forms and BI Servers Cluster

If infrastructure containing a BI servers cluster is created for a developed web application, to ensure correct work of web forms in multi-user mode one will need an additional setup of the HAProxy balancer.

Use of Web Forms in Regular Reports

If a web form opens on custom button click, an active regular report is registered in the system within the custom session. The active report is returned by the PrxReport.ActiveReport static property that is available in the Fore language. If several web forms are used, which are called from different reports, the active report will be the one, from which the last web form was called until its closing, within the same session.

If there are several simultaneously opened regular reports and web forms, the PrxReport.ActiveReport property can work incorrectly because it returns the last report, from which the web form was opened. One can change the active report using the SetActiveReport operation.

To work with a report from web form, one should save the active report to the global variable declared at the web form class level. The active report should be written to the variable in the onShow event:

Class TESTWebForm: WebForm
    activeRep: IPrxReport;
    activeSheet: IPrxSheet;

    Sub TESTWebFormOnShow;
    Begin
        activeRep := PrxReport.ActiveReport;
        activeSheet := activeRep.ActiveSheet;
        // Further work with report
    End Sub TESTWebFormOnShow;
End Class TESTWebForm;

Using Web Forms for Handling Custom Class Operations

In the web application, web forms can be set as handlers of custom class operations. An additional parameter can be added for such web forms to the OnShow event handler: OnShow(Args: ISortedList). The elements with the following keys will be available in arguments of the Args event on executing the operation:

These elements can be used to get access to custom class object and organize required work with the use of all available components and web form visual interface.

The example of class of the web form used for handling custom class operations:

Class TESTWebForm: WebForm
    bSave: WebButton;
    bClose: WebButton;
    MDesc: IMetabaseObjectDescriptor;

    Sub TESTWebFormOnShow(Args: ISortedList);
    Var
        Descr: IMetabaseObjectDescriptor;
        ParamVals: IMetabaseObjectParamValues;
        Operation: String;
    Begin
        Descr := Args.Item("Descriptor");
        ParamVals := Args.Item("Values");
        Operation := Args.Item("Operation");
        MDesc := Descr;
    End Sub TESTWebFormOnShow;

    Sub bSaveOnClick;
    Begin
        MDesc.SaveDescriptor;
        Self.Close;
    End Sub bSaveOnClick;

    Sub bCloseOnClick;
    Begin
        Dispose MDesc;
        Self.Close;
    End Sub bCloseOnClick;
End Class TESTWebForm;

See also:

Creating Web Form and Components Layout