You are on page 1of 29

Oracle Reports Tutorial

Report Builder Features
• A query builder with a visual representation of the specification of SQL statements to obtain report data
• Wizards that guide you through the report design process
• Default report templates and layouts that can be customized to meet your reporting needs
• The ability to generate code to customize how reports will run
• A Live Pre-viewer that allows you to edit report layouts in WYSIWYG mode
• An integrated chart builder that helps you to graphically represent report data
• Web publishing tools that dynamically generate web pages based on your data
• Other standard report output formats like HTML, PDF, PCL, Postscript, and ASCII
Starting Report Builder
1. Make sure PC Xware is running
2. Telnet Pegasus by typing telnet pegasus.rutgers.edu or connect to pegasus from the SSH client (make sure X11 Tunneling is
enabled in SSH preferences)
3. start oracle Report Builder by typing rwbld60
Using Wizards
Report Builder has a Report Wizard, Data Wizard, and Web Wizard to automate the creation of reports. Most often, you can create a report by
starting with one of the wizards, and then refining the report that the wizard creates using the data model view and the layout view.
To create a report using report wizard
1. If the Welcome dialog box appears (the following screen), click Use the Report Wizard and click OK.
If the Welcome dialog box does not appear, choose File->New->Report. Click Use the Report Wizard and click OK.
2. You will receive the following screen unless you selected not to display it in the future previously. Click next
3. Select Report type; this will affect report layout. you can see the different layouts by clicking their corresponding buttons and
looking at the sample layout on the left. After you select the type you want click next
4. The data presented in the report is the result of a query. If you are not connected, you need to connect as shown in the following
screen.You can create that query by one of three methods: (1) writing a SELECT statement (2) Building the query using the Query
By Example (QBE) interface, (3) importing the query.

5. Select the fields you would like to display in the report in the order you want as shown in the next screen. Then click next
6. Apply aggregate functions to the fields if you want by selecting the field then the aggregate function. Then click next
7. Change Field names and their width as shown in the next screen then click next
8. Select a template then click next
9. On the last page of the Report Wizard, click Finish.
10. A report is created and appears in the Live Previewer.
11. From the Live Previewer, you can edit the report as desired. Note that the Live Previewer is one of several report views that are
available in the Report Editor. Using the View menu or the toolbar, you can switch to other report views to
Report Editor
In the Report Editor, you can view information about a report in four different ways. You can switch between these views using the View menu
or the toolbar icons. You will work in each of the following Report Editor views as you create the sample reports in this tutorial:
• Live Previewer
• Data Model view
• Layout Model view
• Parameter Form view
Live Previewer
This view displays your report as the end user will see it. If you are using existing data, the Live Previewer will update the report as data
changes. Any modifications that you make to the report in the Live Previewer are reflected immediately. To display your report in the Live
Previewer, select View menu then Live Previewer.
Data Model view
This view displays your report data as data model objects so that you can see the relationships between queries, groups, columns, parameters,
and links. To display your report in the Data Model view, select View menu then select Data Model.
Layout Model view
This view displays the attributes of your report as objects so that you can see the attribute types and relationships. You can edit layout objects,
such as frames, repeating frames, fields, boilerplates, anchors, and graphics in this view in order to change the appearance of the report. To
display your report in the Layout Model view, select View menu then select Layout Model.
Parameter Form view
This view lets you create a Runtime Parameter Form for your report. When a user runs your report, the user enters values for parameters in this
form to determine how the report will execute. Otherwise, the user may accepts the defaults. If you do not define a Runtime Parameter Form in
the Parameter Form view, Report Builder displays a default Parameter Form at runtime. You can select which system and user parameters to
use for your form using the Parameter Form Builder, or you can create your own from scratch. To display the Parameter Form view, select
View menu then select parameter form.
Modifying Report Format
To apply changes to any column, click anywhere in that column. Report Builder will select all the rows in that column to indicate that changes
will apply to all the rows. You can select multiple columns and items by holding shift and clicking on those columns or report items.
After selecting the items you want to modify, apply the required changes by selecting the appropriate icons from the formatting toolbar. As
seen in the toolbar you can change font face, font size, toggle between bold/unbold, etc. You can also change data alignment (left justified,
centered, right justified, full justified). For Monetary data items, yo can add dollar sign, percentage sign, increase number zeros on the right to
the decimal point, etc.
Conditional Formatting
The Conditional Formatting is a great way to apply formatting exceptions to your layout objects. (For example, you can make a field’s value
Red when it exceeds a specified maximum value). If you are familiar with Excel, there is a similar feature there. The Conditional Formatting
dialog box alone may satisfy your requirements for creating a formatting exception without the need to edit the corresponding trigger.
However, once you directly edit a Format Trigger for an object, you should not go back and use the Conditional Formatting dialog box to make
more modifications.
To apply conditional formatting to an item:
1. select that item, then select property palate from Tools menu. Or right click that data item and select property palate.
2. Under the general layout section, select Conditional Formatting as show in next screen. you will get the conditional formatting
dialog box.

3. Click New
4. Apply a condition by selecting an operator such as Less than or Between then put the values for the condition. You can have a
complex condition (multiple conditions connected by AND or OR) by clicking radio button in the next line. The AND/OR will be
enabled (on the right).
5. Then Apply the format you want when that condition is met by changing the font face, color, fill color, etc. You can also select to
hide the data item.

X I ++B l O4 +B<+×O× l O4 +O O¤+× YOY++ ÷OB+<Y<OB¤B+OO¯¤YY<B++<¤BO+OO' I<Y+ Y++ +OO¯¤Y+' OO+AA<OB
IO<YY+B<B÷B<+××× YO+'<Y
Creating Data Model
´BY+<AA++Y<OBl O4 I<BBB+¤OB+OI +O+¤Y+¤ ¯4BY<OB+·O4+Ol +¤Y¤¯O++B First, you will create two queries. Then you will create
a break group for the first query. Finally, you will link the two queries.
1. In the Data Model view, click the SQL icon (on the left) then click anywhere inside the data model screen. You will get SQL
Query Statement screen as show below. Write a query or build it by the query builder or import an SQL query from an existing
SQL file.
2. You will get the a drawing representing the query as in the next screen
/ *OI O+O+¤YY++ A¤¯+ AY+OA¤+¤<BYOO4<B+¤BOY++OO4+Ol¬¤×+ A4O+ YO+¤++ .¬ ·+¬ O+B¤Y<OBO+YI++B
Y++ YIO Y¤OB+A<BY++ YIO O4+O<+A
v ¬+B++YY++ B<B×YOOBA+YIO O++OB¤OO<B++<O+B+A·÷B<+×OB OB+ O+ Y++ +<+B+A<BY++ O+B¤Y<OB¤B+ +O¤+ YOY++
OY++O+<+B+<BO+ Y++ O+B¤Y<OB<BY++ OY++OY¤OB+*O4 I<BB++YY++ +OBBOI<B+ A+O++B
× ÷O+¤Y+ ¤ OO+¤× +OO4O Ol +O¤++<B+ ¤ +<+B+O+YI++B Y++ O4+Ol B¤¯+ ¤B+ Y++ +<+B+B<AY¤AA+OIB O+BOI
6. ++B+O¤Y+¤ +++¤4BYB¤lO4YOl O4BB<B+ Y++ O+OOOYI<t¤O+ +OO¯ Y++ ¬OOBA¯+B4*O4 I<BB++YY++ +<OAYY¤O
O+ Y++ I<t¤O+ +¬YlB+·
*OY<++Y+¤YY+<AA+B++Y<OB<AO+B¤Y++ YOY++ I ¤l l O4 I<BBOO+¤B<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OBO+×Y++ I¤l l O4 I¤BY <Y

If the Welcome dialog box does not appear, choose File->New->Report. Click Use the Report Wizard and click OK.

2.

You will receive the following screen unless you selected not to display it in the future previously. Click next

After you select the type you want click next . you can see the different layouts by clicking their corresponding buttons and looking at the sample layout on the left. Select Report type.3. this will affect report layout.

4.You can create that query by one of three methods: (1) writing a SELECT statement (2) Building the query using the Query By Example (QBE) interface. If you are not connected. The data presented in the report is the result of a query. . you need to connect as shown in the following screen. (3) importing the query.

Select the fields you would like to display in the report in the order you want as shown in the next screen. Then click next .5.

Apply aggregate functions to the fields if you want by selecting the field then the aggregate function. Then click next .6.

7. Change Field names and their width as shown in the next screen then click next .

Select a template then click next .8.

.9. On the last page of the Report Wizard. click Finish.

10. . A report is created and appears in the Live Previewer.

You will work in each of the following Report Editor views as you create the sample reports in this tutorial: • Live Previewer . Using the View menu or the toolbar. you can switch to other report views to Report Editor In the Report Editor. you can edit the report as desired. From the Live Previewer.11. You can switch between these views using the View menu or the toolbar icons. Note that the Live Previewer is one of several report views that are available in the Report Editor. you can view information about a report in four different ways.

Data Model view This view displays your report data as data model objects so that you can see the relationships between queries. select View menu then select Data Model. If you are using existing data. columns. select View menu then select parameter form. Report Builder will select all the rows in that column to indicate that changes will apply to all the rows. To display your report in the Live Previewer. repeating frames. fields. or you can create your own from scratch. To display the Parameter Form view. When a user runs your report. anchors. the user may accepts the defaults. Parameter Form view This view lets you create a Runtime Parameter Form for your report. boilerplates. select View menu then Live Previewer. Report Builder displays a default Parameter Form at runtime. Otherwise. If you do not define a Runtime Parameter Form in the Parameter Form view. and graphics in this view in order to change the appearance of the report. groups. You can select multiple columns and items by holding shift and clicking on those columns or report items. Layout Model view This view displays the attributes of your report as objects so that you can see the attribute types and relationships. the user enters values for parameters in this form to determine how the report will execute. To display your report in the Data Model view. parameters. select View menu then select Layout Model. Modifying Report Format To apply changes to any column. click anywhere in that column. You can select which system and user parameters to use for your form using the Parameter Form Builder. and links. You can edit layout objects. To display your report in the Layout Model view.• • • Data Model view Layout Model view Parameter Form view Live Previewer This view displays your report as the end user will see it. the Live Previewer will update the report as data changes. . such as frames. Any modifications that you make to the report in the Live Previewer are reflected immediately.

