Практика
Интеграция с Oracle BI Publisher

:: Меню ::
:: На главную ::
:: FAQ ::
:: Заметки ::
:: Практика ::
:: Win API ::
:: Проекты ::
:: Скачать ::
:: Секреты ::
:: Ссылки ::

:: Сервис ::
:: Написать ::

:: MVP ::

:: RSS ::

Яндекс.Метрика


Генератор отчетов – класс программ, очень востребованный корпоративными пользователями (бизнесом), которым необходим подробный отчет по данным в нужное время и в требуемой форме. Одним из таких генераторов отчетов, о котором сегодня и пойдет речь, является Oracle BI Publisher (далее просто Publisher).

Publisher (один из модулей аналитической платформы Oracle Business Intelligence Enterprise Edition) - серверное решение уровня предприятия, средство, предназначенное для генерации отчетов, позволяющее извлекать данные из различных источников. О создании самих отчетов говорить не будем, эта отдельная (и очень большая) тема. Вопрос, который сегодня будет рассмотрен - взаимодействие с Publisher из Delphi.

Взаимодействие с Publisher осуществляется через веб-сервис. Для Publisher версии 10g он расположен по адресу http://hostname:port/xmlpserver/services/PublicReportService?WSDL, где находится XML файл с описанием сервиса:
  • определение типов данных (types) — определение вида отправляемых и получаемых сервисом XML-сообщений;
  • элементы данных (message) — сообщения, используемые web-сервисом;
  • абстрактные операции (portType) — список операций, которые могут быть выполнены с сообщениями;
  • связывание сервисов (binding) — способ, которым сообщение будет доставлено.
В этом сервисе все свалено в кучу - работа с планировщиком (Job), отчетами, каталогами, административными настройками. В Publisher версии 11g навели порядок и разделили все это хозяйство на несколько сервисов, расположенных по следующим адресам:
  • http://hostname:port/xmlpserver/services/v2/ScheduleService?wsdl;
  • http://hostname:port/xmlpserver/services/v2/ReportService?wsdl;
  • http://hostname:port/xmlpserver/services/v2/SecurityService?wsdl;
  • http://hostname:port/xmlpserver/services/v2/CatalogService?wsdl.
WSDL – стандартный язык описания web-сервисов, и в Delphi предусмотрен удобный мастер импорта, генерирующий модуль для работы с сервисом, включающий в себя все необходимое (классы, типы и т.п.). Вызывается этот мастер (в Delphi 10.2) через меню ComponentsImport WSDL....

В более ранних версиях (например, Delphi XE) этот мастер запускается несколько иначе. Выбираем в меню FileNewOther. В открывшемся окне выбираем WebServicesWSDLImporter.


Мастер состоит из 3 шагов. На первом шаге нам нужно ввести путь к WSDL-документу (и, если это необходимо, данные для авторизации). На втором шаге мастер просит выбрать версию SOAP, которую мы будем использовать. Оставляем значение по умолчанию и жмем "Next". На третьем шаге мастер спросит нас, с какими опциями нам необходимо произвести импорт WSDL. В принципе, того что выбрано по умолчанию, вполне достаточно.


Однако некоторые опции могут довольно сильно влиять на конечный результат импорта, поэтому для начала разберем их.

• Use Setters and Getters for properties (-Ob)

Включение этой опции приведет к генерации геттеров и сеттеров для свойств классов, что в свою очередь повлияет на размер сгенерированного модуля (он заметно прибавит в весе). Если в дальнейшем вы не планируете вносить изменения в сгенерированный модуль (например, делать различные проверки при изменении значения свойств), опцию лучше не включать.

Пример (с отключенной опцией)
CatalogContents = class(TRemotable)
private
  FcatalogContents: ArrayOfItemData;
public
  destructor Destroy; override;
published
  property catalogContents: ArrayOfItemData  Index (IS_NLBL) read FcatalogContents write FcatalogContents;
end;

Пример (с включенной опцией)
CatalogContents = class(TRemotable)
private
  FcatalogContents: ArrayOfItemData;
  function  GetcatalogContents(Index: Integer): ArrayOfItemData;
  procedure SetcatalogContents(Index: Integer; const AArrayOfItemData: ArrayOfItemData);
public
  destructor Destroy; override;
published
  property catalogContents: ArrayOfItemData  Index (IS_NLBL) read GetcatalogContents write SetcatalogContents;
end;

function CatalogContents.GetcatalogContents(Index: Integer): ArrayOfItemData;
begin
  Result := FcatalogContents;
end;

procedure CatalogContents.SetcatalogContents(Index: Integer; const AArrayOfItemData: ArrayOfItemData);
begin
  FcatalogContents := AArrayOfItemData;
end;

• Generate destructors for remotable types (-Od)

При включенной опции для классов будут генерироваться деструктор.

Пример (с включенной опцией)
CatalogContents = class(TRemotable)
private
  FcatalogContents: ArrayOfItemData;
public
  destructor Destroy; override;
published
  property catalogContents: ArrayOfItemData  Index (IS_NLBL) read FcatalogContents write FcatalogContents;
end;

destructor CatalogContents.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FcatalogContents)-1 do
    System.SysUtils.FreeAndNil(FcatalogContents[I]);
  System.SetLength(FcatalogContents, 0);
  inherited Destroy;
end;

• Import Fault Types (-Of)

При включенной опции будут сгенерированы классы исключений для отлова ошибок, произошедших на стороне сервера.

Пример (с включенной опцией)
OperationFailedException = class(TRemotable)
private
published
end;

• Generate interface GUIDs using COM API (-Og)

При включенной опции к имени интерфейса будет добавлен уникальный идентификатор (GUID).

Пример (с включенной опцией)
PublicReportService = interface(IInvokable)
['{A24578A2-A6A4-6155-3B06-64AC06C9A70F}']

• One out parameter is return value (-Oo)

При включенной опции генерируются функции, при выключенной - процедуры с выходным параметром.

Пример (с отключенной опцией)
PublicReportService = interface(IInvokable)
['{A24578A2-A6A4-6155-3B06-64AC06C9A70F}']
  procedure logout(const bipSessionToken: string; out logoutReturn: Boolean); stdcall;
end;

Пример (с включенной опцией)
PublicReportService = interface(IInvokable)
['{A24578A2-A6A4-6155-3B06-64AC06C9A70F}']
  function  logout(const bipSessionToken: string): Boolean; stdcall;
end;

• Generate alias for the element of pure collections (-Or)

При включенной опции будет создаваться псевдоним для коллекций.

Пример (с отключенной опцией)
ArrayOfString = array of string;    { "http://xmlns.oracle.com/oxp/service/PublicReportService"[GblCplx] }

Пример (с включенной опцией)
item           =  type string;      { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Alias] }
ArrayOfString  = array of item;     { "http://xmlns.oracle.com/oxp/service/PublicReportService"[GblCplx] }

• Generate server implementation instead of client proxies (-Os)

С включенной опцией кода значительно больше (тут лучше просто посмотреть примеры).

Пример (с отключенной опцией)
function GetPublicReportService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): PublicReportService;

implementation
  uses System.SysUtils;

function GetPublicReportService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): PublicReportService;
const
  defWSDL = 'http://bi1.main.somedomain.ru:9704/xmlpserver/services/PublicReportService?WSDL';
  defURL  = 'http://bi1.main.somedomain.ru:9704/xmlpserver/services/PublicReportService';
  defSvc  = 'PublicReportServiceService';
  defPrt  = 'PublicReportService';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as PublicReportService);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;

destructor CatalogContents.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FcatalogContents)-1 do
    System.SysUtils.FreeAndNil(FcatalogContents[I]);
  System.SetLength(FcatalogContents, 0);
  inherited Destroy;
end;

destructor ItemData.Destroy;
begin
  System.SysUtils.FreeAndNil(FcreationDate);
  System.SysUtils.FreeAndNil(FlastModified);
  inherited Destroy;
end;

destructor BIPDataSource.Destroy;
begin
  System.SysUtils.FreeAndNil(FJDBCDataSource);
  System.SysUtils.FreeAndNil(FfileDataSource);
  inherited Destroy;
end;

destructor TemplateFormatsLabelValues.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FlistOfTemplateFormatLabelValue)-1 do
    System.SysUtils.FreeAndNil(FlistOfTemplateFormatLabelValue[I]);
  System.SetLength(FlistOfTemplateFormatLabelValue, 0);
  inherited Destroy;
end;

destructor ReportRequest.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FparameterNameValues)-1 do
    System.SysUtils.FreeAndNil(FparameterNameValues[I]);
  System.SetLength(FparameterNameValues, 0);
  System.SysUtils.FreeAndNil(FdynamicDataSource);
  inherited Destroy;
end;

destructor ParamNameValues.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FlistOfParamNameValues)-1 do
    System.SysUtils.FreeAndNil(FlistOfParamNameValues[I]);
  System.SetLength(FlistOfParamNameValues, 0);
  inherited Destroy;
end;

destructor ReportDefinition.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FlistOfTemplateFormatsLabelValues)-1 do
    System.SysUtils.FreeAndNil(FlistOfTemplateFormatsLabelValues[I]);
  System.SetLength(FlistOfTemplateFormatsLabelValues, 0);
  for I := 0 to System.Length(FreportParameterNameValues)-1 do
    System.SysUtils.FreeAndNil(FreportParameterNameValues[I]);
  System.SetLength(FreportParameterNameValues, 0);
  inherited Destroy;
end;

destructor JobInfos.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FlistOfJobInfos)-1 do
    System.SysUtils.FreeAndNil(FlistOfJobInfos[I]);
  System.SetLength(FlistOfJobInfos, 0);
  inherited Destroy;
end;

destructor JobHistoryInfo.Destroy;
begin
  System.SysUtils.FreeAndNil(FcreatedDate);
  inherited Destroy;
end;

destructor JobStatusInfos.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FlistOfJobStatusInfos)-1 do
    System.SysUtils.FreeAndNil(FlistOfJobStatusInfos[I]);
  System.SetLength(FlistOfJobStatusInfos, 0);
  inherited Destroy;
end;

destructor JobInfo.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FreportParameters)-1 do
    System.SysUtils.FreeAndNil(FreportParameters[I]);
  System.SetLength(FreportParameters, 0);
  System.SysUtils.FreeAndNil(FcreatedDate);
  System.SysUtils.FreeAndNil(FdeliveryParameters);
  System.SysUtils.FreeAndNil(FendDate);
  System.SysUtils.FreeAndNil(FstartDate);
  inherited Destroy;
end;

destructor JobHistoryInfos.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FlistOfJobHistoryInfos)-1 do
    System.SysUtils.FreeAndNil(FlistOfJobHistoryInfos[I]);
  System.SetLength(FlistOfJobHistoryInfos, 0);
  inherited Destroy;
end;

destructor DeliveryRequest.Destroy;
begin
  System.SysUtils.FreeAndNil(FdeliveryChannels);
  System.SysUtils.FreeAndNil(FdynamicDataSource);
  inherited Destroy;
end;

destructor ScheduleRequest.Destroy;
begin
  System.SysUtils.FreeAndNil(FendDate);
  System.SysUtils.FreeAndNil(FreportRequest);
  System.SysUtils.FreeAndNil(FstartDate);
  inherited Destroy;
end;

destructor DeliveryChannels.Destroy;
var
  I: Integer;
begin
  for I := 0 to System.Length(FemailOptions)-1 do
    System.SysUtils.FreeAndNil(FemailOptions[I]);
  System.SetLength(FemailOptions, 0);
  for I := 0 to System.Length(FfaxOptions)-1 do
    System.SysUtils.FreeAndNil(FfaxOptions[I]);
  System.SetLength(FfaxOptions, 0);
  for I := 0 to System.Length(FftpOptions)-1 do
    System.SysUtils.FreeAndNil(FftpOptions[I]);
  System.SetLength(FftpOptions, 0);
  for I := 0 to System.Length(FlocalOptions)-1 do
    System.SysUtils.FreeAndNil(FlocalOptions[I]);
  System.SetLength(FlocalOptions, 0);
  for I := 0 to System.Length(FprintOptions)-1 do
    System.SysUtils.FreeAndNil(FprintOptions[I]);
  System.SetLength(FprintOptions, 0);
  for I := 0 to System.Length(FwebDAVOptions)-1 do
    System.SysUtils.FreeAndNil(FwebDAVOptions[I]);
  System.SetLength(FwebDAVOptions, 0);
  inherited Destroy;
end;

initialization
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(PublicReportService), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(PublicReportService), ioDocument);

Пример (с включенной опцией)
implementation

