Run Reports & Dispatch Reports

In today's competitive environment getting reliable information quickly could mean the difference between an opportunity gained or lost.

GTD Excel Report Server pull data from the Database, and output data in Excel format.

Running Reports in a Multi-tiered Architecture



The Reports Server enables you to run reports using a multi-tiered architecture. This means that you can submit a report request from a client machine to run on a high-performance server machine, while accessing data from a separate database server.

 

The Reports Server supports on-demand delivery from a "thin" client. When used in conjunction with the Reports Web Cartridge, Web CGI, or Servlet, you can dynamically run reports from a Web browser using standard URL syntax.

 

There are many ways to run reports.
  1. If you are administrator or developer, you can navigate to Report Manager, and then click Run to run report.
  2. If you common user, please navigate to My Reports, and then click Run to run report.
  3. Besides running from web page of GTD server, you can also run a report request from a Web browser using URL syntax.
    You can integrate GTD Server into your application. Your application compose the URL and call GTD server to serve back report output.

 

Run report from web pages of GTD Server

 

You can logon GTD Server through web browser such as IE to run report.

1. Logon GTD server, navigate to Run Report page.

2. On the Run Report page, enter/change the value of parameter if availiable, select data source, click Submit button.

3. The GTD server will serve back excel output.

Tip: Please fill in the receipts's e-mail address to Email Report To inbox, if you don't want to send email, please let it blank.

Tip: The Serve back report output to browser option will be valid only you fill in the receipts's e-mail address.

Tip: You can customize the email that is sent with the report output, for more inforamtion see Email Template Manager

Run report from your application

 

It is easy to integrate GTD Server into your application. Now let's study how to compose an URL to run GTD Report.

URL Syntax:

http://<host-name-or-ip>:<port>/runrep.do?reportid=<the-report-id>&datasource=<the-data-source>[<&param1=value1>...]

Square brackets (“[” and “]”) indicate optional parts of URL definitions.

The URL is composed by:

Example

Suppose there is a table named emp in your database.

SQL> desc emp
Name      Type
--------- ------------
ENAME     VARCHAR2(20)
DEPTNO    VARCHAR2(10)
BIRTH_DAY DATE
SALARY    NUMBER(10,2)

You create a report named testreport, the data model looks like:

The URL looks simular to:

http://test2:8002/runrep.do?reportid=testreport&datasource=dev&birthday=08/18/1979&salary=7800&deptno=211&mailto=bill@abc.com

In this URL, you specify

Note: Default Date and Time Pattern is mm/dd/yyyy or MM/DD/YYYY hh:mm:ss

Example: 01/23/2008, 12/03/2007 13:55:43

URL Encoding

Only alphanumerics [0-9a-zA-Z], the special characters "$-_.+!*'()," [not including the quotes - ed], and reserved characters used for their reserved purposes may be used unencoded within a URL.

URL encoding of a character consists of a "%" symbol, followed by the two-digit hexadecimal representation (case-insensitive) of the ISO-Latin code point for the character.

Example:

http://test2:8002/runrep.do?reportid=richmen&datasource=dev&name=bill%20gates

Login automatically

You can specify the user id and password by the URL, and the user doesn't need to login from Login Page. For example:

http://localhost:8080/report/runrep.do?reportid=sales2009&gtdlogin=john/1234

John is user id, and the password is 1234.

Run report from your oracle forms

 

You are using oracle forms, and want to get excel output, it is simple.

For web-based oracle forms

See the sample code below, you can build the url can run it using show_document built-in.

declare
v_url varchar2(1000);
v_birthday varchar2(100) := '08/18/1979';
v_salary varchar2(100) := '7800';
begin
v_url := 'http://test2:8002/runrep.do?';
v_url := v_url || 'reportid=testreport&datasource=dev&';
v_url := v_url || 'birthday='||v_birthday||'&salary='||v_salary||'&deptno=211';
web.show_document(v_url,'_blank');
end;

For oracle forms runing on client site

See the sample code below.

