59
Automated Scheduling and Automated Scheduling and E-mailing from within E-mailing from within Discoverer Discoverer - and more… - and more… ODTUG 2007 ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Embed Size (px)

Citation preview

Page 1: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Automated Scheduling andAutomated Scheduling andE-mailing from within DiscovererE-mailing from within Discoverer

- and more… - and more… ODTUG 2007ODTUG 2007

Michael Armstrong-Smith

Armstrong-Smith Consulting

Page 2: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Art of managing Discoverer

Data is limited – imagination knows no bounds

Managing Discoverer is an art – not a science

Please turn cell phones to mute

If you must make or take a call, please step outside

Page 3: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

About Michael

Member of Oracle’s customer advisory board for business

intelligence

Co-author of Oracle Discoverer Handbook

Presenter at IOUG, OAUG, ODTUG and Sungard Summit

Fellow of Institute of Analysts and Programmers

MetaLink and OTN Forum panel expert

9 years experience of Discoverer and Oracle Applications

Over 25 years IT experience

Designated an Oracle ACE in 2006

Page 4: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Oracle Discoverer 10g Handbook

Released 2006

Available on Amazon.com

Page 5: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

About Armstrong-Smith Consulting

A business intelligence company founded 2003Partnerships

MicrosoftOracleSungard Higher Education

Market segments, among:Advertising, Government, Heath Care, Manufacturing, Oil Exploration, Higher Education, Pharmaceuticals, Utilities

Page 6: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Our Services

ASC offers services in the following:

Business Intelligence Strategic Planning

Corporate ReportingDashboard creation using Oracle Portal

Data Warehousing using OWBAnalysis and Design

Construction

Planning

Oracle E-Business Suite trainingAll modules

Page 7: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Our Discoverer Services

ASC offers the following Discoverer services:

Customized and standard Discoverer trainingStandard Training

– End User – 3 days,

– Admin – 2 days

Customized Training – we train on your data

ConsultancyInstallation; EUL creation; report creation; system evaluation; security setup

Remote supportLet us manage your Discoverer environment for you

Page 8: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Session Objectives

This session covers: The limitations to scheduling

The four steps to automation

Setting up the scheduling

Bonus Discoverer snippet

Q&A – 10 minutes at the end

Page 9: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

The limitations to scheduling

Page 10: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Limitations of Discoverer Scheduler

No export feature within the scheduler

No E-Mail feature within the scheduler

Discoverer Desktop does not have an export to PDF

Oracle is reviewing Discoverer’s scheduling functionality.

Page 11: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

The four steps to automation

Page 12: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Four steps to automation

1. Schedule using Discoverer Desktop’s command line interface

2. Use a third-party scheduler tool

3. Use a third-party PDF tool

4. Use a third-party E-mail tool

Page 13: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using Desktop’s

command line

Page 14: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using Desktop’s command line

One of the less-known capabilities of Desktop is the ability to execute many of its functions direct from the command line

Without opening Desktop, using the command line, you can

Run queriesAutomate printingExport the results

Page 15: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Workflow to run Discoverer from the command line

1. From the Windows Start button, select Run

2. Click the Browse button

3. Locate the Discoverer end-user run-time program, dis51usr.exe

4. Add the options you wish to pass to Discoverer

5. Click the OK button

Page 16: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Optional command-line parameters

You can increase the efficiency of the command line by passing additional parameters and switches

Each option begins with a forward slash character (/) and is preceded by and followed by a space character

Page 17: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some command-line options 1

/connect userid/password@database – this is where you pass your login information to Discoverer

E.g. /connect michael/happy@laptop

/batch – this causes Discoverer to run in batch mode. This mode does not wait for user interaction and will process one workbook after another, even if an earlier one fails

Page 18: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some command-line options 2

/eul <eul-name> - this allows you to specify the EUL against which you will be running. If omitted, Discoverer will connect you to your default EUL

/opendb <db-workbook> – this opens a named workbook from the database

/pt <printer-name> - this sends the output to the named printer

Page 19: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some command-line options 3

/sheet ALL –Discoverer will open and run all worksheets in the workbook

/sheet <sheet-name> - Discoverer will open and run the worksheet specified by name

/sheet <sheet-number> - Discoverer will open and run the worksheet by the worksheet number

Page 20: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some command-line options 4

/export <format> <export-file-name> - this exports the results of executing a worksheet to the file named, in the format specified

Note: Discoverer Desktop does not recognize all of the formats that Plus does. It only recognizes the following : no PDF

CSV, DIF, FIXED, HTML, RDF, SQL, SYLK, TEXT, XLS