type

  PublicReportServiceImpl = class(TInvokableClass, PublicReportService)
  Public
    { PublicReportService }
    function  logout(const bipSessionToken: string): Boolean; stdcall;
    function  impersonate(const adminUsername: string; const adminPassword: string; const username: string): string; stdcall;
    function  getReportParameters(const reportRequest: ReportRequest; const userID: string; const password: string): ParamNameValues; stdcall;
    function  createReport(const reportName: string; const folderAbsolutePathURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; const XLIFFData: TByteDynArray; 
                           const updateFlag: Boolean; const userID: string; const password: string): string; stdcall;
    function  deleteReport(const reportAbsolutePath: string; const userID: string; const password: string): Boolean; stdcall;
    function  validateLogin(const userID: string; const password: string): Boolean; stdcall;
    function  login(const userID: string; const password: string): string; stdcall;
    function  getSecurityModel: string; stdcall;
    function  getBIPHTTPSessionInterval: Integer; stdcall;
    function  runReport(const reportRequest: ReportRequest; const userID: string; const password: string): ReportResponse; stdcall;
    function  runReportInSession(const reportRequest: ReportRequest; const bipSessionToken: string): ReportResponse; stdcall;
    function  getReportDefinition(const reportAbsolutePath: string; const userID: string; const password: string): ReportDefinition; stdcall;
    function  getReportDefinitionInSession(const reportAbsolutePath: string; const bipSessionToken: string): ReportDefinition; stdcall;
    function  getReportParametersInSession(const reportRequest: ReportRequest; const bipSessionToken: string): ParamNameValues; stdcall;
    function  getTemplateParameters(const reportAbsolutePath: string; const templateID: string; const userID: string; const password: string): ArrayOfParamNameValue; stdcall;
    function  getTemplateParametersInSession(const reportAbsolutePath: string; const templateID: string; const bipSessionToken: string): ArrayOfParamNameValue; stdcall;
    function  getFolderContents(const folderAbsolutePath: string; const userID: string; const password: string): CatalogContents; stdcall;
    function  getFolderContentsInSession(const folderAbsolutePath: string; const bipSessionToken: string): CatalogContents; stdcall;
    function  getDeliveryServiceDefinition(const userID: string; const password: string): DeliveryServiceDefinition; stdcall;
    function  getDeliveryServiceDefinitionInSession(const bipSessionToken: string): DeliveryServiceDefinition; stdcall;
    function  deliveryService(const deliveryRequest: DeliveryRequest; const userID: string; const password: string): string; stdcall;
    function  deliveryServiceInSession(const deliveryRequest: DeliveryRequest; const bipSessionToken: string): string; stdcall;
    function  scheduleReport(const scheduleRequest: ScheduleRequest; const userID: string; const password: string): string; stdcall;
    function  scheduleReportInSession(const scheduleRequest: ScheduleRequest; const bipSessionToken: string): string; stdcall;
    function  hasReportAccess(const reportAbsolutePath: string; const userID: string; const password: string): Boolean; stdcall;
    function  hasReportAccessInSession(const reportAbsolutePath: string; const bipSessionToken: string): Boolean; stdcall;
    function  isReportExist(const reportAbsolutePath: string; const userID: string; const password: string): Boolean; stdcall;
    function  isReportExistInSession(const reportAbsolutePath: string; const bipSessionToken: string): Boolean; stdcall;
    function  isFolderExist(const folderAbsolutePath: string; const userID: string; const password: string): Boolean; stdcall;
    function  isFolderExistInSession(const folderAbsolutePath: string; const bipSessionToken: string): Boolean; stdcall;
    function  getScheduledReportStatus(const scheduledJobID: string; const userID: string; const password: string): JobStatus; stdcall;
    function  getScheduledReportStatusInSession(const scheduledJobID: string; const bipSessionToken: string): JobStatus; stdcall;
    function  getListOfScheduledReportsStatus(const scheduledJobIDs: ArrayOfString; const userID: string; const password: string): JobStatusInfos; stdcall;
    function  getListOfScheduledReportsStatusInSession(const scheduledJobIDs: ArrayOfString; const bipSessionToken: string): JobStatusInfos; stdcall;
    function  getScheduledReportInfo(const scheduledJobID: string; const userID: string; const password: string; const viewByFilter: string): JobInfos; stdcall;
    function  getScheduledReportInfoInSession(const scheduledJobID: string; const bipSessionToken: string; const userID: string; const viewByFilter: string): JobInfos; stdcall;
    function  getScheduledReportHistoryInfo(const scheduledJobID: string; const userID: string; const password: string; const viewByFilter: string; const bDownloadReport: Boolean): JobHistoryInfos; stdcall;
    function  getScheduledReportHistoryInfoInSession(const scheduledJobID: string; const bipSessionToken: string; const userID: string; const viewByFilter: string; const bDownloadReport: Boolean): JobHistoryInfos; stdcall;
    function  suspendScheduledReport(const scheduledJobID: string; const userID: string; const password: string): Boolean; stdcall;
    function  suspendScheduledReportInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean; stdcall;
    function  resumeScheduledReport(const scheduledJobID: string; const userID: string; const password: string): Boolean; stdcall;
    function  resumeScheduledReportInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean; stdcall;
    function  deleteScheduledReport(const scheduledJobID: string; const userID: string; const password: string): Boolean; stdcall;
    function  deleteScheduledReportInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean; stdcall;
    function  deleteScheduledReportHistory(const scheduledJobID: string; const userID: string; const password: string): Boolean; stdcall;
    function  deleteScheduledReportHistoryInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean; stdcall;
    function  createReportInSession(const reportName: string; const folderAbsolutePathURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; const XLIFFData: TByteDynArray; 
                                    const updateFlag: Boolean; const bipSessionToken: string): string; stdcall;
    function  updateReportDefinition(const reportAbsPath: string; const newReportDefn: ReportDefinition; const userID: string; const password: string): Boolean; stdcall;
    function  updateReportDefinitionInSession(const reportAbsPath: string; const newReportDefn: ReportDefinition; const bipSessionToken: string): Boolean; stdcall;
    function  createReportFolder(const folderAbsolutePath: string; const userID: string; const password: string): string; stdcall;
    function  createReportFolderInSession(const folderAbsolutePath: string; const bipSessionToken: string): string; stdcall;
    function  uploadTemplateForReport(const reportAbsolutePath: string; const templateName: string; const templateType: string; const locale: string; const templateData: TByteDynArray; const userID: string; 
                                      const password: string): Boolean; stdcall;
    function  uploadTemplateForReportInSession(const reportAbsolutePath: string; const templateFileName: string; const templateName: string; const locale: string; const templateData: TByteDynArray; const bipSessionToken: string
                                               ): Boolean; stdcall;
    function  removeTemplateForReport(const reportAbsolutePath: string; const templateFileName: string; const userID: string; const password: string): Boolean; stdcall;
    function  removeTemplateForReportInSession(const reportAbsolutePath: string; const templateFileName: string; const bipSessionToken: string): Boolean; stdcall;
    function  uploadReportDataChunk(const fileID: string; const reportDataChunk: TByteDynArray; const reportRawDataChunk: string): string; stdcall;
    function  downloadReportDataChunk(const fileID: string; const beginIdx: Integer; const size: Integer): ReportDataChunk; stdcall;
    function  uploadReport(const reportName: string; const folderAbsolutePathURL: string; const reportZippedData: TByteDynArray; const userID: string; const password: string): string; stdcall;
    function  uploadReportInSession(const reportName: string; const folderAbsolutePathURL: string; const reportZippedData: TByteDynArray; const bipSessionToken: string): string; stdcall;
    function  deleteReportInSession(const reportAbsolutePath: string; const bipSessionToken: string): Boolean; stdcall;
    function  deleteFolder(const folderAbsolutePath: string; const userID: string; const password: string): Boolean; stdcall;
    function  deleteFolderInSession(const folderAbsolutePath: string; const bipSessionToken: string): Boolean; stdcall;
    function  getTemplate(const reportAbsolutePath: string; const templateID: string; const locale: string; const userID: string; const password: string): TByteDynArray; stdcall;
    function  getReportSampleData(const reportAbsolutePath: string; const userID: string; const password: string): TByteDynArray; stdcall;
    function  getReportSampleDataInSession(const reportAbsolutePath: string; const bipSessionToken: string): TByteDynArray; stdcall;
    function  getXDOSchema(const reportAbsolutePath: string; const locale: string; const userID: string; const password: string): TByteDynArray; stdcall;
    function  getXDOSchemaInSession(const reportAbsolutePath: string; const locale: string; const bipSessionToken: string): TByteDynArray; stdcall;
    function  getTemplateInSession(const reportAbsolutePath: string; const templateID: string; const locale: string; const bipSessionToken: string): TByteDynArray; stdcall;
    function  createReportWithDataModel(const reportName: string; const folderAbsolutePathURL: string; const dataModelURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; 
                                        const XLIFFData: TByteDynArray; const updateFlag: Boolean; const userID: string; const password: string): string; stdcall;
    function  createReportWithDataModelInSession(const reportName: string; const folderAbsolutePathURL: string; const dataModelURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; 
                                                 const XLIFFData: TByteDynArray; const updateFlag: Boolean; const bipSessionToken: string): string; stdcall;
    function  updateTemplateForReport(const reportAbsolutePath: string; const templateName: string; const locale: string; const templateData: TByteDynArray; const userID: string; const password: string
                                      ): Boolean; stdcall;
    function  updateTemplateForReportInSession(const reportAbsolutePath: string; const templateName: string; const locale: string; const templateData: TByteDynArray; const bipSessionToken: string): Boolean; stdcall;
    function  uploadXLIFFForReport(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const userID: string; const password: string
                                   ): Boolean; stdcall;
    function  updateXLIFFForReportInSession(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const bipSessionToken: string): Boolean; stdcall;
    function  updateXLIFFForReport(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const userID: string; const password: string
                                   ): Boolean; stdcall;
    function  uploadXLIFFForReportInSession(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const bipSessionToken: string): Boolean; stdcall;
    function  uploadReportObject(const reportObjectAbsolutePathURL: string; const objectType: string; const objectZippedData: TByteDynArray; const userID: string; const password: string): string; stdcall;
    function  uploadReportObjectInSession(const reportObjectAbsolutePathURL: string; const objectType: string; const objectZippedData: TByteDynArray; const bipSessionToken: string): string; stdcall;
    function  downloadReportObject(const reportAbsolutePath: string; const userID: string; const password: string): TByteDynArray; stdcall;
    function  downloadReportObjectInSession(const reportAbsolutePath: string; const bipSessionToken: string): TByteDynArray; stdcall;
    function  getObjectSecurityXML(const adminUsername: string; const adminPassword: string; const objectAbsolutePath: string; const isRecursive: Boolean): TByteDynArray; stdcall;
  end;

function PublicReportServiceImpl.logout(const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method logout }
end;

function PublicReportServiceImpl.impersonate(const adminUsername: string; const adminPassword: string; const username: string): string;
begin
  { TODO - Implement method impersonate }
end;

function PublicReportServiceImpl.getReportParameters(const reportRequest: ReportRequest; const userID: string; const password: string): ParamNameValues;
begin
  { TODO - Implement method getReportParameters }
end;

function PublicReportServiceImpl.createReport(const reportName: string; const folderAbsolutePathURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; const XLIFFData: TByteDynArray; 
                                              const updateFlag: Boolean; const userID: string; const password: string): string;
begin
  { TODO - Implement method createReport }
end;

function PublicReportServiceImpl.deleteReport(const reportAbsolutePath: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method deleteReport }
end;

function PublicReportServiceImpl.validateLogin(const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method validateLogin }
end;

function PublicReportServiceImpl.login(const userID: string; const password: string): string;
begin
  { TODO - Implement method login }
end;

function PublicReportServiceImpl.getSecurityModel: string;
begin
  { TODO - Implement method getSecurityModel }
end;

function PublicReportServiceImpl.getBIPHTTPSessionInterval: Integer;
begin
  { TODO - Implement method getBIPHTTPSessionInterval }
end;

function PublicReportServiceImpl.runReport(const reportRequest: ReportRequest; const userID: string; const password: string): ReportResponse;
begin
  { TODO - Implement method runReport }
end;

function PublicReportServiceImpl.runReportInSession(const reportRequest: ReportRequest; const bipSessionToken: string): ReportResponse;
begin
  { TODO - Implement method runReportInSession }
end;

function PublicReportServiceImpl.getReportDefinition(const reportAbsolutePath: string; const userID: string; const password: string): ReportDefinition;
begin
  { TODO - Implement method getReportDefinition }
end;

function PublicReportServiceImpl.getReportDefinitionInSession(const reportAbsolutePath: string; const bipSessionToken: string): ReportDefinition;
begin
  { TODO - Implement method getReportDefinitionInSession }
end;

function PublicReportServiceImpl.getReportParametersInSession(const reportRequest: ReportRequest; const bipSessionToken: string): ParamNameValues;
begin
  { TODO - Implement method getReportParametersInSession }
end;

function PublicReportServiceImpl.getTemplateParameters(const reportAbsolutePath: string; const templateID: string; const userID: string; const password: string): ArrayOfParamNameValue;
begin
  { TODO - Implement method getTemplateParameters }
end;

function PublicReportServiceImpl.getTemplateParametersInSession(const reportAbsolutePath: string; const templateID: string; const bipSessionToken: string): ArrayOfParamNameValue;
begin
  { TODO - Implement method getTemplateParametersInSession }
end;

function PublicReportServiceImpl.getFolderContents(const folderAbsolutePath: string; const userID: string; const password: string): CatalogContents;
begin
  { TODO - Implement method getFolderContents }
end;

function PublicReportServiceImpl.getFolderContentsInSession(const folderAbsolutePath: string; const bipSessionToken: string): CatalogContents;
begin
  { TODO - Implement method getFolderContentsInSession }
end;

function PublicReportServiceImpl.getDeliveryServiceDefinition(const userID: string; const password: string): DeliveryServiceDefinition;
begin
  { TODO - Implement method getDeliveryServiceDefinition }
end;

function PublicReportServiceImpl.getDeliveryServiceDefinitionInSession(const bipSessionToken: string): DeliveryServiceDefinition;
begin
  { TODO - Implement method getDeliveryServiceDefinitionInSession }
end;

function PublicReportServiceImpl.deliveryService(const deliveryRequest: DeliveryRequest; const userID: string; const password: string): string;
begin
  { TODO - Implement method deliveryService }
end;

function PublicReportServiceImpl.deliveryServiceInSession(const deliveryRequest: DeliveryRequest; const bipSessionToken: string): string;
begin
  { TODO - Implement method deliveryServiceInSession }
end;

function PublicReportServiceImpl.scheduleReport(const scheduleRequest: ScheduleRequest; const userID: string; const password: string): string;
begin
  { TODO - Implement method scheduleReport }
end;

function PublicReportServiceImpl.scheduleReportInSession(const scheduleRequest: ScheduleRequest; const bipSessionToken: string): string;
begin
  { TODO - Implement method scheduleReportInSession }
end;

function PublicReportServiceImpl.hasReportAccess(const reportAbsolutePath: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method hasReportAccess }
end;

function PublicReportServiceImpl.hasReportAccessInSession(const reportAbsolutePath: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method hasReportAccessInSession }
end;

function PublicReportServiceImpl.isReportExist(const reportAbsolutePath: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method isReportExist }
end;

function PublicReportServiceImpl.isReportExistInSession(const reportAbsolutePath: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method isReportExistInSession }
end;

function PublicReportServiceImpl.isFolderExist(const folderAbsolutePath: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method isFolderExist }
end;

function PublicReportServiceImpl.isFolderExistInSession(const folderAbsolutePath: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method isFolderExistInSession }
end;

function PublicReportServiceImpl.getScheduledReportStatus(const scheduledJobID: string; const userID: string; const password: string): JobStatus;
begin
  { TODO - Implement method getScheduledReportStatus }
end;

function PublicReportServiceImpl.getScheduledReportStatusInSession(const scheduledJobID: string; const bipSessionToken: string): JobStatus;
begin
  { TODO - Implement method getScheduledReportStatusInSession }
end;

function PublicReportServiceImpl.getListOfScheduledReportsStatus(const scheduledJobIDs: ArrayOfString; const userID: string; const password: string): JobStatusInfos;
begin
  { TODO - Implement method getListOfScheduledReportsStatus }
end;

function PublicReportServiceImpl.getListOfScheduledReportsStatusInSession(const scheduledJobIDs: ArrayOfString; const bipSessionToken: string): JobStatusInfos;
begin
  { TODO - Implement method getListOfScheduledReportsStatusInSession }
end;

function PublicReportServiceImpl.getScheduledReportInfo(const scheduledJobID: string; const userID: string; const password: string; const viewByFilter: string): JobInfos;
begin
  { TODO - Implement method getScheduledReportInfo }
end;

function PublicReportServiceImpl.getScheduledReportInfoInSession(const scheduledJobID: string; const bipSessionToken: string; const userID: string; const viewByFilter: string): JobInfos;
begin
  { TODO - Implement method getScheduledReportInfoInSession }
end;

function PublicReportServiceImpl.getScheduledReportHistoryInfo(const scheduledJobID: string; const userID: string; const password: string; const viewByFilter: string; const bDownloadReport: Boolean): JobHistoryInfos;
begin
  { TODO - Implement method getScheduledReportHistoryInfo }
end;

function PublicReportServiceImpl.getScheduledReportHistoryInfoInSession(const scheduledJobID: string; const bipSessionToken: string; const userID: string; const viewByFilter: string; const bDownloadReport: Boolean): JobHistoryInfos;
begin
  { TODO - Implement method getScheduledReportHistoryInfoInSession }
end;

function PublicReportServiceImpl.suspendScheduledReport(const scheduledJobID: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method suspendScheduledReport }
end;

function PublicReportServiceImpl.suspendScheduledReportInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method suspendScheduledReportInSession }
end;

function PublicReportServiceImpl.resumeScheduledReport(const scheduledJobID: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method resumeScheduledReport }
end;

function PublicReportServiceImpl.resumeScheduledReportInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method resumeScheduledReportInSession }
end;

function PublicReportServiceImpl.deleteScheduledReport(const scheduledJobID: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method deleteScheduledReport }
end;

function PublicReportServiceImpl.deleteScheduledReportInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method deleteScheduledReportInSession }
end;

function PublicReportServiceImpl.deleteScheduledReportHistory(const scheduledJobID: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method deleteScheduledReportHistory }
end;

function PublicReportServiceImpl.deleteScheduledReportHistoryInSession(const scheduledJobID: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method deleteScheduledReportHistoryInSession }
end;

