Previous | Table of Contents | Next

Page 430

attribute to 14 points. Finally, the third line calls the set_attr function, which modifies the field's attributes by passing two arguments:

The function returns a Boolean value. If it is true, the field is displayed on the report with whatever attributes were modified by the format trigger; if it's false, the field is not displayed on the report.

Creating a Shortcut to Run a Report

A shortcut can be a real convenience for a user who wants to be able to run a report with a single mouse click. This section takes you through the steps of creating a shortcut. Before you create the shortcut, you will need to generate the REP file from the RDF file as previously described.

To create the shortcut, follow these steps:

  1. Right-click New | Shortcut on the Windows 95 desktop.
  2. You need to enter the command-line arguments for the shortcut in the Create Shortcut window, but before you do, you need to look over a few arguments used by Reports Runtime:
  3. To run the Department Instructors report at runtime, enter the following line in the Command Line field:
    c:\Orawin95\bin\r25run32 report=c:\Tyo\Dept_Instructor paramform=no
    Âdestype=screen
    
  4. Click Next.
  5. Give the shortcut a name like Report - Department with Instructors.
  6. Click Finish.

You should see the new shortcut on your desktop. Try running the shortcut. You will be prompted for your username, password, and database. If you don't want the user to be prompted for these values, modify the shortcut in the following way:

c:\Orawin95\bin\r25run32 userid=flugle/flugle
Âreport=c:\Tyo\Dept_Instructor paramform=no destype=screen

Page 431

NOTE
One disadvantage to this shortcut is that the password is contained within the shortcut and could be viewed by others.

Invoking a Report from an Oracle Form

As discussed, Developer/2000 is an integrated application development environment. In this section, you'll learn how to run a report from a forms application. As an example, you'll see how modify your menu, MAINMENU, to run the Course Catalog report.

To begin, use the Forms Designer to open MAINMENU. Use the Object Navigator to look at the Course_Catalog_Report item; it's located in the REPORTS menu. Display the Properties window for Course_Catalog_Report as shown in Figure 15.26.

Figure 15.26.
Properties of
Course_Catalog_Report
menu item.

Next, navigate to the Command Text property and click More at the top of the window. A PL/SQL Editor window is displayed. As shown in Figure 15.31, use the Run_Product
built-in procedure to invoke Oracle reports. The Run_Product procedure requires seven arguments:

Page 432

Once you've entered the line shown in Figure 15.27, click Compile and Close. Save and generate the menu and test it to verify that it works correctly.

Figure 15.27.
Using Run_Product
to invoke another
Developer/2000
program froma
menu item.

Summary

Here are the important points covered in this lesson:

Page 433

What Comes Next?

On Day 16, "Developer/2000: Using Oracle Graphics and Procedure Builder," you will learn about the two other components of Developer/2000: Oracle Graphics and Procedure Builder. You'll learn how to create a chart from the contents of a table. You'll also see how Procedure Builder can help you create and maintain PL/SQL modules in an Oracle database.

Q&A

Q Is it possible to record the execution of a report?

A Yes. Although it wasn't discussed in this lesson, you can define a report trigger that's executed once when the report is run. The report trigger could insert a row into a table that recorded the name of the report, who requested it, and when it was executed. You also could save other details about the report.

Q Can you prevent a user from printing a report after hours?

A Yes. Again, you can create a report trigger that looks at the day of the week or time of day and determines if the report should be printed at that time.

Q Is it feasible for more than one user to execute the same report at the same time?

A Yes. Unless the report has triggers that modify the data in some unusual way, multiple users can run the same report simultaneously without any adverse
outcome.

Previous | Table of Contents | Next

Используются технологии uCoz