SetActiveReport

Syntax

bool SetActiveReport(PrxId tPrx, bool isActive)

Parameters

tPrx. Moniker of opened regular report instance.

isActive. Indicates whether a report is active within the current session.

Description

The SetActiveReport operation sets an active regular report for the current user session.

Comments

It is relevant if web forms are opened from regular reports using custom buttons. If several web forms are used, which are opened from different reports, the active report will be the one, from which the last web form call was executed until its closing, within the same session. The active report is returned by the PrxReport.ActiveReport static property available in the Fore language. If several regular reports and web forms are opened at the same time, this property may work incorrectly because it returns the last report, from which web form was opened.

The SetActiveReport operation allows for changing the active report if it should be done before closing web forms. To execute the operation, in the tPrx field specify moniker of the report that should be made active. The moniker can be obtained on executing the OpenPrx or OpenPrxMeta operation. Set the isActive field to true.

The operation results in the logical true if the active report is set successfully.

Example

Below is the example of setting active regular report within the current user session. The request contains moniker of opened regular report instance. The response determines whether the active report is changed successfully.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetActiveReport xmlns="http://www.fsight.ru/PP.SOM.Som">
<tPrx xmlns="">
  <id>EIHAOHKCIDICGOAEACIOGPBBNHOGGKOEGJNOOFOKLGCODGAI!M!S!PCDPDMPKCIDICGOAEDCJBGJKCPILDLOEEMJPIECIKDFBDMFPO</id>
  </tPrx>
  <isActive xmlns="">true</isActive>
  </SetActiveReport>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetActiveReportResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</SetActiveReportResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetActiveReport" :
{
"tPrx" :
{
"id" : "EIHAOHKCIDICGOAEACIOGPBBNHOGGKOEGJNOOFOKLGCODGAI!M!S!PCDPDMPKCIDICGOAEDCJBGJKCPILDLOEEMJPIECIKDFBDMFPO"
},
"isActive" : "true"
}
}

JSON response:

{
"SetActiveReportResult" : "1"
}
public static bool SetActiveReport(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetActiveReport()
{
tPrx = new PrxId() { id = moniker },
isActive = true
};
// Set active regular report
var result = somClient.SetActiveReport(tSet);
return result;
}

See also:

Working with Regular Reports