You are on page 1of 43

FORCS Report Designer Workbook

Date:

2012-05-02

OZ REPORT
Training Workbook
The workbook has been developed for training classes and for self-study. Chapter 1 describes structure of OZ products and OZ server. Chapter 2 briefs on OZ Query Designer, how to create query and dataset. Chapter 3 briefs on OZ Report Designer, how to create report components and how to bind them with datasets created by Query Designer. In Chapter 4, 10 target reports are given as design challenges, the most typical and widely used styles of business report, by himself, with help of given design guide. After this class, the student will be able to design various styles of professional business report by applying these target reports.

Chapter 1 : Introduction 1. 2. 3. OZ product configuration OZ server structure Report design & operating procedure

Chapter 2 : OZ Query Designer 1. 2. 3. Database connection OZ data structure Query design

Chapter 3 : OZ Report Designer 1. 2. 3. 4. 5. 6. 7. Adding ODI Running & Saving Report Band Label Multiplex User defined parameter Calculated field

Chapter 4 : Designing Target Reports 1. 2. 3. 4. 5. 6. 7. 8. 9. List style report (Simple Table) Grouped list report (Grouped Table) Matrix table report (Crosstab) Master-detail report (Group Above Style) Single Query Master-detail report (Group Above Style) Multi Query Multi Column report Fixed form report using script Drill-down report Table Of Content link report

10. Multi language report

FORCS Report Designer Workbook

Date:

5/2/2012

Chapter 1 : Introduction
1. OZ Product configuration 2. OZ server structure 3. Report design & operating procedure

FORCS Report Designer Workbook

Date:

5/2/2012

1. OZ Product configuration

OZ Report Designer Design report forms and bind with datasets created using OZ Query Designer. OZ Query Designer Define and manage datasets to be used with OZ Report Designer. OZ Server Store and manage OZ report forms and send to the client. Create query result dataset and send to the client. Manage OZ repository. 3 of server types: Daemon Type(standalone), Servlet Type(WAS integrated), .NET Type(.NET Framework based) OZ Scheduler Server Create and publish reports automatically by given schedule. OZ Report Viewer - Preview and print OZ reports on the web. - Provide ActiveX, Applet, Flash, Silverlight, .Net, mobile App Viewer. - Export to PDF, HTML, Excel, DOC, TIFF, PPT format OZ Enterprise Manager - Register and manage reporting tasks to be auto-executed by the scheduler server. - Provide centralized management for multiple OZ servers and multiple scheduler servers. OZ Repository Manager Manage report form files(*.OZR) and dataset files(*.ODI) stored on the OZ server.

FORCS Report Designer Workbook

Date:

5/2/2012

2. OZ server structure
2.1. Daemon type server
Web Server HTML Database HTTP Firewall

Client

OZ Viewer

First download

OZ DB Pool
-

OZ Server

TCP/IP

Run in standalone and the client connects to it via the independent port number. OZ viewer is auto-downloaded from the port of web server. Use OZ servers own DB Pool.

2.2. Servlet type server

Firewall Database EJB Beans OZ DB Pool or WAS DB Pool WAS JSP Container Web Server HTML HTTP Client

OZ Server

OZ Viewer

Integrated with WAS(Web Application Server) and the client connects to it via the WAS port number. OZ viewer is auto-downloaded from the port of WAS. Use OZ servers own DB Pool or WASs DB Pool.

2.3. .Net type server

Database

Firewall .NET Framework Web Service aspx Container IIS HTML HTTP Client

OZ DB Pool

OZ Server

OZ Viewer

Integrated with .NET framework(IIS) and the client connects to it via the IIS port number. OZ viewer is auto-downloaded from the port of IIS. Use OZ servers own DB Pool.

FORCS Report Designer Workbook

Date:

5/2/2012

2.4. OZ Server Operation Flow

Execute report processing logic OZ Report Flash/Applet Viewer Viewer OCX load

Request report (HTML Tag) 1st download of viewer

Data Source Web Server HTMLs OZ Viewer WAS/.NET Framework EJB OZ Enterprise Server (Servlet type) Data processing XML (DTD/XSD) RDBMS

File Data

Ask form file Send form file Bind form and data Show report Ask data send data

OZ Enterprise Server (.net type)

SAP OZ Enterprise Server (Daemon Type) Legacy System

Call HTML Tag from web browser to request the report. Automatic download and install the OZ viewer from the webserver to the client computer. Launch the OZ viewer. OZ viewer requests report form file from OZ server. OZ server send form file to OZ viewer. OZ viewer requests data from OZ server.. OZ server create data module from data source. OZ server send data module to OZ viewer. OZ viewer shows report by binding form file and data module.