Page 21: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some command-line options 5

/apps_user – this tells Discoverer to login as an E-Business Suite user

/apps_responsibility <resp-name> – this tells Discoverer to connect using the responsibility provided – if the name includes one or more spaces enclose the whole name in double quotes

Page 22: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some command-line options 5

/pt <file> <printer> <driver> <port> - send the Discoverer report to the specified printer

E.g. /pt "c:\My Airline" Amyuni "Amyuni Document Converter 2.51" PDFCreator:

Note the double quotes around the file name and the printer driver name

Page 23: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Example command line

c:\oracle\BIToolsHome_1\bin\dis51usr.exe /connect scott/tiger@home /opendb “bob’s report” /sheet detail /parameter customer “ASC Consulting” /batch /export HTML c:\export\bob

This logs in scott, using the password tiger, into the database called home. It then opens the database workbook called bob’s report and executes the worksheet called detail passing the value ASC Consulting to the parameter called customer. All of this is done in batch mode with the final report being exported in HTML format as bob to c:\export

Page 24: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using a third-party scheduler

Page 25: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Third-party scheduling

Many third-party schedulers on the market

Winat – The Windows NT scheduler

AT – The Windows XP scheduler

JIT – a freeware utility

Norton Program Scheduler – the Norton Utilites scheduler

Page 26: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using AT

Using XP’s native scheduler, you can:

Schedule a new task in XP

Set scheduling properties

Modify a scheduled task

Remove a scheduled task

Pause and restart scheduled tasks

Page 27: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Workflow to use AT - 1

1. Click the Windows Start button

2. Navigate to: Programs | Accessories | System Tools | Scheduled Tasks

3. Double-click Add Scheduled Task, then click the Next button to display the file selection screen

Note: do not schedule Discoverer directly because all thatwill happen is that Desktop will launch

Page 28: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Workflow to use AT - 2

4. Click the Browse button and navigate to a batch file you have created to execute Discoverer via the command line

5. Highlight the file you want then click Open

6. In the Frequency window, give the task a suitable name, select a frequency for how often the task should run, then click the Next button

Page 29: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Workflow to use AT - 3

7. Set the date and time for the schedule – it will default to now, then click the Next button

8. Enter the username and password for the user who should run this, then click the Next button

9. When done, click the Finish button

Page 30: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using a third-party

PDF tool

Page 31: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Third-party PDF creation

Why use a third-party PDF creation tool?

Because Discoverer Desktop cannot export to PDF directly

However, if you have a third-party PDF creation tool you can print to it

Page 32: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some third-party PDF creation tools

Amyuni PDF Converter – http://amyuni.comFrom $99

DeskPDF – http://docudesk.comFrom $19.95

PDFCreator – http://pdfcreator.comFrom $57.95

Page 33: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

How they work

They all work the same way

They install as printers on your machine

You just send your file to the PDF printer

If you have more than one PDF creator installed they will all use the same printer port

Page 34: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Working with Amyuni

Page 35: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Putting it together – use a batch file!

@Echo off@Echo Creating Discoverer report 1

CALL c:\oracle\BIToolsHome_1\bin\dis51usr.exe/CONNECT drake/drake@laptop /PT "c:\My Airline" Amyuni "Amyuni Document

Converter 2.51" PDFCreator: /SHEET "Sheet 1" /PARAMETER AirlineMax 15 /BATCHEXIT

Page 36: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using a third-party

E-mail tool

Page 37: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Some third-party E-mail tools

Febooti – http://febooti.com

From $44.95

Softabar Command Line Email Client - http://softabar.com

From $59.95

Page 38: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Using Febooti – some features

Send email from command line to any number of recipients. Send email from Scheduled Tasks, any software that execute external commands, CGI scripts (ASP, PHP, etc.). Use SMTP mail server authentication (AUTH PLAIN, LOGIN, NTLM, CRAM-MD5, AUTO) before sending email. Send email using CC (Carbon Copy) and / or BCC (Blind Carbon Copy). Send email with unlimited attachments. Send email message using plain text or HTML message with embedded pictures. Set alternate text for email programs that do not support HTML formatted messages

Page 39: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Febooti scripting examples - 1

Febootimail-FROM [email protected] [email protected] "First message"

Febootimail -TO -USEFILE c:\files\recipients.txt -BODY -USEFILE c:\files\msgBody.txt

Note: The examples above require SMTP server running on localhost (127.0.0.1). Otherwise, the SMTP server address or name must be specified and authentication credentials provided, if necessary

Page 40: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Febooti scripting examples - 2