declare
v_url varchar2(1000);
v_birthday varchar2(100) := '08/18/1979';
v_salary varchar2(100) := '7800';
begin
v_url := 'http://test2:8002/runrep.do?';
v_url := v_url || 'reportid=testreport&datasource=dev&';
v_url := v_url || 'birthday='||v_birthday||'&salary='||v_salary||'&deptno=211';
HOST('iexplore.exe ' || v_url,'_blank');
end;

Options for Running Reports

 

In addition to reportid and datasource parameters, there are several key words used to sepcify additional options.

mailto

This key word specifies the e-mail address of receipts.

desformat

This key word specifies the format of report output. There are 2 options:

Default value: excel.

nullval

This key word specifies customized parameters that will be set null.

Tip: This option is not recommended. We suggest you to setup default value for parameters.

saveto

This key word specifies the path of the report output, if you want to save the report output to cache directory, and open it later.

iszipoutput

This key word specifies whether the server compress the report output. You need to unzip the output file by software lik WinZip etc. There are 2 options:

Default value: no.

Examples:

1. The URL looks simular to:

http://test2:8002/runrep.do?reportid=testrep&datasource=dev&mailto=bill@abc.com+gates@abc.com&desformat=delimited

Once GTD Server accepts this request, it will execute the testrep report, and send the report output in delimited format to bill@abc.com & gates@abc.com

 

2. The URL looks simular to:

http://test2:8002/runrep.do?reportid=testrep&datasource=dev&mailto=bill@abc.com+SERVEBACKTOBROWSER+gates

In this URL, you specify 3 receipts

  1. bill@abc.com
  2. gates
  3. SERVEBACKTOBROWSER

The report output will be sent to bill@abc.com. However gates is not a valid e-mail address, if so, GTD will append the Email Address Postfix to the user name.

For example: If you set postfix to @microsoft.com, the full e-mail address is gates@microsoft.com. See Email Address Postfix

SERVEBACKTOBROWSER

This is not receipts's name, it is a key word that means GTD should serve back report output to browser.

3. The URL looks simular to:

http://test2:8002/runrep.do?reportid=testreport&datasource=dev&birthday=08/18/1979&nullval=salary+deptno

In this URL, you specify 3 custom parameters, 2 of them is null.

 

4. The URL looks simular to:

http://test2:8002/runrep.do?reportid=testreport&datasource=dev&birthday=08/18/1979&deptno=&nullval=salary

Once GTD Server accepts this request, it will execute the testrep report, and send the report output in delimited format to bill@abc.com & gates@abc.com

In this URL, you specify 3 custom parameters, the deptno is empty string.

Run Report in the Background

 

By default the GTD Report Server will serve back report output synchronously after the report is generated. However, sometimes it may take a long time to generate the report, and the user has no idea whether the server is still working, so the server will return a web page, display the status of the job. The report is running in the background, the user can close the browser and download the report output in the "Cached report output" section of the "My Report" page.

Background Running Configuration

In the server configuration page, you can see the Background Running Configuration section.

You can click Edit link to alter the behaver of the server.

Cache directory: Specify the path of the directory that is used to cache the report output. If you don't setup this parameter, the Configuration Directory/cache directory is applied by default.

Clear cache policy: The GTD server will delete the cached files automatically, you can setup how long the files are kept in the folder.

Switch to background running policy: The GTD Server will switch to background running only if the job doesn't finish within specified seconds.

Maximum number of concurrent jobs: To avoid out of memery error, you can limite the number of concurrent jobs.

Maximum number of queuing jobs: If the number of request exceed the maxmum conconrrent jobs, some request will be added to queue.

Front Interfae of Background Running

1. You will see a authmatical refresh page when the report is switch to background running.

2. If the report is generated sucessfully, you will see the download link, otherwise you will see the error message.

3. You can also check the report output later in Report Output Cache section of the My Report page, if you login as common user.

4. If you are administrator/developer, you can view call the cached file list. However, you can not view the content of the report that is not created by you.