2.1. TfrxReportServer

 TfrxReportServer component plays the role of a report server and HTTP server. This component does not require any additional components.

TfrxReportServer class inherited from TComponent

Properties:

Active: Boolean - the value, which indicates activity of the server. It may be used for starting the server by setting a value in "True";

Configuration: TfrxServerConfig - server configuration (TfrxServerConfig class is described below). Configuration changes become active only after you restart the server;

AllowIP: TStrings - list of authorized IP addresses. The format of the list is as following: one line contains one IP address. In cases when the server does not find a client's address in this list, the client will be forbidden to connect; if the list is empty, all addresses are allowed to connect;

DenyIP: TStrings - list of IP addresses forbidden to connect. The format of the list is as following: one line contains one IP address In cases when the server does not find a client's address in this list, the client will be forbidden to connect; if the list is empty, all addresses are allowed to connect;

PrintPDF: Boolean - pressing the "print" button in navigator's control panel (when viewing the resulting pages in a web browser) creates a PDF file, if this value is set to True. Otherwise, standard print action of the browser will be executed. Default setting is "True";

The following properties are inaccessible in object's inspector, but it is possible to access them from the code:

Statistic: TfrxServerStatistic - server statistics (TfrxServerStatistic is described below);

Totals: TStrings - readable form of server statistics information;

Variables: TfrxServerVariables - internal server variables (TfrxServerVariables is described below).

Methods:

constructor Create(AOwner: TComponent) - creation of an object;

procedure Open - startup of the server. At this moment all changes of configuration would be activated;

procedure Close - server shutdown;

Event handlers:

OnGetReport: TfrxServerGetReportEvent - may be used for loading the reports from any places (BLOB fields, files from any folders etc). Type of the handler:

TfrxServerGetReportEvent = procedure (ReportName: String; Report: TfrxReport) of object;

ReportName - name of the requested report; it may be used for identification of a specific report;

Report - an instance of the TfrxReport object, to which the report should be loaded.

OnGetVariables: TfrxServerGetVariablesEvent - can be used for manual processing of the parameters received from the client, as well as execution of any operations directly on a server.

TfrxServerGetVariablesEvent = procedure(const ReportName: String; Variables: TfrxVariables) of object;

ReportName - The name of the report transferred in query. It can be used for filtering one or another parameter directly in the handler;

Variables - The list of the parameters received from the client. See details about TfrxVariables in "Programmer's guide FastReport 3" [8].

TfrxServerConfig class inherited from TPersistent

Object of this class contains information about server configuration.

Properties:

Port: Integer - TCP/IP port number for client connection, default value is 80;

IndexFileName: String - default filename, if the filename field in HTTP query is empty. Default value is 'index.html';

SessionTimeOut: Integer - time of storing report results on the server (in seconds). Default value is 300. As soon as the default time expires, the report results will be deleted. It is set depending on specificities of created reports and methods of client-server interaction;

время ожидания активности клиента после его подключения в секундах, по умолчанию равно 60, по истечении этого времени сессия клиента будет удалена;

SocketTimeOut: Integer - timeout of waiting for client's response (in seconds). Default value is 60. When time expires, the session will be terminated.

Logging: Boolean - log writing, "True" - enabled, "False" - disabled, "True" is set by default;

LogPath: String - path to folder with logs; current folder by default;

ReportPath: String - path to folder with reports; current folder by default;

RootPath: String - path to folder with HTML files and reports results;

Login: String - user name for authentication. If line is empty - authentication is not required. Empty line is a default setting;

Password: String - password for authentication, empty line by default;

Compression: Boolean - compression of transferred documents, client support required; "True" by default;

MIC: Boolean - Message Integrity Checksum using MD5 algorithm. "True" by default;

NoCacheHeader: Boolean - document is not cached by client, "True" by default;

OutputFormats: TfrxServerOutputFormats - supported formats for requested reports, one or more from set (sfHTM, sfXML, sfXLS, sfRTF, sfTXT, sfPDF, sfJPG, sfFRP). By default, all elements of set are included;

ReportCaching: Boolean - enable the reports cache on a server (see details in section 3.11);

ReportCachePath: String - path to a folder with reports cache;

DefaultCacheLatency: Integer - reports in cache default storage time (in seconds).

Methods:

procedure LoadFromFile(const FileName: String) - load configuration from a file;

procedure SaveToFile(const FileName: String) - save configuration to a file.

TfrxServerStatistic class inherited from TPersistent

Properties:

CurrentReportsCount: Integer - number of reports currently build;

CurrentSessionsCount: Integer - number of sessions currently connected;

MaxReportsCount: Integer - maximum number of reports simultaneously built;

MaxSessionsCount: Integer - maximum number of sessions simultaneously connected;

TotalErrors: Integer - number of errors;

TotalReportsCount: Integer - number of reports;

TotalSessionsCount: Integer - number of sessions;

UpTimeDays: Integer (days),

UpTimeHours: Integer (hours),

UpTimeMins: Integer (minutes),

UpTimeSecs: Integer (seconds) - up time of the report server.

TfrxServerVariables class inherited from TCollection

Contains server variables.

Used (reserved) names of the variables will describe in the part 3.4.

Methods:

function GetValue(const Name: String): String - returns value of the variable with Name;

procedure AddVariable(const Name: String; const Value: String) - adds a variable with Name and Value.


< previous page main page next page >