Febootimail-FROM [email protected] [email protected], [email protected] “Second message“-SUBJ "Test msg“-SERVER smtp.sender.com

Note: The above commands have been split to multiple lines for purpose of demonstrating how the Command line email program is provided with switches from the command prompt. Execution of the program requires all switches to be passed in a single line.

Page 41: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Setting up the

scheduling

Page 42: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Combining Amyuni and Febooti

call c:\oracle\BIToolsHome_1\bin\dis51usr.exe /connect drake/drake@laptop /PT "c:\My Airline" Amyuni "Amyuni Document Converter 2.51" PDFCreator: /SHEET "Sheet 1" /parameter AirlineMax 15 /BATCH

call febootimail -FROM [email protected] -TO [email protected] -SMTP smtp.myserver.com -USER michael -PASS pword -ATTACH "c:\pdfcreator\My Airline.pdf"

Page 43: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Set up and run

Email arrives in Outlook

Page 44: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

A Bonus Discoverer Feature

Page 45: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Creating indexed items

Question: Is it possible to make Discoverer lists of values display the lookup description e.g. a Department Name, but then return the code, namely, Department Id, when working with parameters for example?

Answer: Yes – read on

Page 46: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Requirements

In order to make this happen we need to have the following:

A table that has an item and a code, making sure that there is a one-to-one relationship between the item and the code

Make sure that there are indexes on both items

Note: this is perfect for dimension tables in a datawarehouse that contains unique codes and

items.

Page 47: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Set up scripts - 1

CREATE TABLE TST_TABLE AS (SELECT 1 PERSON_ID,Trunc(SYSDATE) ACTIVE_DATE,TO_CHAR(TRUNC(SYSDATE), 'DD-MON-YYYY') CHAR_DATE,999999999 SSN,'Smith, Michael' FULL_NAMEFROM DUAL);

Page 48: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Set up scripts - 2

INSERT INTO TST_TABLE VALUES (2, TRUNC(SYSDATE),TO_CHAR(TRUNC(SYSDATE),'DD-MON-YYYY'), 999999999,'Jones, Edward');

INSERT INTO TST_TABLE VALUES (3, TRUNC(SYSDATE),TO_CHAR(TRUNC(SYSDATE),'DD-MON-YYYY'),99999999,'Evans, Bob');

Page 49: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Set up scripts - 3

COMMIT;

GRANT SELECT ON TST_TABLE TO PUBLIC;

CREATE INDEX TST_TABLE_UK1 ONTST_TABLE (PERSON_ID);

CREATE INDEX TST_TABLE_UK2 ONTST_TABLE (FULL_NAME);

Page 50: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Discoverer Admin steps - 1

1. Import the table as a new folder from the database.

2. Go to the Full Name and create a standard list of values on it.

3. Right-click on Full Name and from the pop-up list select Properties.

4. Scroll to the bottom of the list to the property called Indexed Item.

Page 51: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Discoverer Admin steps - 2

5. Clicking this brings up a small dialog box in which you should pick the indexed item called PERSON_ID.

Note: Indexed Item only becomes accessible when there is

a) a list of values on the item,

b) that there is another item in the same underlying table that is also indexed, and

c) that there is a one to one relationship between the two items.

Page 52: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Discoverer Admin steps - 3

6. Click the OK button – Discoverer will give you this message

7. Click OK again – you are finished with Admin

Page 53: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Working in Plus - 1

1. Create a new worksheet that includes the original item, FULL NAME

2. Create a new condition for the item, using a parameter for the operand

3. On the right-hand side of the New Parameter dialog box, as shown on the next screen, is a checkbox called

Enable users to select either indexes orvalues – check it

Page 54: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Working in Plus - 2Check this box

Page 55: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Working in Plus - 3

Page 56: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Working in Plus - 3

List of values looks like this

Parameter entries look like this

or

Page 57: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Q & A

Page 58: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Thank You

Please remember to complete your evaluation form

Presenter - Michael Armstrong-Smith

Session name – Automated Scheduling andE-mailing from Within Discoverer

For more information about security or to get help about Discoverer please contact Michael

[email protected]

Page 59: Automated Scheduling and E-mailing from within Discoverer - and more… ODTUG 2007 Michael Armstrong-Smith Armstrong-Smith Consulting

Copyright

The content provided as papers and presentations from the ODTUG conferences is copyrighted by the authors, and has been licensed to the ODTUG. It is only authorized for the personal use of ODTUG members and ODTUG conference attendees directly through the ODTUG web site.

Downloading the files, placing them on other web sites, sharing them with other individuals or third parties is prohibited, unless permission to do so has been granted by the authors or ODTUG.