UbiDesigner User Guide
UbiReport v2.0
ICM Co., Ltd.
UbiReport v2.0 2
UbiReport v2.0 3
Contents
UBIREPORT INTRODUCTIONUBIREPORT INTRODUCTION ........................................................................................................................................................................................................ 88
1. UbiReport Features........................................................................................................................9
2. UbiReport User Guide .................................................................................................................11
3. UbiReport Support.......................................................................................................................12
CHAPTER 1 INSTALLATIONCHAPTER 1 INSTALLATION.......................................................................................................................................................................................................... 1133
CHAPTER 2 UBIREPORT STARTCHAPTER 2 UBIREPORT START.......................................................................................................................................................................................... 1188
1. Window .........................................................................................................................................19
1.1 SQL Editor ...........................................................................................................................19
1.2 Design Editor .......................................................................................................................20
1.3 Preview.................................................................................................................................21
2. Menu..............................................................................................................................................22
2.1 File .......................................................................................................................................22
2.2 Database ...............................................................................................................................23
2.3 Edit .......................................................................................................................................24
2.4 Design Option ......................................................................................................................24
2.5 Setup.....................................................................................................................................25
2.6 Tool ....................................................................................................................................25
2.7 Help......................................................................................................................................25
3. Tool Bar.........................................................................................................................................26
3.1 Main Tool Bar ......................................................................................................................26
3.2 Design Tool Bar ...................................................................................................................27
3.3 SQL Tool Bar .......................................................................................................................29
CHAPTER 3 CONNECTING WITH YOUR DATABASECHAPTER 3 CONNECTING WITH YOUR DATABASE ........................................................................................................................ 3300
1. Database Setup .............................................................................................................................31
1.1 Connection ...........................................................................................................................31
UbiReport v2.0 4
1.2 Database...............................................................................................................................31
1.3 Data Source Information......................................................................................................32
2. Connecting to Your Database......................................................................................................32
CHAPTER 4 HOW TO USE DATA VIEWERCHAPTER 4 HOW TO USE DATA VIEWER ............................................................................................................................................................3344
1. Generating SQL Statements........................................................................................................36
2. SQL Query....................................................................................................................................37
3. Saving SQL...................................................................................................................................38
4. Save Data as Files.........................................................................................................................39
CHAPTER 5 SQL EDITORCHAPTER 5 SQL EDITOR ..................................................................................................................................................................................................................4400
1. Managing SQL Information........................................................................................................41
1.1 Adding SQL Information .....................................................................................................41
1.2 Editing SQL Information .....................................................................................................42
1.3 Argument Setup ...................................................................................................................43
1.4 Managing Database Information..........................................................................................45
2. Using the Graphical Mode ..........................................................................................................46
2.1 Selecting Tables and Columns .............................................................................................47
2.2 Making Composite Columns ...............................................................................................48
2.3 Making Where, Sort, Group, and Having Clauses ...............................................................50
2.4 Comments ............................................................................................................................54
3. Using the Text Mode ....................................................................................................................56
3.1 Writing and Confirming SQL Statements ............................................................................56
3.2 Adding Comments ...............................................................................................................57
CHAPTER 6 DESIGN EDITORCHAPTER 6 DESIGN EDITOR......................................................................................................................................................................................................5588
1. Choosing a Report Form.............................................................................................................59
1.1 Page Formatting...................................................................................................................62
2. Items..............................................................................................................................................64
UbiReport v2.0 5
2.1 Basic Properties....................................................................................................................64
2.2 Text.......................................................................................................................................66
2.3 Line ......................................................................................................................................68
2.4 Circle....................................................................................................................................69
2.5 Rectangle..............................................................................................................................71
2.6 Image....................................................................................................................................73
2.7 Column.................................................................................................................................76
2.8 User-defined Column ...........................................................................................................80
2.9 Image Column......................................................................................................................85
2.10 Argument............................................................................................................................88
3. Common Items .............................................................................................................................91
3.1 Common Text .......................................................................................................................91
3.2 Common Image ....................................................................................................................94
4. Components ..................................................................................................................................97
4.1 Data Component...................................................................................................................97
4.2 Cross-tab Component.........................................................................................................103
4.3 Chart Component ...............................................................................................................111
4.4 Table Component ...............................................................................................................113
5. Sorting, Grouping, Suppressing................................................................................................127
5.1 Sorting................................................................................................................................127
5.2 Grouping ............................................................................................................................128
5.3 Suppressing ........................................................................................................................131
6. Expression...................................................................................................................................133
6.1 Functions ............................................................................................................................133
7. Formatting ..................................................................................................................................138
7.1 Format Setting....................................................................................................................138
UbiReport v2.0 6
8. Page Link....................................................................................................................................140
9. Master Page Editing ..................................................................................................................142
10. Vertical Text..............................................................................................................................143
CHAPTER 7 PREVIEWCHAPTER 7 PREVIEW ........................................................................................................................................................................................................................114477
1. Argument Value Setting.............................................................................................................148
2. Functional Descriptions.............................................................................................................149
CHAPTER 8 FILE MANAGEMENTCHAPTER 8 FILE MANAGEMENT....................................................................................................................................................................................115522
1. Open............................................................................................................................................153
1.1 Opening Files from a Local PC..........................................................................................153
2. Saving..........................................................................................................................................154
3. Using Templates .........................................................................................................................155
3.1 Making a Template.............................................................................................................155
3.2 Making Reports by Using Templates .................................................................................156
4. Remote File Management..........................................................................................................157
4.1 Open File from Remote Server ..........................................................................................157
4.2 Saving on a Remote Server................................................................................................159
5. Editing File Source.....................................................................................................................161
CHAPTER 9 USING UBIREPORT ON THE WEBCHAPTER 9 USING UBIREPORT ON THE WEB ......................................................................................................................................116633
1. Setting up HTML/Batch Generator .........................................................................................164
2. HTML Generator.......................................................................................................................166
2.1 Including Common Items ..................................................................................................167
2.2 Including Images : Automatic Saving through FTP...........................................................167
CHAPTER 10 USING UBIREPORT ON APPLICATIONSCHAPTER 10 USING UBIREPORT ON APPLICATIONS ..............................................................................................................116699
1. Batch Generator.........................................................................................................................171
CHAPTER 11 EXERCISINGCHAPTER 11 EXERCISING ..........................................................................................................................................................................................................117744
1. Overview.....................................................................................................................................175
UbiReport v2.0 7
2. Before We Start...........................................................................................................................177
3. Making a New Report................................................................................................................178
4. Connecting to database..............................................................................................................180
5. Selecting Tables from Database.................................................................................................181
6. Generating SQL Statements ......................................................................................................183
6.1 Using SQL editor in Graphical and Text modes.................................................................184
6.2 Designing using the Design Editor.....................................................................................185
7. Formatting ..................................................................................................................................190
8. Group, Sort, Suppressing ..........................................................................................................191
9. Editing the Master Page ............................................................................................................194
10. Saving Your Report File...........................................................................................................195
11. Preview / Print ..........................................................................................................................196
UbiReport v2.0 8
UUbbiiRReeppoorrtt IInnttrroodduuccttiioonn
UbiReport v2.0 9
1. UbiReport Features
XXMMLL--bbaasseedd RReeppoossiittoorryy
Data used in files or in UbiReport is managed by XML. Thus, it is easy to utilize
different types of data.
MMuullttiippllee FFiillee MMaannaaggeemmeenntt
You can edit multiple files at the same time.
DDaattaabbaassee
You can work with many different type of database and with many different SQL
statements at the same time.
GGeenneerraattiinngg SSQQLL
The graphical editor enables the user to generate SQL statements simply by
dragging items onto a report and clicking on appropriate columns. For more
complex statements, the user can switch to the text mode and write the SQL
statements directly.
DDeessiiggnn FFoorrmm SSeettuupp
You can choose from various forms according to the characteristics of your report.
IItteemmss
General items that the user can define properties of such as text, lines, images, and
user’s options are provided. For a watermark, the user can control the level of
transparency.
UbiReport v2.0 10
CCoommppoonneennttss
To make managing data easier, various items needed for a report such as charts and
tables are provided as components.
EEmmbbeeddddeedd FFuunnccttiioonnss
Various embedded functions are provided to help generate SQL statements more
easily and more effectively.
FFiillee MMaannaaggeemmeenntt
To manage file conveniently, user can use ‘FTP save’, ‘Open’ menu to save file at
local or server.
PPrreevviieeww // PPrriinntt
By using Preview function, user can check data and shape of the form during
process.
UbiReport v2.0 11
2. UbiReport User Guide
Chapter 1 explains how to install UbiReport step by step.
Chapter 2 explains the screen of each menu and tool bar.
Chapter 3 describes how to connect to your database in detail.
Chapters 4 through 10 explain in detail about the menu, the tool bar, the preview
function, file management, and the editor. Further explanation of hidden functions
is provided for advanced users.
Chapter 11 reviews what you have learned from previous chapters through an
example.
The index at the end of the manual will help you look up.
Any part of UbiReport that is not explained in this manual will be available on the
UbiReport homepage ( www.ubireport.com ). To use this information, you have to
register online after purchasing the product.
UbiReport v2.0 12
3. UbiReport Support
· UbiReport Homepage : www.ubireport.com
· Email : [email protected]
· Fax : 02-538-2701
· Tel : 02-538-0600
UbiReport v2.0 13
CChhaapptteerr 11 IInnssttaallllaattiioonn
UbiReport v2.0 14
First, make sure that you have the product key handy from the UbiReport program
CD.
1. Insert the program CD.
2. Click on ‘Next’ to proceed in the UbiDesigner InstallShield Wizard screen.
3. Click on ‘Yes’ in the agreement screen and then click on ‘Next’ to go on.
UbiReport v2.0 15
4. First, select the folder where the program is going to be saved and click on
‘Next’ to continue.
5. Select which components of the program you wish to install.
UbiDesigner is the package for the developer to use to develop desired reports
and UbiViewer is the package for the user to use to view the finished reports.
UbiReport v2.0 16
6. Click on ‘Next’ to go on in the setup screen before copying files.
7. After finishing installation, click on ‘Finish’ at the last screen of Install Shield
Wizard.
UbiReport v2.0 17
8. After installing UbiDesigner, you will see an icon for UbiDesigner on your
computer background. If you want to run the program, double-click on this
icon.
UbiReport v2.0 18
CChhaapptteerr 22 UUbbiiRReeppoorrtt SSttaarrtt
UbiReport v2.0 19
1. Window
1.1 SQL Editor
①②
④③
⑤ ⑭
⑪
⑥
⑦
⑧ ⑩
⑨ ⑫
⑬
① Minimize/maximize and close buttons for the main window
② Main tool bar
③ Report name
④ Report file table status bar – Edit and save multiple reports at the same time.
⑤ SQL Name – You can have many SQL statements at the same time.
⑥ Connection name
⑦ Table list – If you click on a table from the table list, the column names and
types are displayed.
⑧ Column name / type list
⑨ Text mode / graphical mode toggle icon – Clicking on this will switch the SQL
editor back and forth between the text mode and the graphical mode.
UbiReport v2.0 20
⑩ Edit window
⑪ SQL condition edit window – Define the conditions of SQL statements easily.
⑫ Editor status bar
⑬ Status bar
⑭ SQL tool bar
1.2 Design Editor
①②
④
③
① Design tool bar
② Component, band, item tab status bar
③ Properties – You can easily change properties of components, ban
④ Edit window (form design area)
ds, and items.
UbiReport v2.0 21
1.3 Preview
①②
③
① Print / print after printer setup / flipping throu
② Preview window
③ Scale control window
gh pages
UbiReport v2.0 22
2. Menu
2.1 File
Edit reports by opening report files with the jrf extension.
Save your current work in a report
file.
Save all report files currently open.
Use the built-in FTP to open files
saved on the server.
Save your work directly on the server
through FTP.
Open a template and make a new
report.
Save your report as a template that
you can use again later.
UbiReport v2.0 23
2.2 Database Register data from the database with
an SQL name.
Edit, delete, and save the registered
SQL name.
Make comments about your SQL
information.
Query your database by argument to
print your report.
Make new columns by combining several
table columns.
Show database table information
including owner information, table
comments, and column comments.
UbiReport v2.0 24
2.3 Edit
You can group your data from this
menu.
You can easily add SQL, chart, or
table components on to your report.
You can use many different kinds of
items such as text, diagram, image,
user column, common text, and common
image.
Locate items easily in the design
editor.
Align items easily in the design
editor.
You can do “Undo” and “Redo” many
times.
2.4 Design Option
Show or hide the band title to.
Edit parts of your report that you use
in many places such as the
background.
UbiReport v2.0 25
2.5 Setup
You can add, delete, or edit text
used commonly in the design editor.
Select among the available languages
such as English, Korean, and
Japanese.
Select the system language.
You can add, delete, or edit images
commonly used in the design editor.
2.6 Tool
Set up your generators here.
You can look up or edit various kinds
of files including jrf, xml, bat, and
html files.
Generate batch files that can run
your reports independently.
Generate HTML to display your report
on the web.
2.7 Help
Display the content of help.
UbiReport v2.0 26
3. Tool Bar
3.1 Main Tool Bar
The main tool bar of UbiReport is as follows. It is always located below the
menu bar and has menu items to manage reports files or your database.
- Create a new file
- Open a file
- Save a file
- Save all files
- Open a remote file
- Save a remote file
- Connect
- Data Viewer
- Close (Close UbiReport)
UbiReport v2.0 27
3.2 Design Tool Bar
The following design tool bar items help you manage items and components and
are used in the design editor.
- Back
- Redo
- Copy
- Cut
- Paste
- Left aligned
- Right aligned
- Top aligned
- Bottom aligned
- Width alignment
- Height alignment
- Same interval
UbiReport v2.0 28
- Same height
- Page left aligned
- Page centered
- Page right aligned
- Text
- Line
- Circle
- Square
- Image
- Column
- User column
- Image column
- Common text
- Common image
- Argument
UbiReport v2.0 29
- Data component
- Cross-tab component
- Chart component
- Table component
- Display band name
- Edit master
3.3 SQL Tool Bar
The following items are used in the SQL editor and used for adding, deleting items,
etc.
- Add SQL information
- Edit SQL information
- Update DB information
- Composite column
- Argument
- Comments
UbiReport v2.0 30
CChhaapptteerr 33 CCoonnnneeccttiinngg wwiitthh YYoouurr DDaattaabbaassee
UbiReport v2.0 31
1. Database Setup
1.1 Connection
Name: Give a name for the database information you define.
1.2 Database
Vendor: Type in the name of your database vendor.
Driver: The default is the name of the driver supplied originally by your vendor. If
you are using a different driver, type in its name here.
The following are the basic drivers that major vendors supply.
- Oracle: oracle.jdbc.driver.OracleDriver
- Sybase: com.sybase.jdbc2.jdbc.SybDriver
- SQL Server: com.microsoft.jdbc.sqlserver.SQLServerDriver
UbiReport v2.0 32
Database URL : Type in the URL of your database.
Follow these examples.
- Oracle: jdbc:oracle:thin:@IP_address:1521:SID
- Sybase: jdbc:sybase:Tds: IP_address:Port
- SQL Server: jdbc:microsoft:sqlserver:// IP_address: Port
User: Type in the name of the database user.
Password: Type in the password of the database user.
Character Set: Select the language you want to use.
KSC5601(Korean), US7ASCII(English), SHIFT-JIS(Japanese)
Basic Schema (Owner): It there is no table schema (owner) in an SQL statement,
the basic schema is recognized.
Comment Support: This is an option for Oracles users only and is for recognizing table
and column names as comments. If you select ‘Y’, it may slow down your query for
tables and columns.
※ How to connect to ODBC
Driver: sun.jdbc.odbc.JdbcOdbcDriver
Database url: jdbc:odbc:odbc_name
1.3 Data Source Information
Servelet Engine Name: Type in the name of the servelet engine name you are using
now or you will use in the future.
Data Source Name : Type in the data source name defined in each servelet engine.
※ For further details, consult your UbiGateway installation manual.
2. Connecting to Your Database
Click on the database name and then click on the connect button to connect to the
UbiReport v2.0 33
appropriate database.
UbiReport v2.0 34
CChhaapptteerr 44 HHooww ttoo UUssee DDaattaa VViieewweerr
UbiReport v2.0 35
If you have followed instructions in the previous chapter and have connected to
your database properly, we’ll now try to query data from your database and check
your SQL statements.
Data Viewer consists of three part as shown above. The left window shows the
table list and column information about the selected table. The upper window is
for your SQL statements and the lower window is for data inquiry.
UbiReport v2.0 36
1. Generating SQL Statements
To make a simple SQL statement, you have to type in all the columns of the
selected table. But, in Data Viewer, all you have to do is select your table from the
table list and drag it to the SQL window get the appropriate ‘select’ statements.
Each additional drag will create the appropriate statement in order.
UbiReport v2.0 37
2. SQL Query
If there is one SQL statement in the SQL window, click on the query button to see
the data of the selected statement.
If there are several SQL statements in the SQL window, first select the SQL
statement as shown in the picture below and then click on the query button.
UbiReport v2.0 38
3. Saving SQL
You can save SQL in .sql files in Data Viewer. If you click on the SQL save
button after generating SQL statements correctly, you’ll get the following
window. Select the location for your file and your file type, type in the file name,
and click on the save button.
UbiReport v2.0 39
4. Save Data as Files
In Data Viewer, you can save data in either the Excel or text format.
You can save SQL in .sql files in Data Viewer. If you click on the data save
button after generating SQL statements correctly, you’ll get the following
window. Select the location for your file and your file type, type in the file name,
and click on the save button.
UbiReport v2.0 40
CChhaapptteerr 55 SSQQLL EEddiittoorr
UbiReport v2.0 41
1. Managing SQL Information
1.1 Adding SQL Information
Using UbiReport, you can connect to more than one set of database at the same
time and you can have multiple SQL statements in one report. Therefore, you have
to give each SQL statement a unique name, and in the following chapter regarding
SQL binding, you get to use this name.
If you click on ‘Add SQL Information’ in either the tool bar or from the menu in
the SQL editor, you’ll get the following window.
Clicking on OK after typing in the SQL name will generate the information about
the SQL statement and the SQL statement will be added to the SQL list as shown
below.
UbiReport v2.0 42
1.2 Editing SQL Information
You can delete SQL information you’ve add when adding SQL. Clicking on
[Database]→[Edit SQL Information] in the SQL editor or the tool bar will bring up
the following window. Select the one you want to delete, click on delete, and click
on OK.
UbiReport v2.0 43
1.3 Argument Setup
If you need to use an outside argument or use a constant while writing an SQL
statement, set up the argument as shown below.
UbiReport v2.0 44
In the above window, click on the ‘Add’ button to set an argument variable, set
the name and the data type, and click on the ‘OK’ button.
How to use an argument will be covered in detail later.
UbiReport v2.0 45
1.4 Managing Database Information
Depending on the user, the database information may be different. In order to
use report files that contain the same table from different sets of database, you can
update the database information here.
DB information to change
Information of DB in use
Select the item you want to update from the database information list and click on
‘Update’ to update the change. If you want to check the updated information, click
on ‘OK’ to see the change in the report file.
UbiReport v2.0 46
2. Using the Graphical Mode
The graphical SQL editor lets you create SQL statements by just dragging and
clicking. Thus, even users who are not familiar with SQL can generate reports
easily.
The following example uses Scott/tiger of Oracle.
“For each department where an employee, who makes more than the input
amount, belongs, I wish to get the salary sum. But, I want to exclude departments
whose salary sum is below $2,000”
The following is the complete SQL statement.
SELECT B.DEPTNO, B.DNAME, SUM(A.SAL)
FROM EMP A, DEPT B
WHERE A.SAL >= ? (input amount)
AND A.DEPTNO = B.DEPTNO
GROUP BY A.DEPTNO
HAVING SUM(A.SAL) > 2000
UbiReport v2.0 47
2.1 Selecting Tables and Columns
SSeelleeccttiinngg TTaabblleess
You have to select the tables first in order to generate SQL statements.
If you have followed the instructions in the previous chapter and have connected
to your database correctly, you’ll get the above table list from your database.
Select the table from which you want to generate SQL statements and drag it to the
space in the middle. (This white space is going to be called ‘SQL Canvas’ from
here on.)
Following the above instruction, drag all the tables you need on to SQL Canvas.
If you wish to delete a certain table, use the right button to click on the table and
do ‘Deselect Table’.
UbiReport v2.0 48
SSeelleeccttiinngg CCoolluummnnss
Click on the columns you want from the tables you have selected. Clicking on
columns that are not selected will select those columns and similarly, clicking on
selected columns will deselect those columns. If you wish to select all the columns,
use the right mouse button and do ‘Select All’.
2.2 Making Composite Columns
Certain SQL statements may not be completed with just the columns from tables.
In some cases, you will need to use functions provided by your database.
For these cases, UbiReport lets you make composite columns.
Click on the composite column menu from the SQL tool bar or from the menu, go
to [Database]→[Composite Column]. You will get the following window.
UbiReport v2.0 49
First, select the functions you want from the function list and then select the
columns you want to use in those functions.
For detailed information on specific functions, please consult the appropriate
manuals provided with your database.
If you have created composite columns that you need, then click on ‘OK’. The
composite column will be created in SQL Canvas as in the picture below.
UbiReport v2.0 50
The name of the table is indicated as *COMPOSITE. This is a virtual table created
by UbiReport to show the newly created composite column.
2.3 Making Where, Sort, Group, and Having Clauses
WWhheerree CCllaauussee
The ‘Where’ tab consists of four parts - Column, Operator, Value, and Logical.
UbiReport v2.0 51
‘Column’ is the left side of the expression and ‘Value’ is the right side of the
expression. For these, you can put use columns, numbers, or arguments.
‘Operator’ shows the relationship between the left side and the right side of the
expression.
‘Logical’ shows the correlation between two expressions. If you give a value for
‘Logical’, then an expression is added automatically. You will then continue to
build condition clauses.
UbiReport v2.0 52
IInncclluuddiinngg AArrgguummeennttss
You have learned how to set up arguments in 1.3 of this chapter. Set your
argument to Amt(Number) and use the right mouse button to click on the part where
you want to use your argument. You will see the above screen. Click on
‘Argument’ and you will see an argument list like the screen below. Click on the
argument you want to use from the list.
When you finish your ‘Where’ clause, you’ll get the following screen.
UbiReport v2.0 53
GGrroouupp
The ‘Group’ tab consists of ‘Column List’ on the left and ‘Group Column List’ on
the right. ‘Column List’ displays all the columns of selected tables. Drag the
columns you want to group to ‘Group Column List’.
HHaavviinngg
The ‘Having’ tab has the same structure as the ‘Where’ tab and you can make
your ‘Having’ clauses the same way as ‘Where’ clauses.
UbiReport v2.0 54
Any composite columns you have made will also appear on the column list, so
you can make ‘Having’ clauses the same way.
SSoorrtt
The ‘Sort’ tab consists of ‘Column’ and ‘Direction’. Select the columns you want
to sort from ‘Column’ and choose the type (either ASC(Ascending) or
DESC(Descending)) of sorting you want from ‘Direction’.
2.4 Comments
Descriptive comments about your reports, SQL statements, and certain columns
will make your reports more understandable to other people. This can be helpful
for maintenance purposes or when you have to give report files to someone else to
manage.
For this purpose, “Comment Input Area” is provided.
Click on ‘Comment’ from the tool bar in the SQL editor or go to [Database]→
[Comment] from the menu to get the following “Comments Input Area” window.
UbiReport v2.0 55
After finishing typing in your comments, click on the save icon in the upper
corner to save your comments and click on the close icon to close.
UbiReport v2.0 56
3. Using the Text Mode
If you are experienced in SQL, then it may be more convenient for you to write
out SQL statements yourself. In the lower left corner, you will find the ‘Text
Mode’ button. Clicking on this will switch the editor to the text mode.
3.1 Writing and Confirming SQL Statements
For any work you have done in the graphical mode, its SQL statements will be
generated automatically when you switch to the text mode.
As explained before, you can select tables from the table list and move them to
the text area on the right side. Doing this will generate the appropriate ‘Select’
statements about the selected tables automatically.
UbiReport v2.0 57
When you have finished writing your SQL statements, click on the ‘Confirm’
button to see your statements are correct. Only after you have confirmed your
statements as being correct you can save them. If you do not want to go through
this process, then check ‘Check Syntax’. If you have this item checked, then the
program will check the syntax of your statements before you proceed to anything
else.
3.2 Adding Comments
Adding comments in the text mode is the same as in the graphical mode. If there
are any comments you have made in the graphical mode, they will be carried over to
the text mode.
UbiReport v2.0 58
CChhaapptteerr 66 DDeessiiggnn EEddiittoorr
UbiReport v2.0 59
1. Choosing a Report Form
A typical user designs many different types of reports. UbiReport offers 4
predefined page formats, Tabular, Free Form, Black Form, and Template, to help
you design your reports more easily and efficiently.
And, you can use different units of measurements for page margins and other
things including mm, inch, and pixel.
When you click on the design editor tab after finishing editing SQL, you will see
the above window where you can choose your report form.
There are 4 predefined sizes, A4, A5, B4, and B5, but using Free Size you can
choose a report of any size you desire.
One thing you should notice here is that even if you choose one of the four
predefined sizes, you can still type in different sizes in the User Define section.
In UbiReport, you can design reports that contain more data than what shows on
the screen when you are previewing them. When you use this feature, what you
see on the screen for preview is different from what you would get on paper when
you print your report and the sizes may be different as well.
UbiReport v2.0 60
The size you define applies to the report design mode, so you can design any
report of a desired size. And, when you print, UbiReport will adjust your report
accordingly to fit the selected page size to include all the data and print properly.
However, it is recommended that you not change the size from the User define
section unless it is specifically needed.
In UbiReport, you can type in text vertically.
If you choose the text orientation to be vertical, then you can design vertical
reports.
Detailed instructions on designing vertical reports can be found in the vertical text
section.
The above design does not use a print header or a print footer.
If you drag down the yellow rectangle as shown in the above picture, you will get
a print header.
In this section, you can design data that will show when you print your report.
When you preview reports designed this way, you would only see data in the
UbiReport v2.0 61
master page, but when you print, you will all the data including data in the print
header section.
You can design print footers the same way as print headers.
UbiReport v2.0 62
1.1 Page Formatting
The following are the four different formats.
TTaabbuullaarr
The tabular format basically consists of a data header (top) and a data area
(bottom) as shown in the figure above.
For example, we can apply this form to a report that has one title (data header)
with multiple or iterative data (data area) below.
FFrreeee FFoorrmm
Generally, ‘Free Form’ is useful for reports that have one row or data per page and
is often used when a specific form is defined in the page layout.
The following sample is a nice example of this format.
UbiReport v2.0 63
CCrroossss--ttaabb
The ‘Cross-tab’ format is useful when you design matrix-structured reports.
BBllaannkk FFoorrmm
When there is no set format you want to use and you want build a report from
scratch yourself, then this is the form to use. This form can be useful for reports
that consist of many charts.
TTeemmppllaattee
You can use this form if you want to use a template that has been made and saved
already. If you want to make many different reports of the same format, this is the
form to use.
UbiReport v2.0 64
2. Items
UbiReport provides the following various items to help you generate reports more
easily.
2.1 Basic Properties
IIDD
There is a unique ID for every item type. IDs are generated and give internally
and you may not change them.
TToopp--LLeefftt CCoooorrddiinnaatteess
Top left coordinates of an item in the page layout.
BBoottttoomm--RRiigghhtt CCoooorrddiinnaatteess
Bottom right coordinates of an item in the page layout.
WWiiddtthh
The width of an item.
HHeeiigghhtt
The height of an item.
FFoorreeggrroouunndd CCoolloorr
The color of an item.
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from. You can also define a color by setting HSB and RGB values
as shown in the picture below.
UbiReport v2.0 65
UbiReport v2.0 66
VViissiibbllee
You can choose an item to be visible or invisible.
2.2 Text
This applies to all types of text used in reports.
Click on the text icon from the design tool bar and create a text box in your report
by dragging a rectangle in which your text will go. Double –clicking on this text
box will let you type in your text.
PPrrooppeerrttiieess
Besides basic properties, there are other unique properties pertaining to a text item.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to
false, then your background color will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show your border by setting this value to true or falst
respectively.
LLiinnee TTyyppee
UbiReport v2.0 67
You can choose which type of line you want to use. The following is the list of
available lines.
TThhiicckknneessss
You can select the thickness of your line from the list.
FFoonntt
You can select your desired font from the list.
FFoonntt SSttyyllee
You can select your desired font style (plain, italic, bold, italic & bold).
FFoonntt SSiizzee
You can select your desired font size.
HHoorriizzoonnttaall AAlliiggnnmmeenntt
You can choose your desired horizontal alignment from the list.
VVeerrttiiccaall AAlliiggnnmmeenntt
You can choose your desired vertical alignment from the list.
TTeexxtt
You can type in text that you wish to show in the selected cell of a table.
UbiReport v2.0 68
2.3 Line
If you draw a line by dragging your mouse, you can draw either a horizontal line
or a vertical line. The width or the height of your line in this case is 0. If you
drag the middle red dot, your line will tilt. Now, you can use this line in any way
and in any direction you wish.
WWiiddtthh
You can set the width of your line by entering its directly here.
HHeeiigghhtt
You can set the height of your line by entering its value directly here. If a non-
zero value is entered for height, one end of the line will be raised to the specified
height forming a diagonal line as a result.
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your line will show when you’re previewing your report. If
this is set to false, it will not show. This also holds when you print.
LLiinnee TTyyppee
UbiReport v2.0 69
You can choose which type of line you want to use.
TThhiicckknneessss
You can select the thickness of your line from the list.
LLiinnee DDiirreeccttiioonn
You can choose the line direction to be up or down from left to right when the
height of the line is a non-zero value.
2.4 Circle
WWiiddtthh
You can set the width of your circle by entering a value here.
HHeeiigghhtt
You can set the height of your circle by entering a value here.
UbiReport v2.0 70
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your circle will show when you’re previewing your report.
If this is set to false, it will not show. This also holds when you print.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
You can either show or not show your background color by setting this to true or
false respectively.
UbiReport v2.0 71
2.5 Rectangle
WWiiddtthh
You can set the width of a rectangle by entering a value here.
HHeeiigghhtt
You can set the height of a rectangle by entering a value.
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your rectangle will show when you’re previewing your report.
If this is set to false, it will not show. This also holds when you print.
LLiinnee TTyyppee
You can choose which type of line you want to use.
UbiReport v2.0 72
TThhiicckknneessss
You can select the thickness of your line from the list.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to false,
then your background color will not show.
UbiReport v2.0 73
2.6 Image
If you insert an image item in the editor, the ‘Open Image File’ window will pop
up and you can choose which images you want to use.
WWiiddtthh
You can set the width of your image by entering a value here.
HHeeiigghhtt
You can set the height of your image by entering a value here.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
UbiReport v2.0 74
You can either show or not show the border by setting this to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use.
LLiinnee TThhiicckknneessss
You can select the thickness of your line from the list.
IImmaaggee UURRLL
If you click on the rectangular box on the right, you’ll get the following “Open
Image File” window. Choosing a different image to use from this window will
change the image.
UbiReport v2.0 75
CCoonnttrraasstt CCoonnttrrooll
Clicking on the rectangular box on the right will bring up the filtering window.
You can control the contrast of your image.
UbiReport v2.0 76
2.7 Column
If you insert a column item in the editor, the following column dialog window
will pop up and you can choose which columns you want to use.
WWiiddtthh
You can set the width of a column by entering a value here.
HHeeiigghhtt
You can set the height of a column by entering value here.
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
UbiReport v2.0 77
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to false,
then your background color will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show your border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
UbiReport v2.0 78
TThhiicckknneessss
You can select the thickness of a line from the list.
FFoonntt
You can select a desired font for text from the list.
FFoonntt SSttyyllee
You can select a desired font style (plain, italic, bold, italic & bold).
FFoonntt SSiizzee
You can select a desired font size.
HHoorriizzoonnttaall AAlliiggnnmmeenntt
You can choose your desired horizontal alignment from the list.
VVeerrttiiccaall AAlliiggnnmmeenntt
You can choose your desired vertical alignment from the list.
FFoorrmmaatt
If you click on the rectangular box on the right, you’ll get the following format
window and you can select the desired format.
UbiReport v2.0 79
AAuuttoo SSiizziinngg
If this is set to false, then the width of your column will stay as defined, but if this
is set to true, then the width of the column will be adjusted automatically to just fit
the content of the column.
UbiReport v2.0 80
2.8 User-defined Column
If you insert a user-defined column item in the editor, the following expression
window will pop up and you can choose from columns and functions to create user-
defined columns.
WWiiddtthh
You can set the width of your user-defined column by entering a value here.
HHeeiigghhtt
You can set the height of your user-defined column by entering a value here.
UbiReport v2.0 81
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to false,
then your background color will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show your border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
UbiReport v2.0 82
TThhiicckknneessss
You can select the thickness of a line from the list.
FFoonntt
You can select a desired font for text from the list.
FFoonntt SSttyyllee
You can select a desired font style (plain, italic, bold, italic & bold).
FFoonntt SSiizzee
You can select a desired font size.
HHoorriizzoonnttaall AAlliiggnnmmeenntt
You can choose your desired horizontal alignment from the list.
VVeerrttiiccaall AAlliiggnnmmeenntt
You can choose your desired vertical alignment from the list.
EExxpprreessssiioonn
If you click on the rectangular box on the right, you’ll get the following
expression window and you can compose an expression to be inserted as a user-
defined column.
UbiReport v2.0 83
FFoorrmmaatt
If you click on the rectangular box on the right, you’ll get the following format
window and you can select the desired format.
AAuuttoo SSiizziinngg
If this is set to false, then the width of your user-defined column will stay as
UbiReport v2.0 84
defined, but if this is set to true, then the width of the column will be adjusted
automatically to just fit the content of the column.
UbiReport v2.0 85
2.9 Image Column
If you insert an image column item in the editor, the following image URL
window will pop up and you can create an image column in your report.
WWiiddtthh
You can set the width of your image column by entering a value here.
HHeeiigghhtt
You can set the height of your image column by entering a value here.
FFoorreeggrroouunndd CCoolloorr
UbiReport v2.0 86
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show your border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
TThhiicckknneessss
You can select the thickness of a line from the list.
EExxpprreessssiioonn
If you click on the rectangular box on the right, you’ll get the following
expression window and you can select the image you want to use by entering its
UbiReport v2.0 87
URL.
AAuuttoo SSiizziinngg
If this is set to false, then the width of your image column will stay as defined, but
if this is set to true, then the width of the column will be adjusted automatically to
just fit the content of the column.
UbiReport v2.0 88
2.10 Argument
If you insert an argument item in the design editor, you’ll get the following
argument window and you’ll be able to use an argument you have created in the
SQL editor.
WWiiddtthh
You can set the width of your argument by entering a value here.
HHeeiigghhtt
You can set the height of your argument by entering a value here.
FFoorreeggrroouunndd CCoolloorr
UbiReport v2.0 89
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to false,
then your background color will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show your border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
UbiReport v2.0 90
TThhiicckknneessss
You can select the thickness of a line from the list.
FFoonntt NNaammee
You can select a desired font for text from the list.
FFoonntt SSttyyllee
You can select a desired font style (plain, italic, bold, italic & bold).
FFoonntt SSiizzee
You can select a desired font size.
HHoorriizzoonnttaall AAlliiggnnmmeenntt
You can choose your desired horizontal alignment.
VVeerrttiiccaall AAlliiggnnmmeenntt
You can choose your desired vertical alignment.
UbiReport v2.0 91
3. Common Items
3.1 Common Text
If you insert a common text item in the editor, you’ll get the following common
item (common text list) window and you can use a common text in your report.
WWiiddtthh
You can set the width of your common text by entering a value here.
HHeeiigghhtt
You can set the height of your common text by entering a value here.
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
UbiReport v2.0 92
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to false,
then your background color will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr
You can either show or not show the border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
UbiReport v2.0 93
LLiinnee TThhiicckknneessss
You can select the thickness of a line from the list.
FFoonntt NNaammee
You can select a desired font for text from the list.
FFoonntt SSttyyllee
You can select a desired font style (plain, italic, bold, italic & bold).
FFoonntt SSiizzee
You can select a desired font size.
HHoorriizzoonnttaall AAlliiggnnmmeenntt
You can choose your desired horizontal alignment.
VVeerrttiiccaall AAlliiggnnmmeenntt
You can choose your desired vertical alignment.
UbiReport v2.0 94
3.2 Common Image
If you insert a common image item in the editor, you’ll get the following common
item (common iamge list) window and you can use a common image in your report.
WWiiddtthh
You can set the width of your common image by entering a value here.
HHeeiigghhtt
You can set the height of your common image by entering a value here.
FFoorreeggrroouunndd CCoolloorr
UbiReport v2.0 95
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show the border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
LLiinnee TThhiicckknneessss
You can select the thickness of a line from the list.
IImmaaggee UURRLL
If you click on the rectangular box on the right, you’ll get the ‘Open Image File’
UbiReport v2.0 96
window and you can choose your image to use in your report.
CCoonnttrraasstt CCoonnttrrooll
Clicking on the right rectangular box will bring up the filtering window and you
can control the image contrast from here.
UbiReport v2.0 97
4. Components
4.1 Data Component
Data components can express the result data from SQL queries. Therefore, one
data component always has one SQL information unit.
As shown below, a data component has a data header and a data area. The data
header usually has column names of the result data and the data area displays the
SQL query result data.
BBaanndd
A data component consists of two areas, a data header and a data area. Each of
these areas is called a band in UbiReport. Each band has its own properties, and
detailed information about these properties will be discussed later.
TTyyppee
A data component can contain another data component within itself. Here, we
will call the external data component the master data component (MDC) and the
contained data component the sub data component (SDC).
The following figure will depict the layout in the design editor.
UbiReport v2.0 98
Sub Data Component
Master Data Component
4.1.1 Component Properties
A component has the following properties.
UbiReport v2.0 99
SSQQLL
SQL properties are mainly for SQL binding. You can have many SQL queries in
one report in UbiReport. Thus, you can use the result data of a SQL query by
mapping it to a data component.
HHoorriizzoonnttaall PPaarrttiittiioonn
Horizontal partition is a way of partitioning the data area. You specify a number
by which to partition your data and cascade it down.
The following example uses the horizontal partition of 1, which is the most
common case. If you have designed your report like the following in the design
editor…
the following is the result you get.
If we set the horizontal partition to 4 with the same example, you will get a
partition indicator like as shown below.
UbiReport v2.0 100
Partition Indicator Line
If you increase the data area to include your columns and do ‘preview’, you’ll get
the following result.
As it appears above, there are 4 rows of record set aligned horizontally from left
to right.
MMaaxxiimmuumm BBaanndd RRooww
This option lets you set a limit on the number of rows in a data
component. You can use this option when you have more data than
what you would want to display on your report.
[Screen 1]
UbiReport v2.0 101
If you set the maximum row to be 3 on [Screen 1]
DDuummmmyy BBaanndd
You can use a dummy band to fix the number of rows in a data component. For
example, if you have a few rows of data but still want to have more rows, you can
use a dummy band to insert blank rows in the data area.
If you fix the number of rows to 7 to [Screen 1]
4.1.2 Band Properties
DDaattaa HHeeaaddeerr BBaanndd
UbiReport v2.0 102
If there is a sub data component
within a band, you can expand the
component in according to the data
size of the sub data component.
DDaattaa AArreeaa BBaanndd
You can sort the data (ascending
or descending) by the specified
fields.
You can avoid getting the same
result repeated many times by
adding the appropriate columns
here.
UbiReport v2.0 103
4.2 Cross-tab Component
Cross-tab components links two different data elements. For example, you can
use a cross-tab component in the following example to report how many of each
product each customer bought.
BBaanndd
A cross-tab component consists of 3 bands, the cross header, the cross main, and
the cross footer. When a new cross-tab component is added, the cross header and
the cross footer are not visible on the screen since they’re minimized. If you want
to use them, drag the green rectangles to increase them.
UbiReport v2.0 104
CCrroossss hheeaaddeerr
You can specify the title of your cross-tab component.
CCrroossss mmaaiinn
You can match the columns of database tables and get the sum values.
CCrroossss ffooootteerr
You can specify sub-titles of your cross-tab component.
These bands have their own properties and we’ll explain them in the following
section.
4.2.1 Component Properties
A component has the following properties.
UbiReport v2.0 105
SSQQLL
SQL properties are mainly for SQL binding. You can have many SQL queries in
one report in UbiReport. Thus, you can use the result data of a SQL query by
mapping it to a cross-tab component.
SSQQLL BBiinnddiinngg
If you click on the above SQL binding button, the following SQL binding window
will pop up, binding master columns and sub columns, establishing binding between
data components.
PPrrooppeerrttiieess
If you click on the above properties button, you can change the structure of data in
the following window.
UbiReport v2.0 106
You can set properties about the header at the header tab.
Checking ‘Show Data Title’ will add a column to the header to which you can
write in information about data.
4.2.2 Band Properties
CCrroossss HHeeaaddeerr BBaanndd
UbiReport v2.0 107
Check this item if you have many rows and
they will be carried over to the next page.
If there is a sub data component within a
band, you can expand the component
according to the size of the sub data
component. .
Check if you want to make the
summary column visible.
Check this item if you want to have the
vertical header on each page if your rows
or columns get carried over to next pages.
Check this if you want ot have the
horizontal header on each page.
DDaattaa RRooww BBaanndd
UbiReport v2.0 108
Sort your data in a cross-tab component in
an ascending (ASC) or a descending (DESC)
order.
CCrroossss FFooootteerr BBaanndd
If there is a sub data component within aband, you can expand the componentaccording to the size of the sub datacomponent.
4.2.3 Properties
WWiiddtthh
You can set the width of your component by entering a value here.
HHeeiigghhtt
You can set the height of your component by entering a value here.
UbiReport v2.0 109
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr LLiinnee
You can either show or not show the border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
TThhiicckknneessss
You can select the thickness of a line from the list.
EExxpprreessssiioonn
If you click on the right rectangular box, you’ll get the following expression
UbiReport v2.0 110
window and you can compose an expression to be inserted in the component.
AAuuttoo SSiizziinngg
If this is set to false, then the width of your component will stay as defined, but if
this is set to true, then the width of the component will be adjusted automatically to
just fit the content of the component.
UbiReport v2.0 111
4.3 Chart Component
4.3.1 Properties
WWiiddtthh
You can set the width of a chart by entering a value here.
HHeeiigghhtt
You can set the height of a chart by entering a value here.
SSQQLL
You can select an SQL query of your choice to use in your chart.
SSQQLL BBiinnddiinngg
UbiReport v2.0 112
If you click on the above SQL binding button, the following SQL binding window
will pop up, binding master columns and sub columns, establishing binding between
data components.
CChhaarrtt TTyyppee
You can choose which type of chart you wan to use. The available types are
Vertical Bar, Horizontal Bar, Line, and Pie.
GGrraapphhiicc TTyyppee
You can choose your chart to be 2-dimensional or 3-dimensional.
UbiReport v2.0 113
LLeeggeenndd VViissiibbllee
You can let your legend show or not show by setting this value to true or false
respectively.
CCaatteeggoorryy
You can select a field from the list to be the category for the chart.
SSeerriieess
You can select a field from the list to be the series for the chart.
VVaalluuee
You can select a field from the list to be the corresponding value for the chart.
MMoorree PPrrooppeerrttiieess
If you click on this properties button, the following properties window will pop up.
You can set more detailed properties of the title, value, category, and legend of your
chart.
4.4 Table Component
If you select a table component and bring it in the editor, you’ll get the following
UbiReport v2.0 114
window. Specify the number of rows and the number of columns of your table and
click on ‘OK’ to create your table.
4.4.1 Properties
FFoorreeggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
VViissiibbllee
If this is set to true, your image will show when you’re previewing your report.
If this is set to false, it will not show.
BBaacckkggrroouunndd CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
UbiReport v2.0 115
you can choose from.
TTrraannssppaarreenntt
If this is set to true, then your background color will show. If this is set to false,
then your background color will not show.
BBoorrddeerr CCoolloorr
If you click on the rectangular box on the right, you’ll get a list of available colors
you can choose from.
BBoorrddeerr
You can either show or not show the border by setting this value to true or false
respectively.
LLiinnee TTyyppee
You can choose which type of line you want to use from the list.
LLiinnee TThhiicckknneessss
You can select the thickness of a line from the list.
FFoonntt
You can select a desired font.
FFoonntt SSttyyllee
You can select a desired font style (plain, italic, bold, italic & bold).
UbiReport v2.0 116
FFoonntt SSiizzee
You can select a desired font size.
HHoorriizzoonnttaall AAlliiggnnmmeenntt
You can choose your desired horizontal alignment.
VVeerrttiiccaall AAlliiggnnmmeenntt
You can choose your desired vertical alignment.
TTeexxtt
You can type in text that you wish to show in the selected cell of the table.
4.4.2 Adjusting the Cell Size
Changing the size of a certain cell in a table component will change the size of
that cell only.
For example, if you change the cell size as shown above, the following is the
result you get.
UbiReport v2.0 117
If you want to change the size of all the cells in the left-most column, then select
all the cells and adjust the size.
4.4.3 Editing Cells
If you are familiar with word processors such as MS Word, you will find cell
editing in UbiReport easy. By being able to manage and edit cells easily, you’ll be
able to generate desired reports easily.
MMeerrggee
UbiReport v2.0 118
If you want to merge two cells into one cell, first select the cells you want to
merge by dragging over them, click on the right mouse button, and then choose
‘Merge’ from the menu. The following is the result.
CCeellll SSpplliitt
In order to split a cell, you need to select the cell to split and right click to select
‘Split’ in the pop-up menu just as in merging cells. You will be asked to enter the
number of rows and columns that you want to split the cell into.
UbiReport v2.0 119
After you enter the number of rows and columns, the table will appear as the
following.
You can also select more than one cell and split them in rows. The result will
appear as the following figure.
UbiReport v2.0 120
AAddddiinngg CCoolluummnnss
You need to be able to project actual binding data and columns on the table. You
can select a cell and right click to select “Add Column” from the pop-up menu to
add a column to the corresponding cell. As shown below, you will see the
following Column Dialog window pop up which will display the available columns
you can choose from.
From the Column Dialog window, you can choose a column to be mapped into
the selected cell in the table. If you have selected more than one cell in the table,
you can go on choosing as many columns as cells by holding down the “CTRL” key
and those columns would appear on the table in the order in which they were
selected. The following is the result.
UbiReport v2.0 121
AAddddiinngg UUsseerr--ddeeffiinneedd CCoolluummnnss
You can add a user-defined column by right clicking on the cell in the table where
you wish to add and selecting “Add User Column” from the pop-up menu. The
Expression Dialog window will pop up as shown below.
We will skip how to build an expression in this section since it has already been
discussed in detail in the previous chapter about user-defined columns. After
UbiReport v2.0 122
writing an expression, click on ‘OK’ to see your user-defined column added as
shown below.
AAddddiinngg IImmaaggee CCoolluummnnss
You can add an image column by right clicking on the cell in the table where you
wish to add and selecting “Add Image Column” from the pop-up menu. You’ll get
the Image URL Expression Dialog window as shown below.
We will skip how to build an expression in this section since it has already been
UbiReport v2.0 123
discussed in detail in the previous chapter about image columns. After writing an
expression, click on ‘OK’ to see your image column added as shown below.
DDeelleettiinngg CCoolluummnnss
Deleting a column will erase everything in the selected cell including text,
columns, user-defined columns, and image columns.
You can right click on the cell that you want to delete and select “Delete Column”
from the pop-up menu.
Once you have successfully deleted the column, all the values that appeared on
the deleted cells are removed as shown below.
UbiReport v2.0 124
AAlliiggnniinngg HHeeiigghhtt
You can align the height of every cell in a table to that of a selected one.
First, right click on the cell that will serve as the basis for the desired height and
select “Align Height” from the pop-up menu.
Base Cell
The height of all other cells will be adjusted to that of the selected cell as a result
as shown below.
UbiReport v2.0 125
AAlliiggnniinngg WWiiddtthh
You do the same operation as aligning height except you’re aligning width this
time.
Base Cell
UbiReport v2.0 126
UbiReport v2.0 127
5. Sorting, Grouping, Suppressing
Sorting, grouping, and suppressing are ways to turn disperse data into useful
information.
5.1 Sorting
Sorting makes it easy to search and carry out arithmetic operations.
For example, when you’re trying to look up someone’s phone number, a phone
book that is sorted by name would make your life a lot easier than a phone book that
has no particular order.
You can sort by alphabet, numeric values, date, and Boolean in an ascending or
descending order.
You can also sort by group. For instance, after sorting by position, you can re-
sort the result by name.
You can select columns to be sorted and give a direction for each column (ASC
for ascending and DESC for descending) in the design editor as shown below.
Below is an example of a report which sorts by group. You can see that the
UbiReport v2.0 128
report is sorted by position in an ascending order first and then by name in a
descending order.
5.2 Grouping
Sometimes sorting may not be enough to generate an effective report.
You use grouping to divide data into groups.
Below is an example of how to use grouping effectively in a report.
UbiReport v2.0 129
In order to apply grouping, click on the ‘Edit Group’ button at the bottom of the
component tab in the design editor.
If you want to group by A.JOB for instance, simply click on and drag A.JOB from
‘Unselected Columns’ to ‘Selected Columns’.
UbiReport v2.0 130
You will find that ‘GROUP HEADER’ (Top) and ‘GROUP FOOTER’ (Bottom)
have been added in the design editor. You can check the result by previewing your
report.
You can also apply sorting while applying grouping to your data.
If you click on the data area, the band tab will be activated as shown below and
you’ll see the list of columns you can sort.
UbiReport v2.0 131
5.3 Suppressing
You can take advantage of suppressing to avoid unnecessary redundancy of data.
For example, you see that the position column in the previous figure is repeated.
You can eliminate this by using suppressing.
If you click on the data area, the band tab will be activated and you’ll see the list
of columns you can suppress.
Select the redundant column, A.JOB.
Now, you see a more intuitive and easy-to-read report that displays the subtotal
UbiReport v2.0 132
and the average income of each position group.
UbiReport v2.0 133
6. Expression
6.1 Functions
FFuunnccttiioonnss iinn tthhee SSQQLL EEddiittoor
- Composite Column These are functions you can use in an SQL query. However, certain functions
may or may not be usable depending on your DBMS, so you should find out which
functions your DBMS supports and which ones it doesn’t support.
Here is the list of the provided functions and their brief descriptions.
1. LOWER(S) – Converts the string S into lower-case.
2. UPPER(S) – Converts the string S into upper-case.
3. INITCAP(S) – Converts the initial letter of the string S into upper-case.
4. CONCAT(S1, S2) – Concatenates the strings S1 and S2. That is, a copy of S2
UbiReport v2.0 134
is appended to the end of S1.
5. SUBTR(S, I1 [, I2]) – I2 characters starting from the I1th character of the string
S or the entire string starting from the I1th character of the string S are removed
from the string S. The result is returned.
6. NVL(S1, S2) – Returns the string S2 if the string S1 is null.
7. TO_CHAR(N/D, [fmt]) – Converts the numeric value N or the date value D
into a string of the [fmt] format.
8. DECODE(S1, S2, S3) – If the string S1 is equal to S2, then the string S3 will
be returned.
9. LENGTH(S1) – Returns the length of the string S1.
10. ROUND(N, I) – Rounds off the number N to I decimal places.
11. TRUNC(N, I) – Truncates all the decimal numbers beyond the Ith decimal
place.
12. MOD(I1, I2) – Yields the remainder of the integer I1 divided by I2.
13. MONTHS_BETWEEN(D1, D2) –Returns the month difference between the dates
D1 and D2.
14. TO_NUMBER(S) – Converts the string S into a numerical form.
15. COUNT(S/N) – Counts the number of characters/digits in the string S/the
integer N.
16. AVG(N) – Returns the average of the values resident in the column N.
Usually, the column N contains numerical values.
17. MAX(N) – Returns the maximum value among the values resident in the
column N. Usually, the column N contains numerical values.
18. MIN(N) – Returns the minimum value among the values resident in the
column N. Usually, the column N contains numerical values.
19. STDDEV(N) – Returns the standard deviation of the values resident in the
column N. Usually, the column N contains numerical values.
20. SUM(N) – Returns the sum of the values resident in the column N. Usually,
the column N contains numerical values.
UbiReport v2.0 135
21. VARIANCE(N) – Returns the square of the standard deviation of the column
N. Usually, the column N contains numerical values.
22. TO_DATES(S[, fmt]) – Converts the strings in the column S into the [fmt]
date form.
23. ADD_MONTHS(D, I) – Adds I month(s) to the date D and returns the result.
24. NEXT_DAY(D, WEEK) – Given the weekday WEEK(Mon~Fri), computes
the nearest upcoming date with the same WEEK from the date D.
25. LAST_DAY(D) – Returns the last day of the month the date D belongs to.
26. ROUND(D[, fmt]) – Rounds off the date D to the [fmt] form.
27. TRUNC(D[, fmt]) – Truncates the date D to the [fmt] form.
FFuunnccttiioonnss iinn tthhee DDeessiiggnn EEddiittoorr
Double-click
UbiReport v2.0 136
1. avg(C) – Computes the average of the values in the column C. Used with
grouping only.
2. bigger(N1, N2) – Determines if the number N1 is bigger than N2.
3. contain(S1, S2) – Determines if there is any occurrence of the string S2 in S1.
4. count(C) – Counts the number of rows in the column C. Used with grouping
only.
5. decode(S1, S2, R1, S3, R2, S) – Returns R1/R2 when the string S1 matches
S2/S3, or else S.
6. if(B, T, F) – Returns T if the condition B holds, or else F.
7. length(S) – Returns the length of the column S.
8. max(C) – Returns the maximum among the values in the column C. Used
only with grouping.
9. min(C) – Returns the minimum among the values in the column C. Used only
with grouping.
10. minus(N1, N2) – Returns the result of the number N1 minus N2.
11. page() – Returns the current page in case of printing.
UbiReport v2.0 137
12. remainder(I1, I2) – Returns the remainder of the number I1 divided by I2.
13. substr(S, I1, I2) – Returns the characters from (I1+1)th to I2th index of the
string S.
14. sum(C) – Returns the sum of the column C. Used only with grouping.
15. this() – Returns the value of itself. Only for use in text/column items.
16. today() – Returns today’s date in the YYYY-MM-DD form.
17. totalpage() – Returns the number of total pages in case of printing.
UbiReport v2.0 138
7. Formatting
You use formatting when you want to change the design of your report. That is,
if you want to change the expression of data, you can use formatting.
For example, you can express certain data in a foreign currency format, round off
a number to N decimal places, and change the date in a alternative format.
UbiReport supports decimals/integers, foreign currency symbols such as the US
dollar and the Japanese Yen, and various date formats.
7.1 Format Setting
Any changes made in the ‘Format Config’ window will be reflected in the ‘Item
Property’ window when a column or a user-defined column item is selected, as
shown below.
UbiReport v2.0 139
If you click on the rectangular box next to ‘Format’, the ‘Format Dialog’ window
will pop up where you can choose from the existing formats or even define and test
your own formats.
You can check out the result immediately after setting the desired format.
UbiReport v2.0 140
8. Page Link
Each item can have a link and it applies when you're previewing your report. If
you make a link for an item, then when you preview your report, the mouse pointer
will change to a hand and clicking on that item will move you to the right place
according to the link information.
If you check the 'Link' box from the properties window, you'll get the following
link setup window. There are two types of link you can have in UbiReport, a link
to a jrf file and a link to a web page. If you select 'Report', then you'll be able to set
up a link to a jrf file. The following is a link to a jrf file.
Type in the necessary information for a link in the above window.
If 'selflink' is checked, clicking on this type of link will give you the same report
with different values for specified arguments. If you uncheck this option, then 'link
file name' gets activated and you can type in the name of your jrf file that you want
to link to.
In the argument section, you have to specify all the arguments that you need to
provide for the file you're linking to. Note that the arguments must have the same
names in the file you're linking to. For the argument value, you can use numbers,
characters, or expressions. Double-clicking on the value field will bring up the
expression window.
You can make an expression in this window as you have learned already.
Clicking on this type of link when you're previewing your report will call up
specified pages with the specified arguments.
If you select a web page for your link from the combo box, then you can make a
UbiReport v2.0 141
link to a web page. Type in the URL of the page you want. You can leave out
'HTTP://' here.
UbiReport v2.0 142
9. Master Page Editing
Using a master page, you can add a picture to your report and modify the
background. You will need to use a master page when you’re trying to gather
many objects in your report such as the company logo, text, and pictures.
Let’s try, for example, to have a company logo in the background of a report.
You can select either ‘Design Option’ -> ‘Edit Master’ from the main menu or
click on the ‘Edit Master’ icon on the tool bar.
Once you get a master page open, select ‘Edit’ -> ‘Item’ -> ‘Image’ from the main
menu. Then, locate your image in the center of the master page with an
appropriate size. You can adjust the contrast of the image through the filtering
feature provided in the ‘Item Property’ on the left side.
If everything is in the right place, the result would be something like this.
UbiReport v2.0 143
10. Vertical Text
In UbiReport, you can type in text vertically.
To generate a report with vertical text, select ‘Vertical’ for Text
Orientation from the following window.
Once the text orientation is selected as vertical, components
appropriate for vertical text will be generated in each page format.
However, please, note that the current cross-tab format does not
support vertical text.
If the text orientation is selected as vertical and the page format is
selected as tabular, then you will see the following initial design.
Data components in the master page are rotated 90 degrees
clockwise.
When you’re designing a vertical report, you start from the right
side of the page and list your data from right to left. Please, note
that the position information in the properties window shows the
position in relation to the top right corner.
You can use all the tools and features in vertical data components
that you would use in horizontal data components.
UbiReport v2.0 144
If you add text items here or any other items where you would type
in text, the text would be vertical.
You would notice that the icons in the tool bar are a little different
when you are working with vertical components. These different
icons indicate vertical data components.
Note that you cannot use a cross-tab component in the vertical
mode.
UbiReport v2.0 145
You can insert data components into vertical data components. You
can perform SQL joining or other tasks in vertical components as you
would in horizontal components.
You can design your report as the following using vertical
components.
UbiReport v2.0 146
UbiReport v2.0 147
CChhaapptteerr 77 PPrreevviieeww
UbiReport v2.0 148
If you want to preview the report you have generated, click on the ‘Preview’ tab
in the lower left corner. Then, you’ll be able to see how your report looks, as
shown below.
1. Argument Value Setting
You may find that you need to apply an argument you have added in the SQL
editor in order to preview your report.
In this case, you will see the following argument window when you click on the
‘Preview’ tab. Give proper values for your argument and you’ll be able to prevew
your report.
UbiReport v2.0 149
2. Functional Descriptions
② ③① ④
①
②
y
a
Prin
Prin
ou w
nd h
t the preview image o
t the report after sett
ill see the following
ow many copies to p
f the report as it is.
ing up the printing. When you click on this button,
window where you can specify which pages to print
rint.
UbiReport v2.0 150
③ By clicking on this button, you can save the preview image. The following
window is what you will see when you click on the button.
You will see the following window when you click on the “Create” button after
selecting the scope and the size of the image to save. Then, you will be able to
UbiReport v2.0 151
choose in which format (GIF or JPG) to save the image.
④ This button will move you quickly and accurately to the specific page you
want to look up.
UbiReport v2.0 152
CChhaapptteerr 88 FFiillee MMaannaaggeemmeenntt
UbiReport v2.0 153
1. Open
1.1 Opening Files from a Local PC
If you want to open a file from a local PC, select ‘File’ -> ‘Open’ from the main
menu or click on ‘Open’ in the tool bar.
Select a file and open it. If you are not connected to any database at this time,
the following window will pop up and you will get connected to your database.
Once you get connected to you database, you will be able to edit a report in any
way you wish.
You can open several report files at the same time. Tabs of all open files will
help you switch among them easily.
UbiReport v2.0 154
2. Saving
When saving a report file after you have generated or edited it, you can select
from ‘Save’, ‘Save As’, or ‘Save All’.
When you’re saving a new file, you should choose ‘Save’ and the appropriate
window will appear. You can save the new file from that window.
When saving an existing file after editing, you should choose ‘Save’ and the file
will be saved automatically.
If you want to save an existing file after editing but with a different name, you
should choose ‘Save As’. Then, the appropriate window will pop up where you
can type in a new name.
If you click on the ‘Save All’ button, all the open files you’re working on will be
saved. If there is a new file, the appropriate window will pop up asking for a file
name, but the existing files will be saved automatically.
UbiReport v2.0 155
3. Using Templates
To make a report easily, you can apply templates including fixed report formats
you often use or similar report formats you need to complete your report.
3.1 Making a Template
Making a template is the same as making a report, but you have to specify it as a
template instead of a report when saving.
Let’s say, you bring a title, a page number, and logos from the master page into
your report design without any SQL statement, as shown below.
Let’s assume the title and other data are shown in the above report format.
If a template is made in this format, all the reports using this template will have
the same type of title font, size, etc.
To save the form, choose [File] [Save as Template] from the menu.
Then the template window will pop up where you can save this report as a
template.
In UbiReport, template files have the .tpl extension whereas report files have
the .jrf extension.
Type in the file name and click on the save button to save the file.
UbiReport v2.0 156
3.2 Making Reports by Using Templates
To make a report using a template made in 3.1, go to [File] [Open Template]
from the menu.
Then, the template window pops up where you can choose your template.
Choose the template file you want and the chosen report will be opened.
If you click on the design editor tab from this report, the form saved as a template
will appear.
You can simply put in the title and SQL statements to finish your report.
UbiReport v2.0 157
4. Remote File Management
4.1 Open File from Remote Server
Clicking on [Menu] -> [File] –> [Open Remote File] or clicking on the [Open
Remote File] button from the tool bar to will bring up the following window. You
can connect to the FTP server from this window.
Type in all the information including the site name, the FTP address, the user, the
password, the port, and the report directory and click on ‘OK’.
UbiReport v2.0 158
If you get connected successfully, you’ll get the following window.
If you are connected to the FTP server, you can open report files saved on the
server and edit them and save them back on the server.
UbiReport v2.0 159
4.2 Saving on a Remote Server
Click on the ‘save remote file’ button from the tool bar or go to [Save Remote File] from the menu bar.
From the ‘FTP Save’ window, click on ‘Setup’.
Type in all the information including the site name, the FTP address, the user ID,
the password, the port, and the report directory and click ‘OK’.
UbiReport v2.0 160
If you get connected to the FTP successfully, you’ll get a list of directories of your
FTP server and you can save your report as a jrf file in the desired directory.
UbiReport v2.0 161
5. Editing File Source
Go to [Tool] [File Editor] from the main menu and you’ll get the following file
editor.
This file editor provides the following usual tools that other document editors
provide.
- Opening / saving files and opening / saving remote files
- Undo, redo, cut, copy, paste
- Find, replace, line search
UbiReport v2.0 162
This file editor can be useful because you can actually change your reports by just
editing XML without opening them first in UbiReport since jrf files are saved in the
XML format.
Using this editor, you can also edit JSP files and .bat files that can run
independently on your PC.
UbiReport v2.0 163
CChhaapptteerr 99 UUssiinngg UUbbiiRReeppoorrtt oonn tthhee WWeebb
UbiReport v2.0 164
If you want to provide service on the web using your generated reports, you need
not only your report files but also pages that use these files one the web.
UbiReport automatically generates these web pages as jsp files. The jsp file
generator is a tool that can help the developer generate jsp files more easily. Using
this tool, you can generate basic jsp files that open and run your report files as
applets. By editing these files, you can easily make web pages you need.
1. Setting up HTML/Batch Generator
Go to [Tool] [HTML/Batch Generator Setup] from the menu and you’ll get the
following window.
In the above window, type in the necessary information for each tab.
ServletURL1 : Url that can access the servlet that can deliver report forms to the
client.
ServletURL2 : Url that can access the servlet that can connect to DB and bring
back results.
Jrf dir : The directory where jrf files are saved.
UbiReport v2.0 165
File url : The directory set up on the server to use UbiReport.
UbiReport v2.0 166
2. HTML Generator
After you have finished setting up the HTML/batch generator, go to [Tool]
[HTML Generator] from the menu and you’ll the following generator window.
Title : This will appear as the title on your browser.
Code Base : This is the location of your HTML page.
Jrf File Name : Type in the name of the jrf file you have saved on the server.
Html File Name : Type in the name of the jsp file that calls up the web page.
After finishing setting up, click on the create button to generate the HTML file.
If your HTML file is created successfully, the above window pops up letting you
that your HTML file has been created. Clicking on ‘OK’ here will bring the
following file editor. You can edit your HTML file here and save it on the server.
UbiReport v2.0 167
After finishing editing your file, click on ‘remote file save’ to save your file on the
server.
2.1 Including Common Items
To use common items we have discussed previously, a copy of the
commonitem.xml file you’re using has to exist on the server. Thus, use
commonitem.xml from the server and if you have any items to add, add them
properly to commonitem.xml on the server. This applies to all common items
including common text and common images.
2.2 Including Images : Automatic Saving through FTP
If your report, saved as a jrf file, contains images and you have also saved your
UbiReport v2.0 168
file on the server, the images you have used in your report will also be saved on the
server. But, be careful not to overwrite old images. Saving a file on the server
that already has a file with the same name will overwrite that file including images
contained in that file.
UbiReport v2.0 169
CChhaapptteerr 1100 UUssiinngg UUbbiiRReeppoorrtt oonn AApppplliiccaattiioonnss
UbiReport v2.0 170
Running report files generated through UbiReport on applications requires the
same setup as running them on the web. Your report files are saved on the server
and the applications ask the server for the needed files. After applications get the
needed files, they extract data from database. Thus, it is not necessary at all to save
copies of report files on the client. For more detailed information on applications,
please consult UbiViewer User Guide provided along with this manual.
UbiReport v2.0 171
1. Batch Generator
UbiReport can generate .bat files for your report files that can run independently.
Setting up the batch generator has been discussed previously.
Go to [Tool] [Batch Generator] from the menu and you’ll get the following
batch generator window.
For File Url, Servlet URL1, Servlet URL2, and Jrf File Directory, select one form
the list set up by the HTML/Batch generator. Type in the name of your report file
for ‘Jrf File Name’ and ‘Batch File Name’.
After you have set up properly, click on create button and you’ll get the following
message window letting you know that the batch file has been successfully created.
Clicking on the OK button in this window will bring up the batch file source.
UbiReport v2.0 172
If the source is correct, close this window. The default folder for batch files is
the batsample directory of UbiDesigner.
above window is correct, click close to finish.
The following is an example of a batch file generated through this process.
If the batch generator generates a batch file using a report file, a batch file
UbiReport v2.0 173
(Example.bat in this case) will be saved in the batsample directory as shown below.
Moving this file to the directory where UbiViewer is and running it will bring up
the following application.
UbiReport v2.0 174
CChhaapptteerr 1111 EExxeerrcciissiinngg
UbiReport v2.0 175
1. Overview
So far you have learned about the basic tools and features of UbiReport. In this
chapter, we’ll build a new report using what we have learned so far.
Following this example will familiarize you with the tools and features of
UbiReport. The tools and functions listed below will be utilized in this example.
- Making a new report
- Connecting to database
- Selecting tables from database
- Choosing columns
- Using condition clauses such as Where, Group by, Having
- Using the SQL editor in the graphical and text modes
UbiReport v2.0 176
- Setting up arguments for SQL statements
- Designing using the design editor
- Grouping, sorting, and suppressing
- Saving report files
- Preview / print
- Viewing report files using a web browser
UbiReport v2.0 177
2. Before We Start
Let’s assume that the table we use in this example is a table called Products in
Oracle. The layout of Products is as follows.
Product Categories Detailcategories
Productid Char Categoryid Char Detailcategoryid Char
Categoryid Char Categoryname Char Categoryname Char
Detailcategoryid Char Categoryid Char
Modelname Char
Unitcost Number
Description Char
Discountrate Number
Regdate Date
Orders OrderDetails
Orderid Char Orderid Char
Customerid Char Productid Char
Orderdate Date Quantity Number
Totalcost Number Totalcost Number
Unitcost Number
UbiReport v2.0 178
3. Making a New Report
Go to [File] [New File] from the menu bar or click on the new file icon and
you’ll get NoName1 as shown below.
UbiReport v2.0 179
UbiReport v2.0 180
4. Connecting to database
Double-click on the database you want to work with from the list and you’ll get
the following database connection window. If the connection is correct, click on
‘Connect’. If there is no connection listed, then go back to Chapter 3 and get
correct connection information.
UbiReport v2.0 181
5. Selecting Tables from Database
Select the table for your SQL query and drag it to the right side. You’ll get a
window where you can type in the name of your SQL statement. Let’s put in
‘PRO_SQL1’ and click on ‘OK’.
When you’re done giving a name for your SQL statement, the Products table will
appear in Canvas Area. Following the same steps, drag the Categories table and
the Detailgategories tables to Canvas Area.
If you have completed dragging all three tables, the window will look like the
following.
UbiReport v2.0 182
UbiReport v2.0 183
6. Generating SQL Statements
Select columns from the tables as shown below and join the three tables as the
following.
--CCoolluummnnss
A.PRODUCTID, A.MODELNAME, A.UNITCOST, A.DESCRIPTION,
A.REGDATE, B.CATEGORYNAME, C.DETAILCATEGORYID
FROM PRODUCTS A, CATEGORIES B, DETAILCATEGORIES C
-- WWhheerree CCllaauusseess
A.CATEGORYID = B.CATEGORYID
AND B.CATEGORYID = C.CATEGORYID
AND A.DETAILCATEGORYID = C.DETAILCATEGORYID
UbiReport v2.0 184
6.1 Using SQL editor in Graphical and Text modes
If you have finished setting up your tables and columns, switch to the text mode.
Then, you’ll see the following SQL statements.
You can introduce additional columns or conditions if necessary.
Check ‘Auto Syntax Check’ in the text node and click on the design editor tab.
In the same way, make one more SQL statement named SALE_SQL.
SELECT B.QUANTITY , B.QUANTITY * B.UNITCOST "TOTALCOST",
A.ORDERDATE, B.PRODUCTID , B.UNITCOST
FROM SCOTT.ORDERS A, CARD.ORDERDETAILS B
UbiReport v2.0 185
6.2 Designing using the Design Editor
Clicking on the design editor will bring up the following window. Select
‘Tabular’ since this report has repeated data. Leave the default values for other
fields and click on ‘OK’.
You will get the following window that contains a data component. Select the
data component while holding down the ‘Alt’ key and map your SQL to PRO_SQL1,
which we have already made.
UbiReport v2.0 186
If SQL information mapping is complete, we’ll start designing.
First, increase the data area to cover just under the data header to the bottom of
the page. Next, put a text item at the top of your Master Page and type in ‘Product
Sales Report”. Place this text item in the middle of the page.
Now the format and the title are done.
UbiReport v2.0 187
Next, we’ll compose the upper part of the report. First, bring a table component
with 4 rows and 3 columns to the top of the data area. If the table was created
correctly, type in the titles – “Category”, “Product ID”, “Unit Cost”, “Detailed
Category”, “Model Name”, and “Discount Rate”.
After typing in the titles, highlight the titles by adjusting the foreground and
background colors. Now, we’ll map tables to columns.
For those columns without titles, start mapping from top starting with the left.
Bring SQL information columns by adding columns.
The mapping order is B.CATEGORYNAME, A.PRODUCTID, A.UNITCOST,
C.CATEGORYNAME , A.MODELNAME, A.DISCOUNTRATE
Now, let’s design the lower part of the report.
First, bring another table component (2 X 2) below the current table component.
Shorten the first row of the table component and increase the second row all the way
down to the bottom of the data area.
Type in “Sales State” as the title of the first row and “Description” as the title of
UbiReport v2.0 188
the second row. Map the right cell of the second row to the A.DESCRIPTION
column.
Since A.DESCRIPTION contains descriptions of products, we don’t know how
long they’re going to be. Thus, bring up the properties window for
A.DESCRIPTION and set ‘Auto sizing’ to true.
Once you are done with this, you’ll get the following design.
Now, let’s do daily sales. Add a data component on to the cell underneath ‘Daily
Sales’ and adjust the size of this data component to fit the size of the cell.
From here on, let’s call the first data component we introduced the master
component and the new data component the sub component.
Among properties of the sub component, set SQL information to SALE_SQL,
which you have already created. Now, let’s make information about SQL binding
between the master component and the sub component.
Select A.PRODUCT ID from the master column and B.PRODUCT from the sub
column and click on the ‘Add’ button.
UbiReport v2.0 189
Be extra careful about binding the master column and the sub column since your
report calls sub data regarding master data. Now we have finished adding columns
to the sub component. Now, let’s add columns to the data area.
Add columns in the order of B.QUANTITY, A.ORDERDATE, B.UNITCOST,
TOTALCOST and try to size them well.
UbiReport v2.0 190
7. Formatting
Now the report form is complete.
Now, let’s try to make the report be more readable and understandable by
formatting columns. The users of this report will probably want the usual formats
for dates (yyyy – mm - dd), numbers (999,990), and percentages (99.99%).
Select a column and select the format from the properties window. Change the
formats as shown below.
UbiReport v2.0 191
8. Group, Sort, Suppressing
There may be a case where the user wants to see data starting from today, see the
total cost with no dates repeated, and the sales sum of each product. In this case,
we can use grouping, sorting, and suppressing to generate the desired report.
-- SSeettttiinngg uupp GGrroouuppiinngg
Select the sub data component and click on the ‘Group Edit’ from the component
tab in the properties window and you’ll get the following ‘Group’ window.
Clicking on the ‘Add’ button here will create GROUP_A and you’ll get the list of
columns from the sub data component. Select B.PRODUCT and drag it to the
selected column side. Click on ‘OK’.
UbiReport v2.0 192
‘Group Header’ and ‘Group Footer’ are generated as shown above. Since we
don’t need a group header, raise the data header all the way to the top of the group
header. In the group footer, let’s make the quantity sum and the amount sum.
Go to [Item]→[User Column] from the menu or click on user column icon from
the tool bar. Now, draw a user-defined column in the group footer. This will
bring up the expression window. Select ‘sum()’ from this window and select B.
QUANTITY.
Then, you’ll get “sum(:B.QUANTITY)” as shown above. If everything’s
UbiReport v2.0 193
correct, click on ‘OK’.
In the same way, complete a user-defined column for the amount sum.
Set the format of these two user-defined columns to ‘#,##0’.
-- SSoorrttiinngg // SSuupppprreessssiinngg tthhee RRrrddeerr DDaattee iinn aa DDeesscceennddiinngg OOrrddeerr
Select the data area of the sub data component and click on the band tab. Then,
you’ll see ‘Sort’ and ‘Suppressing’.
Clicking below ‘Sort’ will list the columns. From this list, select
A.ORDERDATE and right click. Choose DESC(ending).
Clicking below ‘Suppressing’ will list the columns. Select A.ORDERDATE.
UbiReport v2.0 194
9. Editing the Master Page
At this time, let’s insert a company logo or mascot in the report background. Go
to [Design Edit] -> [Master Edit] form the menu or click on the ‘Master Edit’ icon
from the tool bar.
If you see the master page, go to [Edit] -> [Item] -> [Image] from the menu.
Locate the image item in the center of the master page with a desired size.
Next, click on ‘Filtering’ from the item properties and control its contrast.
If you have finished the steps successfully, you’ll be able to see something like
the following.
UbiReport v2.0 195
10. Saving Your Report File
If you have successfully completed all the steps so far, you report should be
finished now.
Clicking on [File]→[Save] from the menu or clicking on the ‘Save’ icon from the
tool bar will save your report with the name, PRODUCT.jrf in the folder you want.
UbiReport v2.0 196
11. Preview / Print
If you want to preview the finished report, click on the preview tab at the bottom.
You’ll be able to see the finished report as shown below.
If you get desired results for features such as sorting and suppressing, you are
ready to use UbiReport to generate any reports you want.
If you want to print this report, click on the ‘Print’ icon on your left.