function PublicReportServiceImpl.createReportInSession(const reportName: string; const folderAbsolutePathURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; const XLIFFData: TByteDynArray; 
                                                       const updateFlag: Boolean; const bipSessionToken: string): string;
begin
  { TODO - Implement method createReportInSession }
end;

function PublicReportServiceImpl.updateReportDefinition(const reportAbsPath: string; const newReportDefn: ReportDefinition; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method updateReportDefinition }
end;

function PublicReportServiceImpl.updateReportDefinitionInSession(const reportAbsPath: string; const newReportDefn: ReportDefinition; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method updateReportDefinitionInSession }
end;

function PublicReportServiceImpl.createReportFolder(const folderAbsolutePath: string; const userID: string; const password: string): string;
begin
  { TODO - Implement method createReportFolder }
end;

function PublicReportServiceImpl.createReportFolderInSession(const folderAbsolutePath: string; const bipSessionToken: string): string;
begin
  { TODO - Implement method createReportFolderInSession }
end;

function PublicReportServiceImpl.uploadTemplateForReport(const reportAbsolutePath: string; const templateName: string; const templateType: string; const locale: string; const templateData: TByteDynArray; const userID: string; 
                                                         const password: string): Boolean;
begin
  { TODO - Implement method uploadTemplateForReport }
end;

function PublicReportServiceImpl.uploadTemplateForReportInSession(const reportAbsolutePath: string; const templateFileName: string; const templateName: string; const locale: string; const templateData: TByteDynArray; const bipSessionToken: string
                                                                  ): Boolean;
begin
  { TODO - Implement method uploadTemplateForReportInSession }
end;

function PublicReportServiceImpl.removeTemplateForReport(const reportAbsolutePath: string; const templateFileName: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method removeTemplateForReport }
end;

function PublicReportServiceImpl.removeTemplateForReportInSession(const reportAbsolutePath: string; const templateFileName: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method removeTemplateForReportInSession }
end;

function PublicReportServiceImpl.uploadReportDataChunk(const fileID: string; const reportDataChunk: TByteDynArray; const reportRawDataChunk: string): string;
begin
  { TODO - Implement method uploadReportDataChunk }
end;

function PublicReportServiceImpl.downloadReportDataChunk(const fileID: string; const beginIdx: Integer; const size: Integer): ReportDataChunk;
begin
  { TODO - Implement method downloadReportDataChunk }
end;

function PublicReportServiceImpl.uploadReport(const reportName: string; const folderAbsolutePathURL: string; const reportZippedData: TByteDynArray; const userID: string; const password: string): string;
begin
  { TODO - Implement method uploadReport }
end;

function PublicReportServiceImpl.uploadReportInSession(const reportName: string; const folderAbsolutePathURL: string; const reportZippedData: TByteDynArray; const bipSessionToken: string): string;
begin
  { TODO - Implement method uploadReportInSession }
end;

function PublicReportServiceImpl.deleteReportInSession(const reportAbsolutePath: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method deleteReportInSession }
end;

function PublicReportServiceImpl.deleteFolder(const folderAbsolutePath: string; const userID: string; const password: string): Boolean;
begin
  { TODO - Implement method deleteFolder }
end;

function PublicReportServiceImpl.deleteFolderInSession(const folderAbsolutePath: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method deleteFolderInSession }
end;

function PublicReportServiceImpl.getTemplate(const reportAbsolutePath: string; const templateID: string; const locale: string; const userID: string; const password: string): TByteDynArray;
begin
  { TODO - Implement method getTemplate }
end;

function PublicReportServiceImpl.getReportSampleData(const reportAbsolutePath: string; const userID: string; const password: string): TByteDynArray;
begin
  { TODO - Implement method getReportSampleData }
end;

function PublicReportServiceImpl.getReportSampleDataInSession(const reportAbsolutePath: string; const bipSessionToken: string): TByteDynArray;
begin
  { TODO - Implement method getReportSampleDataInSession }
end;

function PublicReportServiceImpl.getXDOSchema(const reportAbsolutePath: string; const locale: string; const userID: string; const password: string): TByteDynArray;
begin
  { TODO - Implement method getXDOSchema }
end;

function PublicReportServiceImpl.getXDOSchemaInSession(const reportAbsolutePath: string; const locale: string; const bipSessionToken: string): TByteDynArray;
begin
  { TODO - Implement method getXDOSchemaInSession }
end;

function PublicReportServiceImpl.getTemplateInSession(const reportAbsolutePath: string; const templateID: string; const locale: string; const bipSessionToken: string): TByteDynArray;
begin
  { TODO - Implement method getTemplateInSession }
end;

function PublicReportServiceImpl.createReportWithDataModel(const reportName: string; const folderAbsolutePathURL: string; const dataModelURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; 
                                                           const XLIFFData: TByteDynArray; const updateFlag: Boolean; const userID: string; const password: string): string;
begin
  { TODO - Implement method createReportWithDataModel }
end;

function PublicReportServiceImpl.createReportWithDataModelInSession(const reportName: string; const folderAbsolutePathURL: string; const dataModelURL: string; const templateFileName: string; const templateData: TByteDynArray; const XLIFFFileName: string; 
                                                                    const XLIFFData: TByteDynArray; const updateFlag: Boolean; const bipSessionToken: string): string;
begin
  { TODO - Implement method createReportWithDataModelInSession }
end;

function PublicReportServiceImpl.updateTemplateForReport(const reportAbsolutePath: string; const templateName: string; const locale: string; const templateData: TByteDynArray; const userID: string; const password: string
                                                         ): Boolean;
begin
  { TODO - Implement method updateTemplateForReport }
end;

function PublicReportServiceImpl.updateTemplateForReportInSession(const reportAbsolutePath: string; const templateName: string; const locale: string; const templateData: TByteDynArray; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method updateTemplateForReportInSession }
end;

function PublicReportServiceImpl.uploadXLIFFForReport(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const userID: string; const password: string
                                                      ): Boolean;
begin
  { TODO - Implement method uploadXLIFFForReport }
end;

function PublicReportServiceImpl.updateXLIFFForReportInSession(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method updateXLIFFForReportInSession }
end;

function PublicReportServiceImpl.updateXLIFFForReport(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const userID: string; const password: string
                                                      ): Boolean;
begin
  { TODO - Implement method updateXLIFFForReport }
end;

function PublicReportServiceImpl.uploadXLIFFForReportInSession(const reportAbsolutePath: string; const xliffData: TByteDynArray; const layoutFileName: string; const locale: string; const bipSessionToken: string): Boolean;
begin
  { TODO - Implement method uploadXLIFFForReportInSession }
end;

function PublicReportServiceImpl.uploadReportObject(const reportObjectAbsolutePathURL: string; const objectType: string; const objectZippedData: TByteDynArray; const userID: string; const password: string): string;
begin
  { TODO - Implement method uploadReportObject }
end;

function PublicReportServiceImpl.uploadReportObjectInSession(const reportObjectAbsolutePathURL: string; const objectType: string; const objectZippedData: TByteDynArray; const bipSessionToken: string): string;
begin
  { TODO - Implement method uploadReportObjectInSession }
end;

function PublicReportServiceImpl.downloadReportObject(const reportAbsolutePath: string; const userID: string; const password: string): TByteDynArray;
begin
  { TODO - Implement method downloadReportObject }
end;

function PublicReportServiceImpl.downloadReportObjectInSession(const reportAbsolutePath: string; const bipSessionToken: string): TByteDynArray;
begin
  { TODO - Implement method downloadReportObjectInSession }
end;

function PublicReportServiceImpl.getObjectSecurityXML(const adminUsername: string; const adminPassword: string; const objectAbsolutePath: string; const isRecursive: Boolean): TByteDynArray;
begin
  { TODO - Implement method getObjectSecurityXML }
end;

