ImportXlsx

Syntax

bool ImportXlsx(PrxId prxMon, string filepath)

Parameters

prxMon. Moniker of opened regular report instance.

filepath. Path and name of the file, from which data is imported.

Description

The ImportXlsx operation imports data to regular report from Microsoft Excel (*.xlsx) file.

Comments

To execute the operation, in the prxMon field specify moniker of opened regular report instance and in the filepath field specify path and name of the file, from which data is loaded. The moniker can be obtained on executing the OpenPrxMeta operation. The regular report should be opened for edit.

The operation result determines whether data is imported successfully to regular report.

Example

Below is the example of data import to regular report. The request contains moniker of opened regular report instance. The response contains whether data is imported 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">
<ImportXlsx xmlns="http://www.fsight.ru/PP.SOM.Som">
<prxMon xmlns="">
  <id>AELGNMIHALCDGOAELMFBAEPIPAJKAGHEDIIHHAINBJCGKDPI!M!S!PINDDOAJHALCDGOAEFKBFEIDGBEFILCHEIIIEGOCDOKLPKNCL</id>
  </prxMon>
  <filepath xmlns="">D:\Work\Data.xlsx</filepath>
  </ImportXlsx>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <ImportXlsxResult 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</ImportXlsxResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"ImportXlsx" :
{
"prxMon" :
{
"id" : "AELGNMIHALCDGOAELMFBAEPIPAJKAGHEDIIHHAINBJCGKDPI!M!S!PINDDOAJHALCDGOAEFKBFEIDGBEFILCHEIIIEGOCDOKLPKNCL"
},
"filepath" : "D:\Work\Data.xlsx"
}
}

JSON response:

{
"ImportXlsxResult" : "1"
}
public static bool ImportXlsx(string moniker, string fileName)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tImp = new ImportXlsx()
{
filepath = fileName,
prxMon = new PrxId() { id = moniker }
};
// Data import
var result = somClient.ImportXlsx(tImp);
return result;
}

See also:

Working with Regular Reports