Você está na página 1de 4

Crystal Report Training

Crystal Setup: Check ODBC connection in Start >> Control Panel >> Administrative Tools >> Data Sources (ODBC)

In the System DSN tab, make sure ORACLE DATABASE is a choice. If not, goto User DSN tab, setup ORACLE DATABASE Click ADD, Select Oracle in Orahome 9 (or your version) Driver, Put ORACLE DATABASE in Data Source Name, ORACLE DATABASE in TNS Service, And H8DBVIEWER in User ID. Click Test Connection. If all is well, hit OK

The ODBC area is also where the DB2 Drivers would be installed that several Crystal Reports use. This is something the Help Desk installs. This isnt required, but recommended to have installed for future use. Verify Crystal Database Settings (REQUIRED): Open Crystal Reports and Click on New Report. Expand the ODBC (RDO) section. If ORACLE DATABASE is not already there, click Make New Connection. Select ORACLE DATABASE from Data Source list and click Next:

Crystal Report Training - April 2011

Page 1 of 4

Right Click on ORACLE DATABASE under Available Data Sources (left image below). Click Options Make sure your screen looks like the right image below. Make sure Tables, Views, Synonyms are checked (nothing else in the Data Explorer section). The rest of the fields should match as well. Click OK.

Now click the + (plus) to expand the ORACLE DATABASE. This is a listing of all the OWNERS in ORACLE DATABASE. The Tables, Views, and Synonyms reside in each of these. Definition of Types (Any of these types can be used to create reports in Crystal) Tables: Where the actual data is stored. Views: A query from multiple tables put together and stored in Oracle. Synonyms: Link to a table or view in a different owner or even different server.

Crystal Report Training - April 2011

Page 2 of 4

Crystal Reports - Create New Report

Select ODBC >> Make New Connection >> Select ORACLE DATABASE in ODBC Box.

Make Sure Field Explorer is always shown on the Crystal screen (View >> Field Explorer)

In Design View: Crystal Report Training - April 2011 Page 3 of 4

Make a Group: From Top Report >> Group Expert. Select field to Group on. Insert Summary Field: From Top: Insert >> Summary. Select field to count/sum etc. Place summary field at the Group Level or Top/Bottom of report. Quick Formula Tips: Alternate Line Color in Detail Area: Right Click in gray Detail area on Left of report >> Section Expert >> Color Tab >> X-2 Button Paste in this Formula (after the green // items): If(RecordNumber Mod 2) = 0 then color(225,225,225) else crWhite Supress records that repeat:
previous({Command.CAT_ID_NO})={Command.CAT_ID_NO} or next({Command.CAT_ID_NO})={Command.CAT_ID_NO}

Todays Date: in Crystal is: today (Sch_strt_dt < today + 5) in SQL today is sysdate. First day of current Month: DateSerial(year(today),month(today),1) First Day year ago: DateSerial(year(today),month(today) -12,1) Last Day of Previous Month: DateSerial(year(today),month(today),-1)

Crystal Report Training - April 2011

Page 4 of 4

Você também pode gostar