initialization
  { PublicReportService - Server implementation class }
  InvRegistry.RegisterInvokableClass(PublicReportServiceImpl);

  InvRegistry.RegisterException(TypeInfo(PublicReportService), fault1);
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'logout');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getReportParameters');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'createReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'runReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'runReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getReportDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getReportDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getReportParametersInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getTemplateParameters');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getTemplateParametersInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getFolderContents');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getFolderContentsInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deliveryService');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deliveryServiceInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'scheduleReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'scheduleReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'hasReportAccess');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'hasReportAccessInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getScheduledReportStatus');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getScheduledReportStatusInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getListOfScheduledReportsStatus');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getListOfScheduledReportsStatusInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getScheduledReportInfo');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getScheduledReportInfoInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getScheduledReportHistoryInfo');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getScheduledReportHistoryInfoInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'suspendScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'suspendScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'resumeScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'resumeScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteScheduledReportHistory');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteScheduledReportHistoryInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'createReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'updateReportDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'updateReportDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'createReportFolder');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'createReportFolderInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'removeTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'removeTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteFolder');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'deleteFolderInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getTemplate');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getReportSampleData');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getReportSampleDataInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getXDOSchema');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getXDOSchemaInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'getTemplateInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'createReportWithDataModel');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'createReportWithDataModelInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'updateTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'updateTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadXLIFFForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'updateXLIFFForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'updateXLIFFForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadXLIFFForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadReportObject');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'uploadReportObjectInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'downloadReportObject');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault1, 'downloadReportObjectInSession');
  InvRegistry.RegisterException(TypeInfo(PublicReportService), fault);
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'logout');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'impersonate');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getReportParameters');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'createReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'login');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'runReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'runReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getReportDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getReportDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getReportParametersInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getTemplateParameters');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getTemplateParametersInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getFolderContents');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getFolderContentsInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getDeliveryServiceDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getDeliveryServiceDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deliveryService');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deliveryServiceInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'scheduleReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'scheduleReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'isReportExist');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'isReportExistInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'isFolderExist');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'isFolderExistInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getScheduledReportStatus');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getScheduledReportStatusInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getListOfScheduledReportsStatus');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getListOfScheduledReportsStatusInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getScheduledReportInfo');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getScheduledReportInfoInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getScheduledReportHistoryInfo');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getScheduledReportHistoryInfoInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'suspendScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'suspendScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'resumeScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'resumeScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteScheduledReportHistory');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteScheduledReportHistoryInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'createReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'updateReportDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'updateReportDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'createReportFolder');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'createReportFolderInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'removeTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'removeTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteFolder');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'deleteFolderInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getTemplate');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getReportSampleData');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getReportSampleDataInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getXDOSchema');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getXDOSchemaInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getTemplateInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'createReportWithDataModel');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'createReportWithDataModelInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'updateTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'updateTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadXLIFFForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'updateXLIFFForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'updateXLIFFForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadXLIFFForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadReportObject');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'uploadReportObjectInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'downloadReportObject');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'downloadReportObjectInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault, 'getObjectSecurityXML');
  InvRegistry.RegisterException(TypeInfo(PublicReportService), fault2);
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getReportParameters');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'createReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'runReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'runReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getReportDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getReportDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getReportParametersInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getTemplateParameters');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getTemplateParametersInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getFolderContents');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getFolderContentsInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deliveryService');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deliveryServiceInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'scheduleReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'scheduleReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getScheduledReportStatus');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getScheduledReportStatusInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getListOfScheduledReportsStatus');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getListOfScheduledReportsStatusInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getScheduledReportInfo');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getScheduledReportInfoInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getScheduledReportHistoryInfo');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getScheduledReportHistoryInfoInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'suspendScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'suspendScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'resumeScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'resumeScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteScheduledReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteScheduledReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteScheduledReportHistory');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteScheduledReportHistoryInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'createReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'updateReportDefinition');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'updateReportDefinitionInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'createReportFolder');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'createReportFolderInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'removeTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'removeTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadReportDataChunk');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'downloadReportDataChunk');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteFolder');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'deleteFolderInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getTemplate');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getReportSampleData');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getReportSampleDataInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getXDOSchema');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getXDOSchemaInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getTemplateInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'createReportWithDataModel');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'createReportWithDataModelInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'updateTemplateForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'updateTemplateForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadXLIFFForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'updateXLIFFForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'updateXLIFFForReport');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadXLIFFForReportInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadReportObject');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'uploadReportObjectInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'downloadReportObject');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'downloadReportObjectInSession');
  InvRegistry.RegisterExceptionMethod(TypeInfo(PublicReportService), fault2, 'getObjectSecurityXML');

• Unwrap wrapper elements (wrapped doc|lit services) (-Ou)

При выключенной опции "сворачивает" входные параметры методов в классы, что приводит к ЗНАЧИТЕЛЬНОМУ увеличению размера сгенерированного модуля, особенно если не отключена опция (-Od). Не рекомендую выключать эту опцию!

Пример (с отключенной опцией)
impersonate = class(TRemotable)
private
  FadminUsername: string;
  FadminPassword: string;
  Fusername: string;
published
  property adminUsername: string  read FadminUsername write FadminUsername;
  property adminPassword: string  read FadminPassword write FadminPassword;
  property username:      string  read Fusername write Fusername;
end;

PublicReportService = interface(IInvokable)
['{A24578A2-A6A4-6155-3B06-64AC06C9A70F}']
  function  impersonate(const parameters: impersonate): impersonateResponse; stdcall;
end;

Пример (с включенной опцией)
PublicReportService = interface(IInvokable)
['{A24578A2-A6A4-6155-3B06-64AC06C9A70F}']
  function  impersonate(const adminUsername: string; const adminPassword: string; const username: string): string; stdcall;
end;

• Generate verbose information about types and interfaces (-Ov)

Отключение этой опции отключает генерацию комментариев, что прилично снижает итоговый размер сгенерированного модуля. Имеет смысл отключать!

• Map string to WideString (-Ow)

При включенной опции тип string будет заменен на WideString.

Пример (с отключенной опцией)
TemplateFormatLabelValue = class(TRemotable)
private
  FtemplateFormatLabel: string;
  FtemplateFormatValue: string;
published
  property templateFormatLabel: string  Index (IS_NLBL) read FtemplateFormatLabel write FtemplateFormatLabel;
  property templateFormatValue: string  Index (IS_NLBL) read FtemplateFormatValue write FtemplateFormatValue;
end;

Пример (с включенной опцией)
TemplateFormatLabelValue = class(TRemotable)
private
  FtemplateFormatLabel: WideString;
  FtemplateFormatValue: WideString;
published
  property templateFormatLabel: WideString  Index (IS_NLBL) read FtemplateFormatLabel write FtemplateFormatLabel;
  property templateFormatValue: WideString  Index (IS_NLBL) read FtemplateFormatValue write FtemplateFormatValue;
end;

• Generate class aliases as class types (-Ox)

При включенной опции для классов будут сгенерированы псевдонимы (можно отключать по желанию).

Пример (с отключенной опцией)
fault                = class;                 { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Flt][GblElm] }
fault1               = class;                 { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Flt][GblElm] }
fault2               = class;                 { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Flt][GblElm] }

fault = class(ERemotableException)
private
published
end;

fault1 = class(ERemotableException)
private
published
end;

fault2 = class(ERemotableException)
private
published
end;

initialization
  RemClassRegistry.RegisterXSClass(fault, 'http://xmlns.oracle.com/oxp/service/PublicReportService', 'fault');
  RemClassRegistry.RegisterXSClass(fault1, 'http://xmlns.oracle.com/oxp/service/PublicReportService', 'fault1');
  RemClassRegistry.RegisterXSClass(fault2, 'http://xmlns.oracle.com/oxp/service/PublicReportService', 'fault2');

Пример (с включенной опцией)
fault           =  type AccessDeniedException;      { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Flt][GblElm] }
fault1          =  type InvalidParametersException;      { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Flt][GblElm] }
fault2          =  type OperationFailedException;      { "http://xmlns.oracle.com/oxp/service/PublicReportService"[Flt][GblElm] }

initialization
  RemClassRegistry.RegisterXSInfo(TypeInfo(fault), 'http://xmlns.oracle.com/oxp/service/PublicReportService', 'fault');
  RemClassRegistry.RegisterXSInfo(TypeInfo(fault1), 'http://xmlns.oracle.com/oxp/service/PublicReportService', 'fault1');
  RemClassRegistry.RegisterXSInfo(TypeInfo(fault2), 'http://xmlns.oracle.com/oxp/service/PublicReportService', 'fault2');

• Use TXSxxxx classes for simple nillable types (-Oz)

При включенной опции вместо простых nillable типов будут использоваться классы TXSxxxx.

Пример (с отключенной опцией)
TemplateFormatLabelValue = class(TRemotable)
private
  FtemplateFormatLabel: string;
  FtemplateFormatValue: string;
published
  property templateFormatLabel: string  Index (IS_NLBL) read FtemplateFormatLabel write FtemplateFormatLabel;
  property templateFormatValue: string  Index (IS_NLBL) read FtemplateFormatValue write FtemplateFormatValue;
end;

Пример (с включенной опцией)
TemplateFormatLabelValue = class(TRemotable)
private
  FtemplateFormatLabel: TXSString;
  FtemplateFormatValue: TXSString;
public
  destructor Destroy; override;
published
  property templateFormatLabel: TXSString  Index (IS_NLBL) read FtemplateFormatLabel write FtemplateFormatLabel;
  property templateFormatValue: TXSString  Index (IS_NLBL) read FtemplateFormatValue write FtemplateFormatValue;
end;

Разобравшись с мастером, перейдем к рассмотрению примера, который работает с сервисом версии 10g (на момент создания примера о новых сервисах я просто не знал).

Начнем с авторизации (здесь и далее код упрощен для облегчения понимания, полный исходный код находится в примере в конце статьи).

var
  PRS: PublicReportService;
  Catalog: CatalogContents;
  Session: string;

procedure TMainForm.btnLoginClick(Sender: TObject);
begin
   PRS := GetPublicReportService(False, edServer.Text);
   Session := PRS.login(cbLogin.Text, edPassword.Text);
end;

Создаем объект для работы с сервисом и авторизуемся, воспользовавшись методом login, не забыв сохранить возвращенный идентификатор сессии. Большинство методов сервиса существуют в двух перегруженных вариантах. Первый вариант принимает идентификатор сессии, второй принимает пару значений - логин и пароль. Я предпочитаю первый вариант, дабы не допускать различных казусов, которые могут возникнуть из-за того, что мы залогинились от имени одного пользователя, а методы вызываем от имени другого.

Теперь посмотрим какие отчеты нам доступны.

procedure TMainForm.btnScanDirClick(Sender: TObject);

  procedure ScanSubDir(StartPath: string; const arr: ArrayOfItemData;
    var Tree: TTreeView; RootNode: TTreeNode);
  var
    i: Integer;
    ItemData: PItemData;
    Node: TTreeNode;
    c: CatalogContents;

    tmp: string;
  begin
     if Length(arr) = 0 then
        Exit;

     for i := Low(arr) to High(arr) do
     begin
        New(ItemData);

        ItemData^.AbsolutePath := arr[i].absolutePath;
        ItemData^.DisplayName := arr[i].displayName;
        ItemData^.FileName := arr[i].fileName;
        ItemData^.Owner := arr[i].owner;
        ItemData^.ParentAbsolutePath := arr[i].parentAbsolutePath;
        ItemData^.ItemType := arr[i].type_;

        Node := Tree.Items.AddChild(RootNode, arr[i].displayName);
        Node.Data := ItemData;

        if AnsiUpperCase(arr[i].type_) = 'REPORT' then
        begin
           Node.ImageIndex := 2;
           Node.SelectedIndex := 2;
        end;

        if AnsiUpperCase(arr[i].type_) = 'DATAMODEL' then
        begin
           Node.ImageIndex := 1;
           Node.SelectedIndex := 1;
        end;

        if AnsiUpperCase(arr[i].type_) = 'FOLDER' then
        begin
           Node.ImageIndex := 0;
           Node.SelectedIndex := 0;

           try
              c := PRS.getFolderContentsInSession(ItemData^.AbsolutePath, Session);
           except
              on E: ERemotableException do
              begin
                 // Исправляем AbsolutePath
                 tmp := StringReplace(ItemData^.AbsolutePath,
                    StringReplace(StartPath, '\/', '/', [rfReplaceAll]), '', []);
                 if tmp[1] = '/' then
                    tmp := Copy(tmp, 2, Length(tmp)-1);
                 ItemData^.AbsolutePath :=
                    StartPath + '/' + StringReplace(tmp, '/', '\/', [rfReplaceAll]);

                 c := PRS.getFolderContentsInSession(ItemData^.AbsolutePath, Session);
                 end;
              end;
           end;

           if Assigned(c) then
              ScanSubDir(ItemData^.AbsolutePath, c.catalogContents, Tree, Node);
        end;
     end;
  end;

begin
   if Trim(edDir.Text) = '' then
      edDir.Text := '/';

   try
      Catalog := PRS.getFolderContentsInSession(edDir.Text, Session);
   except
      Exit;
   end;

   if not Assigned(Catalog) then
      Exit;

   ScanSubDir(edDir.Text, Catalog.catalogContents, DirTreeForm.tvDirs, nil);
end;

Если не задана директория для сканирования, начинаем сканировать с корневой директории - '/'. Метод getFolderContentsInSession возвращает список объектов (каталогов - FOLDER, отчетов - REPORT, моделей данных - DATAMODEL), находящихся по указанному пути. Если хоть один объект найден, начинаем рекурсивное сканирование.

В Publisher версии 11.1.1.7.140527, с которой я работал, имеется неприятный баг. Допустим, на сервере имеется следующая структура каталогов:

shared
   |- Отчет по доходам/расходам

Корректный ответ от сервиса с абсолютным путем должен выглядеть следующим образом:

/shared/Отчет по доходам\/расходам

т.е. слеш в названии директории должен экранироваться (к слову, при работе с Publisher через браузер так и происходит).


Но сервис возвращает совсем не то, что ожидалось:

/shared/Отчет по доходам/расходам

Естественно такого пути на сервере нет, и сервер кидает исключение, которое нужно перехватить и корректно обработать (исправить путь).


Если этого не сделать, то ошибки будут поджидать нас как при попытке получить информацию о параметрах отчета


так и при попытке его запуска


Так как для построения дерева используется параметр "Абсолютный путь", то только он и подвергается обработке, параметр "Абсолютный путь предка" не редактируется. Результат этой правки хорошо виден на следующих скриншотах - параметры "Абсолютный путь" и "Абсолютный путь предка". Результат, как говорится, на лицо.


Конечно есть и другие (и даже более правильные) пути решения, но, к сожалению, все они не для меня (у меня нет доступа к серверу):

1) накатить Patch 17979327
2) накатить Bundle Patch 11.1.1.7.140715
3) установить сразу BIPublisher 11.1.1.9
4) декомпилировать jar-файл с логикой веб-сервисов и пересобрать его.

Мне же не оставалось ничего другого, кроме исправления AbsolutePath непосредственно в клиенте. Я поместил этот код в секцию except блока try, так что если вы пользуетесь более свежей версией Publisher, код отработает корректно.

Выбрав в дереве какой-либо объект, пробуем получить информацию по нему, а если это отчет, то еще и его параметры.

procedure TDirTreeForm.tvDirsChange(Sender: TObject; Node: TTreeNode);
var
  i: Integer;
  ItemData: PItemData;
  Report: ReportDefinition;
  Ppnv: PParamNameValue;
begin
   Clear;

   ItemData := Node.Data;

   edAbsolutePath.Text := ItemData^.AbsolutePath;
   edDisplayName.Text := ItemData^.DisplayName;
   edFileName.Text := ItemData^.FileName;
   edOwner.Text := ItemData^.Owner;
   edParentAbsolutePath.Text := ItemData^.ParentAbsolutePath;
   edType.Text := ItemData^.ItemType;

   edParameterCount.Text := '';
   for i := 0 to cbReportParameters.Items.Count-1 do
      Dispose(PParamNameValue(cbReportParameters.Items.Objects[i]));
   cbReportParameters.Items.Clear;

   tsReportParametrs.TabVisible := UpperCase(PItemData(tvDirs.Selected.Data)^.ItemType) = 'REPORT';

   if UpperCase(PItemData(tvDirs.Selected.Data)^.ItemType) = 'REPORT' then
   begin
      try
         Report := PRS.getReportDefinitionInSession(PItemData(tvDirs.Selected.Data)^.AbsolutePath, Session);

         edParameterCount.Text := IntToStr(Length(Report.parameterNames));
         for i := Low(Report.parameterNames) to High(Report.parameterNames) do
         begin
            New(Ppnv);
            Ppnv^ := Report.reportParameterNameValues[i];
            cbReportParameters.Items.AddObject(
               Report.reportParameterNameValues[i].name_,
               TObject(Ppnv));
         end;
         if Length(Report.parameterNames) > 0 then
         begin
            cbReportParameters.ItemIndex := 0;
            cbReportParametersChange(cbReportParameters);
         end;
      except
         on E: Exception do
         begin
            tsReportParametrs.TabVisible := False;
            LogForm.WriteToLog(['Error: ' + E.Message]);
         end;
      end;
   end;
end;


При получении параметров по отчету обнаружилась еще одна неприятность. Допустим у модели данных есть параметр с типом menu и атрибутом multiValuesAllowed (множественный выбор).


Если этот атрибут установлен - значит меню допускает множественный выбор


иначе нет.


Если запускать отчет из браузера, все нормально, меню отображается в полном соответствии со значением атрибута (что подтверждается скриншотами выше). А вот сервис, вне зависимости от того, включен упомянутый выше флаг или нет, всегда возвращает False.


Если не рассматривать варианты с обновлением сервера, из этой ситуации можно выкрутиться добавляя к имени параметра префикс в зависимости от значения атрибута multiValuesAllowed, и опираться на это при разработке своего клиента.

Теперь откроем какой-нибудь отчет.

procedure TDirTreeForm.tvDirsDblClick(Sender: TObject);
var
  Report: ReportDefinition;
  IndexReport: Integer;
  rRequest: ReportRequest;
  rResponse: ReportResponse;
  tmtFileName: string;
  Localize: string;
  s: TBytesStream;
  OutputFormat: TRecFormat;
begin
   if Assigned(tvDirs.Selected) then
      if AnsiUpperCase(PItemData(tvDirs.Selected.Data)^.ItemType) = 'REPORT' then
      begin
         Report := PRS.getReportDefinitionInSession(PItemData(tvDirs.Selected.Data)^.AbsolutePath, Session);

         if Length(Report.listOfTemplateFormatsLabelValues) > 0 then
         begin
            // Выбор шаблона
            IndexReport := SelectForm.SelectReport(Report.listOfTemplateFormatsLabelValues, cbMinQuestion.Checked);

            if SelectForm.ModalResult = mrOk then
            begin
               // Выбор формата
               OutputFormat := SelectForm.SelectFormat(
                  Report.listOfTemplateFormatsLabelValues[IndexReport].listOfTemplateFormatLabelValue,
                  cbMinQuestion.Checked);

               if SelectForm.ModalResult = mrOk then
               begin
                  // Выбор локализации
                  Localize := SelectForm.SelectLocalize(
                     Report.listOfTemplateFormatsLabelValues[IndexReport].templateAvailableLocales,
                     cbMinQuestion.Checked);

                  if SelectForm.ModalResult = mrOk then
                  begin
                     rRequest := ReportRequest.Create;
                     rRequest.attributeFormat := OutputFormat.FormatValue;
                     case SelectForm.ModalResult of
                        mrOk: rRequest.attributeLocale := Localize;
                        else // Значение
                           rRequest.attributeLocale := 'en-US';
                     end;
                     rRequest.attributeTemplate := Report.listOfTemplateFormatsLabelValues[IndexReport].templateID;
                     rRequest.reportAbsolutePath := PItemData(tvDirs.Selected.Data)^.AbsolutePath;
                     rRequest.sizeOfDataChunkDownload := -1;

                     try
                        rResponse := PRS.runReportInSession(rRequest, Session);

                        tmtFileName := ExtractFilePath(ParamStr(0)) + 'reports\' + Report.defaultTemplateId + OutputFormat.Ext;

                        if not DirectoryExists(ExtractFilePath(ParamStr(0)) + 'reports\') then
                           ForceDirectories(ExtractFilePath(ParamStr(0)) + 'reports\');

                        s := TBytesStream.Create(TBytes(rResponse.reportBytes));
                        s.SaveToFile(tmtFileName);
                        ShellExecute(Application.Handle, 'open', PChar(tmtFileName), '', '', SW_SHOWNORMAL);
                     finally
                        FreeAndNil(s);
                     end;
                  end;
               end
            end;
         end;

         Report.Destroy;
      end;
end;

Подготовка к открытию отчета состоит из 3 шагов:

1. Отчет может содержать в себе несколько шаблонов, поэтому сначала предлагаем пользователю выбрать, по какому именно шаблону нужно сформировать отчет.


2. Отчет может поддерживать выгрузку в различные форматы (Word, Excel, PDF и т.п.), поэтому предлагаем пользователю выбрать, в каком именно формат отчет ему нужен.


3. Отчет может иметь несколько вариантов локализации, поэтому предлагаем пользователю выбрать нужную.


Алгоритм формирования отчета довольно прост, отчет формируется на сервере, затем мы полностью выкачиваем его на локальную машину и запускаем (за выгрузку отвечает метод runReportInSession).

Ключевой момент

rRequest.sizeOfDataChunkDownload := -1;

Используя различные значение, бОльшие 0, можно организовать порционную начитку данных, а значение -1 говорит о том, что нужно получить все данные за раз.

Возможно вы обратили внимание на галочку "Не надоедать вопросами". Она облегчает жизнь пользователям, скрывая от него диалоговые окна с одним единственным вариантом выбора (зачем что-то спрашивать у пользователя, если ответ очевиден, как на левом скриншоте окна с выбором локали выше?).

Иногда бывает полезным выгрузить с сервера объект (отчеты, шаблоны, модели, метаданные и т.п.) для более детального изучения. Сделать это можно следующим образом:

procedure TDirTreeForm.btDownloadReportObjectClick(Sender: TObject);
var
  Data: TByteDynArray;
  bs: TBytesStream;
  DirToSave: string;
begin
   if not Assigned(tvDirs.Selected) then
   begin
      ShowMessage('Не выбран объект для выгрузки');
      Exit;
   end;

   Data := PRS.downloadReportObjectInSession(
      PItemData(tvDirs.Selected.Data)^.AbsolutePath, Session);

   if Length(Data) > 0 then
   try
      bs := TBytesStream.Create(TBytes(Data));
      bs.Position := 0;

      DirToSave := ExtractFilePath(ParamStr(0)) + 'download\';
      if not DirectoryExists(DirToSave) then
         ForceDirectories(DirToSave);

      bs.SaveToFile(DirToSave + PItemData(tvDirs.Selected.Data)^.FileName + '.zip');
      ShowMessage('Объект успешно выгружен');
   finally
      FreeAndNil(bs);
   end;
end;

Таким вот нехитрым образом можно расширить функциональные возможности своего приложения, связанные с генерацией отчетности.

.: Пример к данной статье :.


При использовании материала - ссылка на сайт обязательна