percentage sign.After selecting the items you want to modify. Conditional Formatting . As seen in the toolbar you can change font face. increase number zeros on the right to the decimal point. full justified). etc. centered. right justified. font size. For Monetary data items. toggle between bold/unbold. etc. You can also change data alignment (left justified. apply the required changes by selecting the appropriate icons from the formatting toolbar. yo can add dollar sign.

select Conditional Formatting as show in next screen. 2. Under the general layout section. If you are familiar with Excel. you can make a field’s value Red when it exceeds a specified maximum value). you will get the conditional formatting dialog box. However. (For example. The Conditional Formatting dialog box alone may satisfy your requirements for creating a formatting exception without the need to edit the corresponding trigger. To apply conditional formatting to an item: 1. Or right click that data item and select property palate. then select property palate from Tools menu. . select that item. you should not go back and use the Conditional Formatting dialog box to make more modifications. once you directly edit a Format Trigger for an object.The Conditional Formatting is a great way to apply formatting exceptions to your layout objects. there is a similar feature there.

The AND/OR will be enabled (on the right). .3. You can have a complex condition (multiple conditions connected by AND or OR) by clicking radio button in the next line. Click New Apply a condition by selecting an operator such as Less than or Between then put the values for the condition. 4.

etc.5. fill color. color. You can also select to hide the data item. Then Apply the format you want when that condition is met by changing the font face. "  g d s ƒ tx bqhbp tp ƒ tx ft a`bp wt wgd 0tschw hts`q3tÌr`ww hsf ch`qtf at ‚ hwg wgd 3tÌr`w d ‚ ËÌdvvhts Ìhwwds hs0qhbp Bp wt d ‚hw .

Finally. you will link the two queries.Creating Data Model 6s wghvvdbwhts ƒ tx hqqqd`Ìs gt  bÌd`wd ` rxqwhË uxd̃ c`w` rt cdq qd First. . 1. You will get SQL Query Statement screen as show below. you will create two queries. click the SQL icon (on the left) then click anywhere inside the data model screen. Then you will create a break group for the first query. In the Data Model view. Write a query or build it by the query builder or import an SQL query from an existing SQL file.

2. You will get the a drawing representing the query as in the next screen .

 At  ÌdËd`w wgd v`rd vwdËv `f`hs wt axhqc `stwgdÌ uxd̃ @`pd vxÌd wt g`yd C8 38 Ìdq`w hts adwdds wgd wt w`aqdvhs wgd wt uxdÌhdv  .

 Fdqdbwwgd qhsp wttqvvwt tydÌq`ËËhsf bhÌbqdvu 0qhbp ts tsd te wgd ehdqcvhs wgd Ìdq`w  hts `sc cÌ`f wt wgd twgdÌ ehdqc hs te wgd Ìdq`w hts hs wgd twgdÌ w`aqd Rtx hqqfdw wgd etq  qthsf vbÌdds .

! 0Ìd`wd ` aÌd`p fÌtxË a ƒ cÌ`ffhsf ` ehdqc adwdds wgd uxd̃ s`rd `sc wgd ehdqc q v `v vgt s adqt h w .

6. fdsdÌ`wd ` cde`xqwq`ƒtxw a ƒ Ìxsshsf wgd ÌdËtÌw h „`Ìc eÌtr wgd Gttqv rdsx Rtx hqqfdw wgd ehÌv w`a w te wgd h„`Ìc vFwƒqdu Atwhbd wg`wwghvvdqdbw hts hvÌdq`wdc wt wgd  ` ƒ ƒ tx hqqtÌf`sh„d wgd cheedÌdswË`Ìwvte wgd ÌdËtÌw w wghvËthswƒ tx  g`yd wt w`aqdv`sc ` aÌd`phsf fÌtxËAtwhbd wg`wwgdƒ g`yd sd  s`rdv vhs wgd vbÌdds `atydu3tÌ d ‚ ` r Ëqd d rËqt ƒdd hvst  4X3A@2 Fdqdbw4ÌtxË atyd .

# 6s wgd fÌtxË Ë`fd vdqdbw4X `sc bqhbp `bÌtvvvdqdbw4X1A @ 2 `sc bqhbp bÌtvvwgds vdqdbw4X3s`rd `sc bqhbp 1t  s Ggdvd axwwtsvvbÌtvv1t  s dwbu hschb`wd gt  wgd ÌdËtÌwhqqad eh qdc xË 3tÌ d ‚ ` r Ëqd q bÌtvv rd`sv eh q q gtÌh„tsw`q ct  s rd`sv ydÌwhb` qƒ bÌtvv qƒ q 1ts rd`sv gtÌh„tsw`qwgds ydÌwhb` q .

 Fdqdbwwgd ehdqc ƒ tx  `sw wt chvËq`ƒ Rtx r` ƒ stw sddc `qqehdqc hevtrd ehdqcv`Ìd ÌdËd`wdc vxbg `v 1A B `sc FHC2EFFA .

$ Fdqdbw` 9`adq `sc ehdqc hcwg etÌ dyd̃ ehdqc  .

% Fdqdbw` GdrËq`wdRtx r` ƒ stw fdw wgd d ‚ `bw q v te wdrËq`wdv`sc gdsbd stw wgd v`rd  ` ƒ h w qtbpv Ggds bqhbp 3hshvg   wgd ÌdËtÌw .

 Rtx vgtxqc fdw vtrdwghsf vhrhq`Ìwt wghv Atwhbd wg`wdyd̃ cdË`Ìwrdsw vgt v hs ` vdË`Ì`wd Ë`fd Rtx  b`s vdd twgdÌ Ë`fdv a ƒ bqhbphsf wgd `ÌÌt hs wgd wttqa`ÌtÌ bg`sfhsf wgd Ë`fd sxradÌ hs wgd wttqa`Ì `qvt  .

 At  ƒ tx b`s bg`sfd etÌr`ww hsf wt qtbp wgd  ` ƒ ƒ tx  ` sw hw  .