FORCS – Report Designer Workbook Date: 08/14/2022 1 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. OZ product configuration 2. OZ server structure 3. Report design & operating procedure Chapter 2 : OZ Query Designer 4. Database connection 5. OZ data structure 6. Query design Chapter 3 : OZ Report Designer 7. Adding ODI 8. Running & Saving Report 9. Band 10. Label 11. Multiplex 12. User defined parameter 13. Calculated field Chapter 4 : Designing Target Reports 14. List style report (Simple Table) 15. Grouped list report (Grouped Table) 16. Matrix table report (Crosstab) 17. Master-detail report (Group Above Style) – Single Query 18. Master-detail report (Group Above Style) – Multi Query 19. Multi Column report 20. Fixed form report – using script 21. Drill-down report 22. Table Of Content link report 23. Multi language report
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
04/07/2023 FORCS – Report Designer Workbook Date:
1
OZ REPORT Training Workbook
The workbook has been developed for training classes and for self-study. Chapter 1 describes structure of OZ prod-
ucts 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 re-
port, 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 tar-
get reports.
Chapter 1 : Introduction
1. OZ product configuration
2. OZ server structure
3. Report design & operating procedure
Chapter 2 : OZ Query Designer
4. Database connection
5. OZ data structure
6. Query design
Chapter 3 : OZ Report Designer
7. Adding ODI
8. Running & Saving Report
9. Band
10. Label
11. Multiplex
12. User defined parameter
13. Calculated field
Chapter 4 : Designing Target Reports
14. List style report (Simple Table)
15. Grouped list report (Grouped Table)
16. Matrix table report (Crosstab)
17. Master-detail report (Group Above Style) – Single Query
18. Master-detail report (Group Above Style) – Multi Query
19. Multi Column report
20. Fixed form report – using script
21. Drill-down report
22. Table Of Content link report
23. Multi language report
FORCS – Report Designer Workbook Date: 04/07/2023
2
Chapter 1 : Introduction
1. OZ Product configuration
2. OZ server structure
3. Report design & operating procedure
FORCS – Report Designer Workbook Date: 04/07/2023
3
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.
1. OZ Product configuration
FORCS – Report Designer Workbook Date: 04/07/2023
4
2.2. Servlet type server
2.3. .Net type server
2.1. Daemon type server
- 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 server’s own DB Pool.
- 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 server’s own DB Pool or WAS’s DB Pool.
- 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 server’s own DB Pool.
HTML
IIS
OZ Viewer
Web Service
aspx Con-tainer
.NET Framework
OZ Server
DatabaseFirewall
Client
OZ DB Pool HTT
P
FirewallClient
TCP/IP
HTTP
OZ DB Pool
First download
Database
HTML
Web Server
OZ Viewer
OZ Server
Database
HTML
Web Server
OZ Viewer
EJB Beans
JSP Con-tainer
Firewall
Client
OZ DB Pool or WAS DB Pool
HTTP
WAS
OZ Server
2. OZ server structure
FORCS – Report Designer Workbook Date: 04/07/2023
5
① Request report (HTML Tag)
② 1st down-load
of viewer
⑤ Send form file
③ Viewer OCX load
⑨ Bind form and data Show report
⑧ send data
⑥ Ask data
④ Ask form file
Data Source
EJB
XML
(DTD/XSD)
SAP
File Data
RDBMS
Legacy System
Execute report pro-cessing logic
OZ Report Flash/Applet Viewer
⑦ Data pro-
cessing
WebServer
WAS/.NETFramework
OZ EnterpriseServer
(Servlet type)
HTMLs
OZ Viewer
OZ Enterprise Server
(Daemon Type)
OZ EnterpriseServer
(.net type)
① 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.
2.4. OZ Server Operation Flow
FORCS – Report Designer Workbook Date: 04/07/2023
6
3.1 Report design procedure
3.2 Reporting operation 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
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
3. Report design & operating procedure
FORCS – Report Designer Workbook Date: 04/07/2023
7
Chapter 2 : OZ Query Designer
1. OZ data structure
2. Database connection setup
3. Query design
FORCS – Report Designer Workbook Date: 04/07/2023
8
2.4. Hierarchy of Data Store, Dataset and Field
ODI is a file in XML format storing data stores. OZ Report Designer use ODI to map or bind report forms to data.
Type Description
Database Store
A data source interface to JDBC/ODBC/OLEDB RDBMS, Dataset is defined by SQL.
UDS
(User Data Store)
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.
File StoreA data source interface to CSV file or XML file without DTD located on the server (accessed by path)
HTTP StoreA data interface to CSV file or XML file without DTD located on the web (ac-cessed by URL)
XML Store A data source interface to XML file with DTD/XSD
SAP Store A data source interface to result data from SAP R/3 RFC.
CLEAR QUEST Store
A data source interface to result database from IBM Rational Clear Quest pro-gram.
SOAP Store A data source interface to result data from web services.
2.5. Types of Data Store
2.2. Dataset
Data store is a data repository for one of various data sources such as database, file, XML, etc. It is storing data in-formation such as data source connection information, query definition, data source fields information.
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.
2.3. ODI
One ODI file can have multiple data stores and one data store can have multiple datasets.
1.1. Data Store
1. OZ Data Structure
OZ data structure consists of Data Store, Dataset, Dataset Field and they are stored in ODI (OZ Data In-formation) file.
Student should understand concept of data objects, relationship between them, and usage of various data stores.
ODI name
Data storeDataset
Field
OtherNon-database Data store
FORCS – Report Designer Workbook Date: 04/07/2023
9
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. Database connection setup
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.3 Adding Database Store
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 cre-ated above.
Enter dataset name, then the query window appears and you are ready to design query.
2.4 Adding Dataset
Learns setting up database connection, adding database store and dataset.
FORCS – Report Designer Workbook Date: 04/07/2023
10
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.1 Query design in ‘Design View’ mode with Query Wiz-ard
3. Query Design
3.2 Query design in ‘Manual’ mode
Write SQL statement by yourself or copy & paste into the query window.
Learns how to design query in ‘Design View’ mode and ‘Manual’ mode. Student should get used to the query wizard.
FORCS – Report Designer Workbook Date: 04/07/2023
11
3.5 Upload ODI file to server repository
Click Open Repository from right mouse click popup menu on the Repository Server in Reposi-tory window.
Using Server List dialog, Connect to OZ server and upload file to server repository.
3.3 Run query
3.4 Save query as ODI file on local computer
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.
Select File > Save from the menu bar and enter odi file name in the Save As dialog.
FORCS – Report Designer Workbook Date: 04/07/2023
12
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.1 User Defined Parameter
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. 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.
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.
4.3 Referencing parameter in SQL
FORCS – Report Designer Workbook Date: 04/07/2023
13
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
FORCS – Report Designer Workbook Date: 04/07/2023
14
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 re-quire ODI, because ODI provides data information. Student should be able to add ODI and understand it’s major properties.
If select ODI from Data Tree in Data Information window, Property window shows it’s 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.
1.1 Add ODI to report
Select Insert ODI from the right mouse click popup menu on the Data Tree item in the data win-dow and select your ODI file with the Repository File Window.
1.2 ODI Properties
1. Adding ODI
2. Running & Saving Report
2.1 Preview report
Click Preview icon ( ) on the icon bar or select File > Preview from the menu bar. Re-port 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.
FORCS – Report Designer Workbook Date: 04/07/2023
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 Description
Title prints starting content at the start of the report
Page Header appears at the top of every page.
Data Header prints starting content at the start of the associated data band.
Data prints dataset on repeated pages
Group Header prints at the start of a new group
Group Footer prints at the end of a new group
Data Footer prints ending content at the end of the associated data band.
Page Footer appears at the bottom of every page
Summary prints summarized data of the entire report
Dummy prints blank form with no data
Tail prints ending content at the end of the report
FORCS – Report Designer Workbook Date: 04/07/2023
16
Property Description
Master Name Mater band of the current data band
Show Group Link Show arrow link between group labels
ODI Name ODI Name for the data band
Dataset Name Dataset Name for the data band
Fix Master Prints Master band on every page
Fix Title Prints Data Header band on every page
Repeat Number Repeat Data band by ‘Repeat number – record count’
Fix Prior Group Header Prints Prior Group Header on every page
3.2 Major Data Band properties
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.
FORCS – Report Designer Workbook Date: 04/07/2023
17
Label component represents values (text, dataset field value, system date, image, etc.) in various for-mat (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 la-bel type by changing data type and drawing type.
Cate-gory
Label Name
Properties Icon Description
Data type
NormalLabel
- Text value- All bands
Data label- Dataset field value- Data band and Data Expander band
Group La-bel
- Grouped data value- Data band and Data Expander band
Summary Label
- SUM, AVG, MAX, MIN, CNT of a field - All bands
Expression Label
- Result of the expression- All bands
System la-bel
- System date of user PC & page numbering - All bands
Parameter Label
- User Defined Parameter (QD) & Form Parameter (RD)- All bands
Draw-ing Type
Image La-bel
- Image - All bands
Barcode Label
- Barcode- All bands
HTML Label- HTML Text- All bands
User Com-ponent
- Custom component- All bands
Note Label- Very Large Text- All bands except Tail & Page Footer
5.2 Label Types
Data Type NormalText Customer List
Data Type DataODI Name StockList
Dataset StockList
Field Name ProductName
NullType Blank
Data Type GroupODI Name StockList
Dataset StockList
Field Name CategoryName
Grouping Rule Merge
Data Type SummaryODI Name StockList
Dataset StockList
Field Name UnitsInStock
Summary Type Sum
Data Type Expression
ExpressionCar.Amount.-sum/1000
Expression ODI Name
Carsales
Data Type SystemSystem Field Name
Page_Of_Total
Delimiter /Data Type ParameterParameter Set Name
Carsales
Parameter Name
FromDate
Data Type ImageImage Style Tile
Data Type BarcodeBarcode CODE 39
Data Type HTML
Data TypeUser Compo-nent
User Class tagfree
Data Type Note
5. Label component
FORCS – Report Designer Workbook Date: 04/07/2023
18
Type Description
TablePrints 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.
Fixed Table
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.
CrosstabUseful for data analysis & statistics report.Analyze the relationship between categorical variables and calculate summary such as Sum, Avg etc.
ChartVisualizes tabular data on the report page in various formats including bar, line, pie.
Gantt Chart Illustrates a project schedule with bar type graph.
RegionUse 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.
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.
6. Multiplex component
FORCS – Report Designer Workbook Date: 04/07/2023
19
6.2 Table Wizard and Options
Set table data configuration and display style with Table Wizard.
Option Description
Set Row Count The maximum number of rows to print
Outline FixingIf the row count above is larger than the one of actual result dataset, the remaining number of rows are printed as empty row.
Empty Label To Page End
When the last page have empty space, fill the page with empty labels.
Display Row No Create a serial number column at the first column.
Display Title Prints table header
Fix Title Prints table header on every page.
FORCS – Report Designer Workbook Date: 04/07/2023
20
6.3 CrossTab Wizard and Options
Set crosstab data configuration and display style with CrossTab Wizard.
Option Description
Title of row or column
MergedMain title (the view selector on the top left) is independent from row title and column title. User can modify it.
By row pivot Main title follows row title
By column pivot Main title follows column title
Title of fieldShow field’s ti-tle
Using row title Show value titles at below the column title
Using column title Show value titles at the right of row title
Cell merge Merge cells on same data Merge column cells with the same value.
FORCS – Report Designer Workbook Date: 04/07/2023
21
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 Description
Available Data Sets Select the dataset for the chart.
Available Fields Select fields for the chart.
X-AxisFields to be used as x-axis label. Select data type of the label from one of Item, Number, Date.
Y-Axis LeftFields to be used as y-axis left label. Aggregation function (sum, avg, max, min) is allowed for the fields.
Y-Axis RightFields to be used as y-axis right label. Aggregation function (sum, avg, max, min) is allowed for the fields.
Series Fields to be used as series.
LabelFields to be used as data labels of the chart. The number of la-bels must be the same as one of y-axis fields. If not set, y-axis field data will be shown as data label.
FORCS – Report Designer Workbook Date: 04/07/2023
22
Property Description
OZ script (Link) Executed when clicking chart elements (bar, Line, Point, pie, etc.)
OZ script (Range Link)
Executed when selecting an area of the chart by dragging
OZ script (Label Link)
Executed when clicking X axis label or legend label
Chart Out Direction Printing direction of multiple charts
Max Series NumberMaximum series count. If actual series count exceeds Max Series Number, the number of charts would be increased.
Max X Axis Tick Number
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 ODI name of the dataset for the chart
Data Set NameDataset 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 Background color of the chart
Transparent Transparency of the chart background
Y Axis Grid Line Color
Grid row background colors
Gradient Gradient options for chart background
MovableEnable chart moving and resizing at the runtime(on the preview window)
Editable Enable chart editing at the runtime (on the preview window)
ChangeableEnable chart printing and property changing at the runtime (on the preview window)
6.4.2 Major Chart Proper-ties
FORCS – Report Designer Workbook Date: 04/07/2023
23
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
8. Calculated field
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.
04/07/2023 FORCS – Report Designer Workbook Date:
24
Chapter 4 : Designing Target Reports
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
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.
04/07/2023 FORCS – Report Designer Workbook Date:
25
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.
①
②
③
④ ⑤
04/07/2023 FORCS – Report Designer Workbook Date:
26
▶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)
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')
①
③
②④
⑤ ②
04/07/2023 FORCS – Report Designer Workbook Date:
29
4. Master-detail report (Group Above Style) – Single Query
▶Target report: Sales order list by State, City, Product Category
▶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 align-
ment.
④ 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.
①
②
③
④ Table component
④ Fixed table compo-nent
1 Page2 Page
⑤
FORCS – Report Designer Workbook Date: 04/07/2023
30
▶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
WHERE OrderHeader.SalesOrderID = OrderDetail.SalesOrderID AND
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
04/07/2023 FORCS – Report Designer Workbook Date:
31
5. Master-detail report (Group Above Style) – Multi Query
▶Target report: Packing list by invoice
▶Implementation guide: ① Configure Invoice as master and Packing list as detail with Invoice NO key (use Master band Settings of the de-
tail 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.
① Set master band key: Invoice No
②
③
④ Table component
④ Fixed table compo-nent
1 Page 2 Page
FORCS – Report Designer Workbook Date: 04/07/2023
32
▶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" SWHERE O.CustomerID = C.CustomerID AND O.ShipVia= S.ShipperIDorder 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" PWHERE O.OrderID = OD.OrderID AND OD.ProductID = P.ProductIDorder by O.OrderID
04/07/2023 FORCS – Report Designer Workbook Date:
33
6. Multi column report
▶Target report: Mailing label printing
▶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 Di-rection 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"
③ Label printing direction
② Label and fixed table
① Region component
④
FORCS – Report Designer Workbook Date: 04/07/2023
34
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.
②
③
FORCS – Report Designer Workbook Date: 04/07/2023
35
8. Drill-down report
▶Target report: Sales by country report, drill down from country on the chart or table to country detail
①
②
③
FORCS – Report Designer Workbook Date: 04/07/2023
36
▶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: