bool ImportXlsx(PrxId prxMon, string filepath)
prxMon. Moniker of opened regular report instance.
filepath. Path and name of the file, from which data is imported.
The ImportXlsx operation imports data to regular report from Microsoft Excel (*.xlsx) file.
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.
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.
{
"ImportXlsx" :
{
"prxMon" :
{
"id" : "AELGNMIHALCDGOAELMFBAEPIPAJKAGHEDIIHHAINBJCGKDPI!M!S!PINDDOAJHALCDGOAEFKBFEIDGBEFILCHEIIIEGOCDOKLPKNCL"
},
"filepath" : "D:\Work\Data.xlsx"
}
}
{
"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: