more about reports: part 2 aisha alarfaj 1. introduction a report is a summary view of database data...

39
More about Reports: part 2 Aisha AlArfaj 1

Upload: jemima-rich

Post on 25-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

More about Reports: part 2Aisha AlArfaj

1

Page 2: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Introduction•A report is a summary view of database data

that users can view on a screen display or print on paper.

•Reports retrieve database data using SQL queries, perform mathematical or summary calculations on the data, and format the output to create documents such as tabular reports, invoices, or form letters.   

2

Page 3: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views

•The purpose of this section is to take a closer look at the three different views and how they can be used to help with report creation.

•The three views are paper design Data Model Layout Model

3

Page 4: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Paper design•The paper design view should be most

familiar to you. • It is used to preview how the final report will

look, and it contains tools to help you manipulate the look of the report using real data.

•Although the paper design does a good job of showing what the finished report will look like.

•The paper design, shown in Figure 9.15, contains a grid and tools useful to creating and modifying the layout.

4

Page 5: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

FIGURE 9.15The finished Matrix with Group report.

5

Page 6: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views•You have already had experience moving and

resizing data and fields in paper design mode.

•You can also change the colour of text. Select the field heading Sales Representative. Then click on the lowest colour palette in the

vertical tool palette on the left. This allows you to change the text colour and

make the field heading to stand out from the actual data.

•You can also use the tool palette on the left to add graphical elements to your report.

6

Page 7: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

FIGURE 9.17The tool palette with short descriptions of each tool.

7

Page 8: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•As you look through the various views, you will notice that the vertical tool palette on the left adjusts to the environment.

•Even though a tool will be available in one view, it will not be available in another.

•Therefore, it is important to pay close attention to the view you are using and what it is capable of doing.

8

Page 9: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Data Model•The Data Model

view is the least-used report view for simple reports like the ones used as examples.

is a work area to define the data used in your report.

The view really becomes useful when you’re trying to understand how a bunch of tables and columns have been combined to create a report.

•Figure 9.18 shows an example of a Matrix with Group report in the Data Model view.

9

Page 10: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

FIGURE 9.18The Data Model view of the Matrix with Group report.

10

Page 11: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Data Model•Notice how both the toolbar and the tool

palette have adjusted for the environment. •Most of the buttons on the toolbar should

be familiar to you. •As Figure 9.18 points out, however, the

Data Wizard tool has been added. •Most of the screens in the Data Wizard

tool are derived from the Report Wizard and should look very familiar.

•You can use the Data Wizard to help create queries for your report.

11

Page 12: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Data Model•The tool palette, as shown in Figure 9.19,

should look completely different from any other in Report Builder.

FIGURE 9.19The tool palette with short descriptions for the Data Model view.

select

Placeholder Column Ref

cursor query

JDBC query OLAP

query

Summary column

Formula column

magnify

SQL query

Data linkCross

product

XML query

Text queryExpress server query

12

Page 13: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Data Model• Select—This is the default tool. Use it to select

various objects on the report. You can then move, resize, or delete the object.

• Magnify—Similar to the Zoom In and Zoom Out buttons on the toolbar, except that you can specify the center of the zoom area. To zoom out, hold the Shift key and click on the canvas.

• SQL Query—Invokes the screen from the Report Wizard that is used to enter a query for the report. Multiple queries can be used in the same report.

• Ref Cursor Query—Invokes the Procedure Builder with the stubs to build a ref cursor query.

13

Page 14: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

• Data Link—Enables you to create relationships between two queries. The relationship can take the form of a query to query, group to group, or column to column link.

• Summary Column—Creates a summary column in the Data Model view.

• Formula Column—Creates a formula column in the Data Model view.

• Placeholder Column—Creates a placeholder column in the Data Model view.

• Cross Product—Enables you to create a cross product (one of each combination) of two groups.

14

Page 15: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Data Model

•When creating a report without using the Report Wizard, you would first go into the Data Model view and define the query and information to be used.

15

Page 16: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Layout Model

•The Layout Model view has been used in some of the previous examples to adjust the layout of a report.

•A report is made up of three parts: the header the main the trailer.

•The Layout Model view allows you to edit all three parts, as well as modify margins.

16

Page 17: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Layout Model

•You have been exposed to editing the body of a report using only the Layout Model view.

•Figure 9.20 shows the Layout Model view. •Notice the buttons that appear on the

toolbar that are not present in the paper design view.

17

Page 18: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

FIGURE 9.20The Layout Model view.

18

Page 19: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Layout Model•Header—Edits the header section of the

report.•Main—Edits the main or body section of the

report. This is the default setting.•Trailer—Edits the trailer section of the

report.•Edit Margins—Allows you to change the

margins for the report. Using the File, Page Setup menu choice will adjust the margins for the printed page, but might truncate the report.

19

Page 20: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Layout ModelSome additions to the tool palette don’t appear in the Live Previewer view. They include the following:•Frame Select—Allows you to select a frame or repeating frame along with all the objects inside.•Rotate—Rotates a selected object. This is especially useful if you want the text to be vertical rather than horizontal. There are several restrictions on rotated text, but the most important is that it is not supported on all operating systems nor all report objects. If you are having trouble rotating text, use the online help to see whether it is valid for a given object.•Reshape—Reshapes a selected object. This is mostly used with drawn objects such as lines, rectangles, arcs, and polygons.•Polygon—Places a polygon on the boilerplate of the report. Remember to double-click the final point to end the polygon.

20

Page 21: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Layout Model• Frame—Places a frame in the report. Most