FORCS Report Designer Workbook

Date:

5/2/2012

3. Report design & operating procedure


3.1 Report design procedure
1st step

Query design
Create data store (database connection setup) Create dataset (create query) Save data information file (ODI file)

2nd step

Report design
Add ODI Design report forms Component property setup Bind component with ODI Save report (OZR file)

3rd step

Preview report
Run and Preview report

3.2 Reporting operation procedure


1st step

Start OZ server
Database connection setup Start OZ server

2nd step

Send ODI, OZR


Connect to OZ server repository Upload report file

3rd step

Create code calling OZ viewer


OZ viewer installing TAG OZ viewer calling TAG

4th step

Run Report
View, print and export report

FORCS Report Designer Workbook

Date:

5/2/2012

Chapter 2 : OZ Query Designer


1. OZ data structure 2. Database connection setup 3. Query design

FORCS Report Designer Workbook

Date:

5/2/2012

1. OZ Data Structure
OZ data structure consists of Data Store, Dataset, Dataset Field and they are stored in ODI (OZ Data Information) file. Student should understand concept of data objects, relationship between them, and usage of various data stores.

1.1. Data Store


Data store is a data repository for one of various data sources such as database, file, XML, etc. It is storing data information such as data source connection information, query definition, data source fields information. ODI name

2.2. Dataset
Dataset is a set of data fields selected from data store. The way to define dataset depends on the types of data store. Dataset for database store is defined by a query.

Data store Dataset Field

2.3. ODI
ODI is a file in XML format storing data stores. OZ Report Designer use ODI to map or bind report forms to data. Other Non-database Data store

2.4. Hierarchy of Data Store, Dataset and Field


One ODI file can have multiple data stores and one data store can have multiple datasets.

2.5. Types of Data Store


Type Database Store UDS (User Data Store) Description A data source interface to JDBC/ODBC/OLEDB RDBMS, Dataset is defined by SQL. A data source interface to external data sources like File data(Text, CSV, XML) or data from user applications (EJB, Servlet, ASP, JSP, Stored Procedure).

Group Data Store

Split a dataset of any data source into multiple datasets by the specified field. GDS is used to reconstuct a dataset into master-detail datasets. A data source interface to CSV file or XML file without DTD located on the server (accessed by path) A data interface to CSV file or XML file without DTD located on the web (accessed by URL) A data source interface to XML file with DTD/XSD A data source interface to result data from SAP R/3 RFC. A data source interface to result database from IBM Rational Clear Quest program. A data source interface to result data from web services.

File Store HTTP Store XML Store SAP Store CLEAR QUEST Store SOAP Store

FORCS Report Designer Workbook

Date:

5/2/2012

2. Database connection setup


Learns setting up database connection, adding database store and dataset.

2.1 Copy Sample file


Copy Education folder to My documents\OZRepository. DB is located on the path My documents\OZRepository\Education\data\OZSamples_en.mdb.

2.2 Set database as a system DSN on MS Windows


Register OZSamples_en.mdb as a system DSN using ODBC Data Source Administrator.

2.3 Adding Database Store


Create database store using ODBC/JDBC connection. Database store is one of various data source types. Select Add Store from the right mouse click popup menu on the DATABASE item in the OZ Data Tree of data window. DB Info tab of Add Database Connection Information dialog appears. Set database vendor to ODBC and Enter Store name, set Vendor to ODBC and enter Data Source Name. Once a database store has been added, the selected database become on-line and tables are listed in the table window.

2.4 Adding Dataset


Create a dataset to the database store. Dataset includes field information and query result data. Select Add Dataset from the right mouse click popup menu on the database store name you have created above. Enter dataset name, then the query window appears and you are ready to design query.

FORCS Report Designer Workbook

Date:

5/2/2012

3. Query Design
Learns how to design query in Design View mode and Manual mode. Student should get used to the query wizard.

3.1 Query design in Design View mode with Query Wizard


Design a query with visual way using drag & drop and query wizard. Use the query wizard to add tables, fields and to define join, condition, expressions, sort order, etc..

3.2 Query design in Manual mode


Write SQL statement by yourself or copy & paste into the query window.

10

FORCS Report Designer Workbook

Date:

5/2/2012

3.3 Run query


Select Run > Run Query from the menu bar or click the Run Query icon on the toolbar or push the <F5> key. Query result will be shown in the [Result] tab.

3.4 Save query as ODI file on local computer


Select File > Save from the menu bar and enter odi file name in the Save As dialog.

3.5 Upload ODI file to server repository


Click Open Repository from right mouse click popup menu on the Repository Server in Repository window. Using Server List dialog, Connect to OZ server and upload file to server repository.

