Presentation is loading. Please wait.

Presentation is loading. Please wait.

CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.

Similar presentations


Presentation on theme: "CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary."— Presentation transcript:

1 CHAPTER 7 LESSON C Creating Database Reports

2 Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary columns  Create formula columns  Create reports that display formatted data in a Web browser window 2

3 Displaying Image Data in Reports  Data that is stored in LOB (Large Object) columns in the database (such as images) can be displayed in a report 3

4 Loading the Image Data  To create a report containing an image, it is necessary to load the image data into the database 4

5 Creating and Configuring the Report Image Layout Fields  When a report is created using the Report Wizard, every field is treated as a text field  Image data will be displayed as a text field with the text “MM” (multimedia)  The File Format property for an image field must be changed to Image using the Property Inspector 5

6 Creating Report Queries and Data Links Manually  As an alternative to the Report Wizard, queries and layouts can be created manually in Reports Builder  When creating a master-detail report, it is necessary to create both the master and detail queries manually, and then link them using a data link 6

7 Creating Queries and Data Links Manually  The SQL Query tool is used to create queries manually  When creating a data link for a master-detail report, the master side is called the parent, while the detail side is called the child  There are three types of data links: Query to Query, Group to Group, and Column to Column  Which type is used depends on the relationship between the two queries that are being linked  The Data Link tool is used to create the data link  Each query type is created slightly differently using this tool 7

8 Creating Reports That Display Calculated Values  Formula columns are used to display the result of PL/SQL functions  Summary columns are used to display the result of summary functions applied to the report data  Summary functions include SUM, AVG, MIN, and MAX. 8

9 Creating Formula Columns  A formula column displays the result of a user- defined PL/SQL function  There are three steps in creating a formula column: 1. Create the formula column in the report Data Model 2. Write the user-defined function that returns the calculated value for the formula column 3. Create a layout field in the report to display the formula column value 9

10 Creating a Formula Column in the Report Data Model  The Formula Column tool is used to create a formula column  It must be placed in the same record group as the columns that are used in the calculation performed by the formula 10

11 Creating the Formula Column Function  Within the function, columns are referenced using the syntax :column_name  Only columns in the same record group as the formula column can be referenced  The return command is used to return the result of the formula calculation  The PL/SQL Editor is used to enter the function 11

12 Creating a Layout Field to Display the Formula Column  The Paper Layout window is used to create a field that displays a formula column  The field’s Source property references the formula column  The field must be placed in the same repeating frame as the fields that are used in the formula column’s function 12

13 Creating Summary Columns  Summary columns can be created using the Report Wizard or manually  A summary column displays summary data for a series of data fields 13

14 Creating a Summary Column Using the Report Wizard  The Totals page of the Report Wizard is used to create summary columns  On this page, both the summary function and the data to be summarized are selected  The Report Wizard creates a summary column for each record group and for the entire report 14

15 Creating a Summary Column Manually  Since the Report Wizard eliminates formatting changes, it is often necessary to create a summary column manually  The steps involved in creating the column manually are:  Create the summary column in the report Data Model, and modify the summary column properties  Create a layout field to display the summary column on the report 15

16  The Summary Column tool is used to create a summary column manually  The summary column must be placed in the record group that contains the data series.  It is common practice to prefix the name of the summary column with CS_  Once the column is created, the Property Inspector is used to set the name, summary function, and column to be summed Creating a Summary Column Manually 16

17  The Paper Layout window is used to add a manually created summary column to a report layout  The summary column must be placed in the repeating frame that contains the data to be summarized Creating a Summary Column Manually 17

18 Displaying Formatted Reports as Web Pages  When a report is viewed as a Web page by either pressing the Run Web Layout button or previewing in the Paginated HTML or Paginated HTMLCSS format, the data displayed in the report is retrieved from the database and saved in the report  It is static data, meaning it will not change even if the underlying database data changes  These formats are intended for distributing static reports to users 18

19  In Web-based applications, it is preferable to allow users to generate their own reports using current database data Displaying Formatted Reports as Web Pages 19

20 Using the Oracle 10g Application Server to Generate Reports Dynamically  The Oracle 10g Application Server (OAS) delivers Oracle 10g database data to users via the Web  It can be used to generate dynamic reports using the Report Server process 20

21 Creating Reports That Appear as Dynamic Web Pages  Reports that will be displayed using OAS are created like any other report in this chapter, then saved in either a report definition file (RDF) or a Java Server Page (JSP) format  The choice of format depends on how the Web administrator configures OAS  As when clicking the Run Web Layout button, a report that is simply saved in either of the two formats discussed above is displayed without any formatting changes 21

22  In order to include custom formatting, either the report must be modified using the Web Source window to modify the formatting, or an HTML file containing formatting in Reports Builder must be opened to add commands to retrieve data Creating Reports That Appear as Dynamic Web Pages 22

23 Viewing the Report Web Source File  When a report is saved in RDF or JSP format, a Web source file is created containing the HTML code for the report  Within the report are embedded tags that control the retrieval of report data  These tags start with the prefix rw:—  for example,. 23

24 Viewing the Report Web Source File  The Web Source window is used to view RDF and JSP files  The Java commands within the Web source file appear between the delimiters. Within the file, the data area contains the commands that retrieve and display the report data 24

25 Modifying the Default Appearance of a Web Report  There are two techniques for modifying the appearance of a Web report  The first is to use the Web Source window to change the formatting  The second is to use Reports Builder to add commands to retrieve the report data into an HTML document that already contains the formatting for the report 25

26  Report data can be added to an existing HTML document in three steps: 1. Open the HTML document in Reports Builder 2. Open the Data Model window and manually create a record group that contains the data that the report is to display 3. Use the Report Block Wizard to create the data area in the Web page by inserting a report block in the document  A report block is a series of Java commands that retrieve and format data values in one of the report styles that can appear in a browser window. Modifying the Default Appearance of a Web Report 26

27 Report Block Wizard Pages  The Report Block Wizard is used to incorporate the query into the HTML page. The wizard contains pages:  Style page Allows you to specify the title that appears on the report and select the report style  Groups page Allows you to select the record group that appears in the report and specify if the records repeat across the report horizontally, or down the report virtically 27

28 Report Block Wizard Pages  Fields page Allows you to select the query fields that appear in the report  Labels page Allows you to specify the report field labels and widths  Template page Allows you to select a report template 28


Download ppt "CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary."

Similar presentations


Ads by Google