often used when creating a report without the help of the Report Wizard.

• Repeating Frame—Places a repeating frame in the report. Most often used when creating a report without the help of the Report Wizard.

• Chart—Places a chart object in the report.• Anchor—Enables you to anchor two objects

together.• Polyline—Places a polyline on the report.

Remember to double-click the final point to end the polyline.

• Freehand—Places a freehand-drawn object on the boilerplate of the form.

21

Page 22: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report Views: Layout Model

•The primary use of the Layout Model view is to fine-tune the layout of your reports. to create additional templates.

•Even though Report Builder ships with several report templates, you will likely create additional templates specifically designed for your needs.

22

Page 23: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Creating and Modifying Report Templates• The report templates included with Oracle

Reports do a good job of showing you what is possible with Report Builder, but they will need to be modified to be useful for you and your company.

• The templates using the Oracle buildings on the report show that complex graphics can be added to reports.

• However, the graphic will need to be changed to incorporate your company logo or desired graphic.

23

Page 24: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report parameters•A report parameter specifies how a report

appears, or specifies the report's behavior when it runs.

•Reports have two types of parameters: ▫system parameters▫user parameters.  

•System parameters specify properties that control how the report appears in the user display and how the report application environment behaves.  A table of system report parameters is in slide 26.

•User parameters allow the user to select values that specify the data that the report displays.  

24

Page 25: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•Examples of system parameters include the currency symbol that appears, and whether the print dialog box opens when the user prints the report.  

•A user parameter in the Class List report would allow the user to select a specific term ID value from a list, and the report would then display class lists for that term only.

Report parameters

25

Page 26: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Report system parameter Parameter Name specifies

Background Whether the report should run in the foreground or the background of the current application

Copies The number of report copies that are made when the report is printed

Currency The symbol for the currency indicator such as “$”or “£”

Decimal The symbol for the decimal indicator , such as “.”

Desformat The output device format, which indicates whether to create PDF or HTML output when sending a report to a file

Desname The name of the output device, such as the filename, printer name, or e-mail, or printer.

Destype The type of device to which to send the report output, such as screen, email, or printer

Mode Whether the report should run in character or bitmap mode

Orientation The report print direction (landscape or portrait)

Printjop Whether the Print Job dialog box should appear before the report runs

Thousands The symbol for the thousands indicator, such as “,”

26

Page 27: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Parameter Forms• The reports used as examples in this book

return a relatively small amount of data. • In a production environment, this will rarely

be the case. • For example, sometimes you might want to

see a list of employees only in the accounting department.

• Up to this point, you would have had to create a report that shows all the employees and sorts them by department.

• Now, I’ll show you how parameter forms can be used to restrict the report query to provide only a subset of rows.

27

Page 28: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•At the beginning of the chapter, you created a report to show all the employees in the database.

•The report was called groupmatrix. •You will modify that report now to show

employees for only a given department.

Parameter Forms Con.

28

Page 29: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•Start by opening the report that shows all the employees in the database table.

•If you did not save the report, re-create it now using the Report Wizard.

•By now, you should be pretty good at using the Report Builder and it should not take too long to create a simple report.

Parameter Forms Con.

29

Page 30: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•Next, define a user parameter to serve as a placeholder for the department in which the report will be run.

•To do this, expand the Data Model branch in the Object Navigator, click on User Parameters, and then click on Create in the vertical toolbar.

•The object should have a name like P_1. •Change the object’s name t

P_Department.

Parameter Forms Con.

30

Page 31: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•Now select the Tools, Parameter Form Builder menu option and you should see a dialog similar to Figure 9.25. Scroll down to the last parameter and you will see P_Department.

•Change the label to Department, and click on the P_Department parameter name so that it is highlighted. Then click OK.

31

Page 32: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•As you scrolled through the Parameter Form Builder’s parameters, you probably noticed all the different system parameters that could be added to a parameter form.

•Normally, you will not need to add them to the form, but if you are not happy with the defaults, you can have them specified at runtime.

32

Page 33: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

FIGURE 9.25The Parameter Form Builder used to build a parameter form used by reports.

33

Page 34: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•The Report Editor Parameter Form should now be displayed.

•You can modify any of the default labels to make them more explicit if you want.

•Select the PF_P_Department field from the form and open the Property Palette.

•To make the form more usable, take advantage of the List of Values property found at the bottom.

•Double-click the property value and you can specify a list of values. Use the following SELECT statement for this example:

34

Page 35: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•Also be sure to click the Hide First Column option. Remember how the list of values works:

•The first column corresponds to the value stored in the database, and the second column refers to what is displayed.

35

Page 36: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•The final step for the parameter form is to specify the limiting criteria in the report query.

•Open the Report Wizard and click on the Data tab.

•Modify the code in the WHERE clause so that it reads

36

Page 37: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

•Then click Finish and the report will be run. The parameter form should look similar to Figure 9.26.

•Choose the department for which you would like to run the report, and click the Run Report button.

•Now, only those employees in the specified department are displayed in the report.

37

Page 38: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

FIGURE 9.26The completed parameter form used to limit the rows returned by the employee report.

38

Page 39: More about Reports: part 2 Aisha AlArfaj 1. Introduction A report is a summary view of database data that users can view on a screen display or print

Summary•You should now be very comfortable using

Report Builder. •This chapter showed you how to create a

report using each of the eight different report styles.

•Each of the three different report views was explained.

•You were shown how to modify and create templates.

•Finally, you were also shown how to create a parameter form and integrate it into your report.

39