11

FORCS Report Designer Workbook

Date:

5/2/2012

4. User defined parameter


User defined parameter is very useful for advanced business reports. Student should understand how it works and should be able to define and use parameters.

4.1 User Defined Parameter


User can define dataset parameters. This user defined parameter can be used in search condition of SQL and user enters or changes parameter values using report viewer at report runtime. User defined parameters can also be used in report logic for runtime user input such as user login data, database connection data.

4.2 Creating User Defined Parameter


Select Add Parameter Field from right mouse click popup menu on USER-DEFINED PARAMETER in the data window. Define parameters with USER-DEFINED PARAMETER dialog.

4.3 Referencing parameter in SQL


Parameter is referenced by #OZParam.parametername# format in SQL. User can insert parameter reference in SQL not only by manual writing but also by using parameter wizard.

12

FORCS Report Designer Workbook

Date:

5/2/2012

Chapter 3 : OZ Report Designer


1. Adding ODI 2. Running & Saving Report 3. Band 4. Label 5. Multiplex 6. User defined parameter 7. Calculated field

13

FORCS Report Designer Workbook

Date:

5/2/2012

1. Adding ODI
When launched Report Designer, the first thing you have to do is adding ODI to the report. All of dataset components (label, table, chart, crosstab, etc.) and dataset wizards dealing with dataset require ODI, because ODI provides data information. Student should be able to add ODI and understand its major properties.

1.1 Add ODI to report Select Insert ODI from the right mouse click popup menu on the Data Tree item in the data window and select your ODI file with the Repository File Window.

1.2 ODI Properties If select ODI from Data Tree in Data Information window, Property window shows its properties.

ODI Name & ODI File name:

Name of ODI object and name of ODI file Category Path :

ODI file path relative to the work folder. It must be the same as the ODI file path relative to the server repository. Get From Server :

If set to True, get ODI file from the server repository. It is used when the local computer on which Report Designer runs does not have the ODI file.

2. Running & Saving Report


2.1 Preview report
Click Preview icon ( ) on the icon bar or select File > Preview from the menu bar. Report viewer will be launched and show forms and data.

2.2 Save report as OZR file on the local computer


Select File > Save from the menu bar and enter ozr file name in the Save As dialog.

2.3 Upload OZR file to server repository


Click Open Repository from right mouse click popup menu on the Repository Server in Repository window. Using Server List dialog, Connect to OZ server and upload file to server repository.

14

FORCS Report Designer Workbook

Date:

5/2/2012

3. Band component
OZ Report Designer use a "band-oriented" design approach. A Report Band represents a specific area on a report page, used to specify where and when and how report components to be displayed on the report. All components in the report (label, table, crosstab, chart, shape, input component, etc.) are located in one of several bands. Student has to understand and master the usage of each band.

3.1 Major Band types


Band Type Title Page Header Data Header Data Group Header Group Footer Data Footer Page Footer Summary Dummy Tail Description prints starting content at the start of the report appears at the top of every page. prints starting content at the start of the associated data band. prints dataset on repeated pages prints at the start of a new group prints at the end of a new group prints ending content at the end of the associated data band. appears at the bottom of every page prints summarized data of the entire report prints blank form with no data prints ending content at the end of the report

FORCS Report Designer Workbook

Date:

5/2/2012

3.2 Major Data Band properties


Property Master Name Show Group Link ODI Name Dataset Name Fix Master Fix Title Repeat Number Fix Prior Group Header Description Mater band of the current data band Show arrow link between group labels ODI Name for the data band Dataset Name for the data band Prints Master band on every page Prints Data Header band on every page Repeat Data band by Repeat number record count Prints Prior Group Header on every page

Configuring Master-Detail relationship with Master Band


User can designate a data band as the master of the current data band by setting Master Name of the current data band to the other data band name.

16

FORCS Report Designer Workbook

Date:

5/2/2012

5. Label component
Label component represents values (text, dataset field value, system date, image, etc.) in various format (drawing type) on the report page. Various label types are provided for diverse data representation. User can select the label type according to the data type and drawing type of the value. Student should understand the data type and drawing type of a label, and should be able to change label type by changing data type and drawing type.

5.2 Label Types


Categor y Label Name Normal Label Data Type Text
Data Type ODI Name

Properties Normal Customer List


Data StockList StockList ProductName Blank Group StockList StockList CategoryName Merge Summary StockList StockList UnitsInStock Sum Expression Car.Amount.sum/ 1000 Carsales System Page_Of_Total / Parameter Carsales FromDate Image Tile Barcode CODE 39 HTML User Component tagfree

Icon - Text value - All bands

Description

Data label

Dataset Field Name NullType Data Type ODI Name

- Dataset field value - Data band and Data Expander band

Group Label

Dataset Field Name Grouping Rule Data Type ODI Name Dataset Field Name Summary Type Data Type Expression Expression ODI Name Data Type System Field Name Delimiter Data Type Parameter Set Name Parameter Name Data Type Image Style Data Type Barcode Data Type Data Type User Class

- Grouped data value - Data band and Data Expander band

Data type

Summary Label

- SUM, AVG, MAX, MIN, CNT of a field - All bands

Expression Label

- Result of the expression - All bands - System date of user PC & page numbering - All bands - User Defined Parameter (QD) & Form Parameter (RD) - All bands - Image - All bands - Barcode - All bands - HTML Text - All bands - Custom component - All bands - Very Large Text - All bands except Tail & Page Footer

System label

Parameter Label

Image Label Barcode Label Drawing Type HTML Label User Component

Data Type Note Label

Note

17

FORCS Report Designer Workbook

Date:

5/2/2012

6. Multiplex component
Label is the smallest unit of component that represents a value such as one dataset field. Contrastively, multiplex component represents multiple dataset fields as various types of complex forms according to the component type. Multiplex components are very essential for designing real business reports. Student has to understand features of various multiplex component and master usage of their wizard and major properties.

6.1 Types of Multiplex


OZ provides Table, Fixed Table, Crosstab, Chart, Gantt Chart, Region as multiplex component. Type Table Description Prints a dataset as a list table that consists of columns and rows. All labels of the table component is automatically mapped onto data fields of dataset. Use to design fixed form reports. User can assign not only the dataset field but also any other data to the arbitrary label of Fixed Table. Table form allows merge, split, insert, delete operation on the cell. Useful for data analysis & statistics report. Analyze the relationship between categorical variables and calculate summary such as Sum, Avg etc. Visualizes tabular data on the report page in various formats including bar, line, pie. Illustrates a project schedule with bar type graph. Use to create the sub-report in a report. A data band is dedicated to a dataset, hence to allow two datasets in one data band, create a region in the data band and give another dataset in the region.

Fixed Table

Crosstab Chart Gantt Chart Region

18

FORCS Report Designer Workbook

Date:

5/2/2012

6.2 Table Wizard and Options


Set table data configuration and display style with Table Wizard.

Option Set Row Count Outline Fixing Empty Label To Page End Display Row No Display Title Fix Title

Description The maximum number of rows to print If the row count above is larger than the one of actual result dataset, the remaining number of rows are printed as empty row. When the last page have empty space, fill the page with empty labels. Create a serial number column at the first column. Prints table header Prints table header on every page.

19

FORCS Report Designer Workbook

Date:

5/2/2012

6.3 CrossTab Wizard and Options


Set crosstab data configuration and display style with CrossTab Wizard.

Option Merged By row pivot By column pivot Using row title Title of field Show fields title Using column title Cell merge Merge cells on same data

Description Main title (the view selector on the top left) is independent from row title and column title. User can modify it. Main title follows row title Main title follows column title Show value titles at below the column title Show value titles at the right of row title Merge column cells with the same value.

Title of row or column

20

FORCS Report Designer Workbook

Date:

5/2/2012

6.4 Chart Wizard and Options


Set chart data configuration and display style with Chart Wizard.

6.4.1. Data tap


Configure chart data configuration such as X axis, Y axis, Series, Label, Legend.

Option Available Data Sets Available Fields X-Axis Y-Axis Left Y-Axis Right Series Label Select fields for the chart.

Description Select the dataset for the chart. Fields to be used as x-axis label. Select data type of the label from one of Item, Number, Date. Fields to be used as y-axis left label. Aggregation function (sum, avg, max, min) is allowed for the fields. Fields to be used as y-axis right label. Aggregation function (sum, avg, max, min) is allowed for the fields. Fields to be used as series. Fields to be used as data labels of the chart. The number of labels must be the same as one of y-axis fields. If not set, y-axis field data will be shown as data label.

21

FORCS Report Designer Workbook

Date:

5/2/2012

6.4.2 Major Chart Properties


Property OZ script (Link) OZ script (Range Link) OZ script (Label Link) Chart Out Direction Max Series Number Max X Axis Tick Number ODI Name Data Set Name Background Color Transparent Y Axis Grid Line Color Gradient Movable Editable Changeable Description Executed when clicking chart elements (bar, Line, Point, pie, etc.) Executed when selecting an area of the chart by dragging Executed when clicking X axis label or legend label Printing direction of multiple charts Maximum series count. If actual series count exceeds Max Series Number, the number of charts would be increased. Maximum X axis tick count. If actual X axis tick count exceeds Max X Axis Tick Number, the number of charts would be increased. ODI name of the dataset for the chart Dataset name for the chart. If the dataset of the chart is different from the dataset of the data band having the chart, the chart will be repeated as the record count of the data band dataset. Background color of the chart Transparency of the chart background Grid row background colors Gradient options for chart background Enable chart moving and resizing at the runtime(on the preview window) Enable chart editing at the runtime (on the preview window) Enable chart printing and property changing at the runtime (on the preview window)

22

FORCS Report Designer Workbook

Date:

5/2/2012

8. Calculated field
Calculated Field is a virtual field defined by user script with OZ Query Designer or Report Designer. Dataset field value comes from data source, although calculated field value comes from the result of script execution. Calculated field is used in the same way as dataset field. Learn how to define calculated field.

8.1 Creating Calculated Field using Java script


Select Add Calculated Field from right mouse click popup menu on the dataset item. After entering field name and selecting script type, create script using Java script editor.

23

FORCS Report Designer Workbook

Date:

2012-05-02

Chapter 4 : Designing Target Reports


For each task, target report specification is suggested and essential design guide (i.e., SQL, OZ features, technics, tips) needed to design the target report are provided. The student should understand those guide and implement them.

1. List style report (Simple Table)


- Target report: Customer list

2. Grouped list report (Grouped Table)


- Target report: Products grouped by category

3. Matrix table report (Crosstab)


- Target report: Sales status

4. Master-detail report (Group Above Style) Single Query


- Target report: Sales order list by State, City, Product Category

5. Master-detail report (Group Above Style) Multi Query


- Target report: Packing list by invoice

6. Multi Column report


- Target report: Mailing label printing

7. Fixed form report using script


- Target report: Calendar for any month, any year

8. Drill-down report
- Target report: Sales by country report, drill down from country on the chart or table to country detail

9. Table Of Content link report


- Target report: Using TOC link, move from the total sales report to the detail sales report

10. Multi language report


- Target report: Set a report to supports multiple language for global business report

24

FORCS Report Designer Workbook

Date:

2012-05-02

1. List style report (Simple Table)


Target report: Customer list

Implementation guide:
Display the current date in YYYY/MM/DD format on the top right corner of every page. (Use page header band, system label, label format). Display the page number in current page/total pages format on the bottom center of every page. (Use page footer band, system label). Configure customer information table (Use table wizard). Display the serial number on the first field of table (Use option in the table wizard). Display table header on every page (Use option in the table wizard). Set auto sizing and auto line warp and text align of table cells according to data. Change table header or title to your own text.

25

FORCS Report Designer Workbook

Date:

2012-05-02

Design tip:
green bar printout : set background color for every even row (use script) fill empty space of the last page with blank form (Use option in the table wizard)

Query:
SELECT Customer.CustomerID, Customer.CustomerName, Address.PostalCode & ' ' & Address.AddressLine1 & ', ' & Address.City & ', ' & Address.StateProvince & ', ' & Address.Country as FullAddr, Customer.Channel, Customer.AccountNumber, Customer.CreditCardID, Customer.EmailAddress, Customer.Phone FROM Customer, Address WHERE Customer.AddressID = Address.AddressID Order by Customer.CustomerID

26

FORCS Report Designer Workbook

Date:

2012-05-02

2. Grouped list report (Grouped Table)


Target report: Products grouped by category

Implementation guide :
Configure product information table (Use table wizard) If multiple rows have the same CategoryName field value and SubCategoryName field value, merge them. (use [Grouping] property of the table value) Even though SubCategoryNames value is the same, but if CategoryNames value is different, not merge. (Set SubCategoryNames prior label group field to CategoryName using Prior label property of table value) Set the format of numeric fields to #,### and to right alignment. Query SELECT Category.CategoryName, SubCategory.SubcategoryName, Product.ProductName, Product.Color, Product.Size, Product.StandardCost, Product.ListPrice, Product.Style, Product.Class, Product.Weight FROM Category, SubCategory, Product SubCategory.SubcategoryID = Product.SubcategoryID WHERE Category.CategoryID = SubCategory.CategoryID AND

27

FORCS Report Designer Workbook

Date:

2012-05-02

3. Matrix table report (Crosstab)


Target report: Sales status

Implementation guide:

Set Country, State, City to pivot row, set Year to pivot column, set Order Count, Total Amount to value (Use Crosstab wizard)

Print Sum of pivot rows on the top and Sum of pivot column on the right. (PreviousSum function of the wizard)

Set text alignment of Country and State to Top. Set the format of value and Sum to #,### and to right alignment. Configure pivot title and value title as above example (Use Crosstab wizard)

