Course Title

: Reports 6i
Common report styles required
in a business report
Various report destinations
Main Report executables

Main components of Report Builder
• Main objects in a report

Different methods of building the report query
• Live Pre-viewer
– viewing of a reports output format without printing
it.
– It also provides a set of tools to allow the...
• Add page number and current date to a report
– Create a report using the report wizard with no
template.
– Display the r...
Report Columns

• Database columns

– Columns associated with the columns retrieved from the
database by the query.

• Sum...
/* Does this child record compare to the max sal
for the dept ? If yes, and placeholder already
set (i.e. we have more tha...
Adding Charts
Using Chart Wizard
Report Runtime Parameter Form
Triggers Categories
• Report triggers
–
–
–
–
–

After Parameter Form trigger
After Report trigger
Before Parameter Form t...
PL/SQL Editor
• After Parameter Form trigger :
--------------------------------• Example :Build a dynamic where clause
Function AfterPFo...
• FORMAT TRIGGER :
-------------------------EXAMPLE : HIDE FIELDS DYNAMICALLY
FORMAT TRIGGER ON SALARY FIELD
FUNCTION PAY_...
EXAMPLE : CONDITANALLY SET THE ATTRIBUTES if
salary equals 2000.
FORMAT TRIGGER ON FIELD salary
FUNCTION sal_mask RETURN B...
format trigger to add an alternating color scheme

•Highlight R_G_CATEGORY node in the Object Navigator
•Move the mouse to...
Managing Report Templates

In a new template under the body node
• default node
• override node.
The default attributes of...
Register a customized template in the predefined
template list
– To make file PORT.TDF available in the Reports Wizard,
pr...
Sample image of your template in Report Wizard:
– For each report style (tabular, group left, etc.)
for which the template...
• z

identifies the report style:

– a
Group Above
– f
Form-like
– g
Matrix with Group
– l
Group Left
– m
Mailing Label
– ...
Creating an additional report layout
• Used when different queries need to be placed in
different styles. To do this :
– I...
Reports 6i
Upcoming SlideShare
Loading in …5
×

Reports 6i

1,457 views

Published on

Oracle Reports

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Reports 6i

  1. 1. Course Title : Reports 6i
  2. 2. Common report styles required in a business report
  3. 3. Various report destinations
  4. 4. Main Report executables Main components of Report Builder
  5. 5. • Main objects in a report Different methods of building the report query
  6. 6. • Live Pre-viewer – viewing of a reports output format without printing it. – It also provides a set of tools to allow the format of the report to be altered. – These include: • • • • • Precision of numbers Left, right and centering of text Bold, underline, italic options Font type and size add dollar signs, change colors etc.
  7. 7. • Add page number and current date to a report – Create a report using the report wizard with no template. – Display the report in the Pre-Viewer. – Click on the menu option insert –Click on the date option and select the position of the date and the format of the date required. –Click on the ‘Page Number’ option and select the page number type and location.
  8. 8. Report Columns • Database columns – Columns associated with the columns retrieved from the database by the query. • Summary columns – Summarizes another column and may recalculate for each group. • Formula columns – Uses a formula written in PL/SQL to calculate a value from one or more other columns Example Function salcomm return Number is Begin Return(:sal+nvl(:comm,0)); End; • Placeholder columns – Holds a value that has been calculated and placed into by formula column.
  9. 9. /* Does this child record compare to the max sal for the dept ? If yes, and placeholder already set (i.e. we have more than one max sal) set the placeholder to the concatenated string. Else set the placeholder to the employee's name */ if (:sal = :max_dept_sal) then if (:highest_paid_emp <> ' ') then :highest_paid_emp := :highest_paid_emp||' and ' ||:ename; else :highest_paid_emp := :ename; end if; end if; return (:highest_paid_emp); end;
  10. 10. Adding Charts Using Chart Wizard
  11. 11. Report Runtime Parameter Form
  12. 12. Triggers Categories • Report triggers – – – – – After Parameter Form trigger After Report trigger Before Parameter Form trigger Before Report trigger Between Pages trigger • Data triggers – Formula Triggers – Validation Triggers
  13. 13. PL/SQL Editor
  14. 14. • After Parameter Form trigger : --------------------------------• Example :Build a dynamic where clause Function AfterPForm RETURN BOOLEAN IS BEGIN if :P_CUSTOMER is NULL then :p_where_clause:= ' '; else :p_where_clause := 'where id >= :p_customer'; end if; return(true); end; Query Syntax : ----------------SELECT ID,NAME FROM CUSTOMER &P_WHERE_CLAUSE ORDER BY NAME
  15. 15. • FORMAT TRIGGER : -------------------------EXAMPLE : HIDE FIELDS DYNAMICALLY FORMAT TRIGGER ON SALARY FIELD FUNCTION PAY_CLERKS_SEE_THIS RETURN BOOLEAN IS BEGIN IF STANDARD.USER = 'PAY_CLERK' THEN RETURN(TRUE); ELSE RETURN(FALSE); END IF; END;
  16. 16. EXAMPLE : CONDITANALLY SET THE ATTRIBUTES if salary equals 2000. FORMAT TRIGGER ON FIELD salary FUNCTION sal_mask RETURN BOOLEAN IS BEGIN IF :SALARY = 2000 THEN SRW.ATTR.MASK :=SRW.WEIGHT_ATTR + SRW.STYLE_ATTR + SRW.GCOLOR_ATTR + SRW.HJUST_ATTR; SRW.ATTR.WEIGHT :=SRW.BOLD_WEIGHT; SRW.ATTR.STYLE :=SRW.UNDERLINE_STYLE; SRW.ATTR.GCOLOR := 'MAGENTA'; SRW.SET_ATTR(0, SRW.ATTR); END IF; RETURN(TRUE); END;
  17. 17. format trigger to add an alternating color scheme •Highlight R_G_CATEGORY node in the Object Navigator •Move the mouse to the Layout Editor without clicking on anything. •Click the Fill Color icon and select the ‘Custom1’ color button •Click the Fill Color icon again, set the ‘Patterns’ option to ‘Transparent’ •Click the Line Color icon and set it to ‘No Line’
  18. 18. Managing Report Templates In a new template under the body node • default node • override node. The default attributes of a template can be applied to any style of report. E.g. The font of data in a template can be applied to the report, regardless of its style. The override attribute of a template, are attributes which can be applied only to certain styles of reports.
  19. 19. Register a customized template in the predefined template list – To make file PORT.TDF available in the Reports Wizard, predefined templates list do the following:– Search for file CAGPREFS.ORA, this is the reports global preferences file name under windows. – To the Reports.xxx_Template_Desc list, add the description that you want to appear on the Template page of the Report Wizard. – To the corresponding Reports.xxx _Template_File list, add the file name of your template in the same position as the addition you made to the description list. – Copy the template file (filename.tdf) to ORACLE_HOME/REPORT60/ADMIN/TEMPLATE/US.
  20. 20. Sample image of your template in Report Wizard: – For each report style (tabular, group left, etc.) for which the template is defined, apply the template to a sample report. – Use a screen capture tool to capture a portion of each sample report (no larger than 2 inches wide and 3 inches high) in .bmp format using the naming convention like yyyz.bmp where – yyy matches the filename specified in the Reports.xxx_Template_File list
  21. 21. • z identifies the report style: – a Group Above – f Form-like – g Matrix with Group – l Group Left – m Mailing Label – r Form Letter – t Tabular – X Matrix – Copy or create the .bmp file you want to use as a default (i.e., displays if no bitmap exists for a specific report style) and name it yyy.bmp. – Copy each .bmp file to ORACLE_HOME/REPORT60/ADMIN/TEMPLATE/US.
  22. 22. Creating an additional report layout • Used when different queries need to be placed in different styles. To do this : – In the Layout Model view, click in the tool palette. – Click and drag a rectangular area for the default layout to display the Report Wizard. – Follow the wizard to select the data to display in the new layout section. – To reorder the layout sections, click and drag them to new positions in the Layout Model view. – Modify the report output in the Live Previewer view, or choose Tools Report Wizard to re-enter the wizard.

×