Query: SELECT Format(OrderHeader.Orderdate, 'yyyy') as YY, Address.Country, Address.StateProvince, Address.City, COUNT(OrderHeader.SalesOrderID) AS OrderCount, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalSales FROM OrderHeader, OrderDetail, Address WHERE OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND OrderHeader.AddressID = Address.AddressID GROUP BY Address.Country, Address.StateProvince, Address.City, Format(OrderHeader.Orderdate, 'yyyy') 28

FORCS Report Designer Workbook

Date:

2012-05-02

4. Master-detail report (Group Above Style) Single Query


Target report: Sales order list by State, City, Product Category

Fixed table component

Table

component

1 Page

2 Page

Implementation guide:
Display year and country from external parameter (Design dataset with year & country parameter). Set group break for State Province, City, Product Category. (Use Insert Band > Upper Group Header Band on the data band. Set the group footer band that is not required to Invisible. Set the format of total and subtotals of groups (use summary label) to $#,### and to right alignment. Use table component and fixed table component (use Insert Connected Table of fixed table) Display current State, City, Category on every page (use Fix Prior Group Header of band) Learn how to create master-detail from one dataset using group header/footer band.

29

FORCS Report Designer Workbook

Date:

5/2/2012

Query:
SELECT Address.StateProvince, Address.City, Category.CategoryName, OrderHeader.SalesOrderID, Format(OrderHeader.OrderDate, 'yyyy-mm-dd') as OrderDate, Product.ProductName, SUM(OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount) as Price, SUM(OrderDetail.OrderQty) as OrderQty, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalAmount FROM OrderHeader, OrderDetail, Address, Product, SubCategory, Category OrderHeader.AddressID = Address.AddressID AND OrderDetail.ProductID = Product.ProductID AND Product.SubCategoryID = SubCategory.SubCategoryID AND SubCategory.CategoryID = Category.CategoryID AND DatePart('yyyy', OrderHeader.Orderdate) = '#OZParam.Year#' AND Address.Country = '#OZParam.Country# group by Address.StateProvince, Address.City, Category.CategoryName, OrderHeader.SalesOrderID, Format(OrderHeader.OrderDate, 'yyyy-mm-dd'), Product.ProductName WHERE OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND

30

FORCS Report Designer Workbook

Date:

2012-05-02

5. Master-detail report (Group Above Style) Multi Query


Target report: Packing list by invoice

Fixed table

component

Table

component

1 Page

2 Page

Set master band key: Invoice No

Implementation guide:
Configure Invoice as master and Packing list as detail with Invoice NO key (use Master band Settings of the detail dataset) Display total by Invoice (use summary label), Set the format of total to $#,### and to right alignment. Display Freight and Total Amount (= Total + Freight) Use table component and fixed table component Learn how to create master-detail between two dataset by setting the master band for the detail band.

31

FORCS Report Designer Workbook

Date:

5/2/2012

Query: SELECT OrderID, OrderDate, RequiredDate, ShippedDate, ShipVia, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry, Trim(ShipRegion& ' ' & ShipCity& ' ' & ShipAddress) AS ShipFullAddr, Freight, O.CustomerID, C.CompanyName, C.ContactName, C.ContactTitle, C.PostalCode, C.Phone, C.Fax, Trim(C.Region & ' ' & C.City & ' ' & C.Address) AS FullAddr, Country, S.CompanyName AS ShipperCompany FROM "Invoice Orders" O, "Invoice Customers" C, "Invoice Shippers" S WHERE O.CustomerID = C.CustomerID AND O.ShipVia= S.ShipperID order by OrderID

SELECT O.OrderID, P.ProductName, OD.UnitPrice, OD.Quantity, OD.Discount, (OD.UnitPrice*OD.Quantity*(1-OD.Discount)/100)*100 AS ExtendedPrice FROM "Invoice Orders" O, "Invoice Order Details" OD, "Invoice Products" P WHERE O.OrderID = OD.OrderID AND OD.ProductID = P.ProductID order by O.OrderID

32

FORCS Report Designer Workbook

Date:

2012-05-02

6. Multi column report


Target report: Mailing label printing Label and

fixed table

Region component

Label printing direction

Implementation guide:
Mailing label with customer address using region Label with Zip code, fixed table with address and name Print mailing label horizontally first, and down to the next line, print horizontally again ( Out Direction property of the region is Horizontal Limited ) Horizontal and vertical spacing between mailing labels (Horizontal Gap and Vertical Gap)

Query: SELECT PostalCode, Address + ' ' + City + ' ' + Country as fullAddress, ContactName FROM "Invoice Customers"

33

FORCS Report Designer Workbook

Date:

5/2/2012

7. Fixed form report using script


Target report: Calendar for any month, any year

Implementation guide:
Define Year and Month as input parameters. Parameters are used for Date functions in the script. (No need for dataset, hence create form parameter with Report Designer) Create 7*6 Table, display date on each cell using script. Create Search toolbar for parameters.

34

FORCS Report Designer Workbook

Date:

5/2/2012

8. Drill-down report
Target report: Sales by country report, drill down from country on the chart or table to country detail

35

FORCS Report Designer Workbook

Date:

5/2/2012

Implementation guide:
Create the chart showing sales by country with chart wizard Chart Type tab : Pie chart X Axis tab: Country Y axis: SUM(TotalSales)

Legend tab: bottom location, symbol width 8 Data Label tab: show tooltip, Data to Show: Item name and Percentage Pie tab: Data label Position: Show With Link Line Write OZ script to link the pie to the detail report (Link to Target report 4. Master-detail report(Group Above Style) Single Query) Create data table for the chart Write OZ script to link the Country cell to the detail report (same link as chart) Set viewer option to show report tree on the viewer. Write Java script for OnStartUp event of ReportTemplate as below: ReportTemplate.SetReportOption("viewer.smartframesize", "true"); ReportTemplate.SetReportOption("viewer.showtree", "true"); Reference the external parameter Year in the query. Query: SELECT Address.Country, SUM(OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount) as UnitPrice, SUM(OrderDetail.OrderQty) as OrderQty, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalSales FROM OrderHeader, OrderDetail, Address OrderHeader.AddressID = Address.AddressID AND DatePart('yyyy', OrderHeader.Orderdate) = '#OZParam.Year# GROUP BY Address.Country WHERE OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND

36

FORCS Report Designer Workbook

Date:

5/2/2012

9. TOC(Table Of Content) link report


Target report: Select TOC item from the Sales Summary page and move to the detailed sales reports

TOC page and detail pages

Click a TOC item and move to the linked page(report)

Implementation guide:
Show report list in the OZ Viewer Tree and move to detailed report by clicking the TOC labels in the TOC page. Set labels TOC Level property. If TOC Level is greater than -1, TOC labels captions are listed in the tree of OZ Viewer when previewing the report. This numeric value means a level in the tree and 0 means the highest level. The root node of the tree is the report template object and shown with its Display Name property. Report consists of the TOC page, 1. Sales Summary page, 2. By Sales Person page, 3. By Country page, 4. By page. Each page is an independent report object so the report includes 5 report object. Create the link from TOC labels to the target page of the report. Create script on each source TOC label implementing link to the target TOC label using SetLinkToc(TocName) function. SetLinkToc function provides navigation through the tree and move to the target in the report. Set the TocName to the target label.

37

FORCS Report Designer Workbook

Date:

5/2/2012

Implementation guide: (Sales Summary)


Horizontal bar chart for Top 10 Sales Persons and Top 10 Customers. Set the maximum row count to 10. Pie chart for Sales by Product Category , data table for the chart, link from Category Name of the table to the 4. By Category of the category (SetLinkToc function) Pie chart for Sales by Country, data table for the chart, link from Country Name of the table to the 3. By Country of the country (SetLinkToc function)

Implementation guide: (2. By Sales Person)


Sales Data table & chart with Grouping by Sales Person Name, create TOC labels for all Sales Person Name (Use Group band, Sort by Sales Person Name) Print 3 Sales Persons in one page and skip to the next page (implement using script on the group footer) 38

FORCS Report Designer Workbook

Date:

5/2/2012

Implementation guide: (3. By Country, 4. By Category)


Sales Data table & chart with Grouping by Country, create TOC labels for all Country Name (Use Group band, Sort by Country Name) Sales Data table & chart with Grouping by Category, create TOC labels for all Category Name (Use Group band, Sort by Category Name) Print one Country or one Category in the one page and skip to the next page (Use Force New Page property of the group footer) Always print data table and chart parallely in the same page in any case. (If the table is long and over one page, the chart is printed in the next page. To avoid this, create 2 regions in the page and create table and chart in each region independently.

39

FORCS Report Designer Workbook Query:

Date:

5/2/2012

SELECT * FROM ( SELECT SalesPerson.SalesPersonName, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalSales FROM OrderDetail, OrderHeader, SalesPerson WHERE OrderHeader.SalesPersonID = SalesPerson.SalesPersonID AND OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND Format(OrderHeader.Orderdate, 'yyyy-mm') = '#OZParam.YearMonth#' GROUP BY SalesPerson.SalesPersonName )T ORDER BY TotalSales desc SELECT * FROM ( SELECT Left(Customer.CustomerName, 20) AS CustomerName, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalSales FROM OrderDetail, OrderHeader, Customer WHERE Customer.CustomerID = OrderHeader.CustomerID AND OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND Format(OrderHeader.Orderdate, 'yyyy-mm') = '#OZParam.YearMonth#' GROUP BY Customer.CustomerName )T ORDER BY TotalSales desc SELECT * FROM ( SELECT Category.CategoryName, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalSales FROM OrderDetail, Product, OrderHeader, SubCategory, Category WHERE OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND OrderDetail.ProductID=Product.ProductID AND Product.SubcategoryID = SubCategory.SubcategoryID AND SubCategory.CategoryID = Category.CategoryID AND Format(OrderHeader.Orderdate, 'yyyy-mm') = '#OZParam.YearMonth#' GROUP BY Category.CategoryName )T ORDER BY TotalSales desc SELECT * FROM ( SELECT Address.Country, SUM((OrderDetail.UnitPrice - OrderDetail.UnitPriceDiscount)*OrderDetail.OrderQty) AS TotalSales FROM OrderDetail, OrderHeader, Address WHERE OrderHeader.AddressID=Address.AddressID AND OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND Format(OrderHeader.Orderdate, 'yyyy-mm') = '#OZParam.YearMonth#' GROUP BY Address.Country )T ORDER BY TotalSales desc

40

FORCS Report Designer Workbook

Date:

5/2/2012

SELECT Format(OrderHeader.Orderdate, 'yyyy-mm') AS OrderDate, OrderHeader.SalesOrderID, SalesPerson.SalesPersonName, Address.Country, Address.StateProvince, Address.City, Category.CategoryName, SubCategory.SubCategoryName, Product.ProductName, Count(OrderHeader.SalesOrderID) AS NOrders, SUM((UnitPrice - UnitPriceDiscount)*OrderQty) AS TotalSales, SUM(OrderQty*Product.StandardCost) AS ProductCost, TotalSales-ProductCost AS NetSales FROM OrderHeader, OrderDetail, Address, Product, SubCategory, Category, Customer, SalesPerson WHERE OrderHeader.SalesOrderID = OrderDetail.SalesOrderID and OrderHeader.AddressID = Address.AddressID and OrderHeader.CustomerID = Customer.CustomerID AND OrderHeader.SalesPersonID = SalesPerson.SalesPersonID AND OrderDetail.ProductID=Product.ProductID and Product.SubCategoryID = SubCategory.SubCategoryID and SubCategory.CategoryID = Category.CategoryID and Format(OrderHeader.Orderdate, 'yyyy-mm') = '#OZParam.YearMonth#' GROUP BY Format(OrderHeader.Orderdate, 'yyyy-mm'), OrderHeader.SalesOrderID, SalesPerson.SalesPersonName, Address.Country, Address.StateProvince, Address.City, Category.CategoryName, SubCategory.SubCategoryName, Product.ProductName

41

FORCS Report Designer Workbook

Date:

5/2/2012

10. Multi language report


Target report: Set the report to support multiple language resource for global business report .

English resource of a report

Korean resource of a report

OZ Report Designer allow to change language and check it out

Implementation guide:
Change the resource of target report 5. Master -detail report to multi language resource. OZ Report Designer allow the user to convert all of general labels to resource labels.

42

FORCS Report Designer Workbook

Date:

5/2/2012

Target report file


Target report
1. List type report (Simple Table)

Description
Table component Auto sizing of a cell Set background color of even rows using script Report header and tail Table component -Grouping -Prior label Display format of numeric label Crosstab component -Pivot row, pivot column, value -PreviousSum function -Title configuration -Fixing header Group header/footer band setup User defined parameter Master bans setup Fixing master Subtotal (aggregation function in script) Region component Various output direction Using Date in script

Report file
CustomerList_1.ozr CustomerList.ozr

2. Grouped list report (Grouped Table)

ProductGroupTable.ozr

3. Matrix report Crosstab)

SalesMatrixTable.ozr

4. Master-detail report (Group Above Style) Single Query 5. Master-detail report (Group Above Style) Multi Query 6. Multi Column report

DetailSales.ozr

Invoice.ozr

MailingLabel.ozr

7. Fixed form report using script 8. Drill down report

Calendar.ozr

Link to the detail report Link from a label of chart or table to the detail report Navigate from the TOC to the detail report Set a report to supports multiple language for global business report

TotalSalesbyCountry.ozr

9. TOC link report

A SalesReport.ozr

10. Multi language report

Invoice_Multi.ozr

43

You might also like