Upload
zoraida-ulacio
View
234
Download
0
Embed Size (px)
Citation preview
8/6/2019 Reports 9i Training
1/99
R
eports
6i
ThomasKorbecki
oAppsNETPartners,LLC
8/6/2019 Reports 9i Training
2/99
Lab
Onespecifictopics:
GeneratereportsinCharacterModefor
WYSIWYG
How
functionsworkwithinareport
Aretherepro's/con'stousingmultiplequeriesvs.asingle
quer
ywithjoinsinare
port?
How
besttomanageg
roupsofdatasothatlittleorno
interventionisneeded
tothereportlayout.
Best
approachtoaddinganadditionalfieldtoareport
layout.
Layo
utnavigation-Se
cretstomovingorcenteringobjects.
Layo
ut(grouping,brea
ks,useofdifferentformats,page
setups)
Crea
tinganddropping
temptablesinreports.Doing
massiveamountsof"s
etup"queriesbeforethereportscan
begenerated.Or,failingthat,callingareportfromPL/SQ
L.
8/6/2019 Reports 9i Training
3/99
Rep
ortsWe
lcomeD
ialog
When
youfirstopenReports
6i,
thereportswelcom
e
dia
logboxopens.Formost
purposes,wewillbuildour
on
reportmanually,oropen
an
existing.
Tosup
presswindow:
Unche
ckDisplayatStartup.
Todisplaythewelcomedialogb
oxlater:
1.
SelectEdit>Preferences
2.
SelectWizardsTab
3.
SelecttheWelcomeDialog
check
box
.
8/6/2019 Reports 9i Training
4/99
Nav
igationOverview
Modules
Modules:To
plevelobjects
thatcanber
eferencedby
othermodules(I.e.,Oracle
Forms)
ReportLevelO
bjects
ReportLevelO
bjects:Objects
usedtobuildthereportbutca
n
notbereferenc
edbyother
reports
CollectionofPL/SQLsourcecodeandatta
ched
PL/SQLlibraries
specifictothereport
Reportnod
esthatcanb
eutilizedbyanyreportthey
areinsync
withReports
8/6/2019 Reports 9i Training
5/99
ObjectNavigatorProperties
TheObjectNa
vigatorshowsa
hierarchicalrelationshipbetween
all
objectsofthereport.
Theobjectnav
igatorenablesyou
to
locateandmanipulateobjectsquickly
andeasily.
UsetheFindfieldtoquicklylocate
items,searchin
gforwardand
backwardthroughanylevel.
8/6/2019 Reports 9i Training
6/99
ObjectNavigatorProperties
Justpointandclick:
+signsaree
xpandable
-signsarecollapsible
Boxesarelo
westlevelobjectsand
havenoassociatedobjectbelo
w
them
8/6/2019 Reports 9i Training
7/99
ObjectNavigator
Properties
Ope
nNewReport
SaveCurrentReport
RunCurrentReport
PrintRe
port
E-MailReport
8/6/2019 Reports 9i Training
8/99
ObjectNavigator
Properties
Add
Objectofhighlightedtype
DeleteO
bjectofhighlightedtype
Expan
dhighlighted
object
onelevel
Collap
sehighlighted
object
onelevel
Expan
dalllevelsof
highlig
htedobject
Collapsealllevelsof
high
lightedobject
8/6/2019 Reports 9i Training
9/99
Hint
Collapsebranchesasyou
getdone
withthem.OracleReportscontain
MA
NYobjects
andthelon
geryouwa
it
toc
ollapseobjectstheha
rderitwillb
e
tod
ecipherthe
ObjectNa
vigator
objects.
8/6/2019 Reports 9i Training
10/99
ObjectNavigator
Prope
rtyPalette-
Name
RightClickonmodulenam
e,
AndchoosePropertyPalette
ChangetheNameofthe
report.
(hint*namethisth
e
samea
sfilename)
8/6/2019 Reports 9i Training
11/99
ObjectNavigator
PropertyPalette-SetCha
racterMode
Scrolldownthroughthe
property
palette.UnderCharacte
rMode,
Setth
epropertyDesign
In
CharacterUnits,
toYes.
8/6/2019 Reports 9i Training
12/99
Hint
PropertyPalette-SetCha
racterMode
Alw
ayssetnewreportsto
Charactermod
eforOracle
Applications.Itisbesttodothis
bef
orealayou
tisstarted,
because
onc
eyouhave
builtalayo
utand
cha
ngetocharactermode,you
can
runintopr
oblems.
8/6/2019 Reports 9i Training
13/99
DataModelOvervie
wDATAMODEL
DAT
AMODEL
OVERVIEW
OVE
RVIEW:
The
DataModel
editoristhe
workspacewhere
you
sele
ctanddefine
data
foryourreport.You
are
essentiallycalling
incolumnandtab
le
definitionsfromth
e
database
8/6/2019 Reports 9i Training
14/99
DataModelOvervie
w
DAT
AMODEL
DAT
AMODEL
OVE
RVIEW
OVE
RVIEW:
Usin
gthetoolsinthe
tool
palette,youcan
crea
tequeries,
grou
ps,columnsa
nd
para
meters.Youcan
also
linktwoseparate
queriestogether
8/6/2019 Reports 9i Training
15/99
DataModelOvervie
w
ToolPalette
IfToolPaletteis
notvisibleinData
Model,
Goto:
View>ToolPalette
Select
Object
Create
Query
Formula
Column
Cross
Product
Express
Query
Magnify
RefCursorQuery
SummaryColumn
Placehold
erColumn
Da
taLinktolink
twoqueriestog
ether
8/6/2019 Reports 9i Training
16/99
DataModelOvervie
w
Syste
mParamete
rs
DefaultSystemParametersa
re
cre
atedforeveryreport.The
y
are
usedtomod
ify/controlreport
outputandprint
ingactivity.
Not
es:
Ifbuilding/modifyingreportsfora
pps,
do
notmodifyinR
eports6i
Sy
stemParameterscomeintopla
y
wh
enprintingfrom
operatingsystem
Pa
rameterscanbemodifiedatruntime
8/6/2019 Reports 9i Training
17/99
DataModelOvervie
w
UserParameters
UserParameters
arereport
specificandareu
sedtopass
informationtoar
eportat
runt
ime.Parame
tersareused
to
car
veoutinformationas
specifiedbytheuser.
8/6/2019 Reports 9i Training
18/99
LayoutEditorOverv
iew
LAY
OUTEDITOR
LAY
OUTEDITOR
OVE
RVIEW:
OVE
RVIEW:
The
LayoutEditoris
theworkspacewhere
you
definethe
positionsofthe
layoutobjectsasthey
shou
ldappearinthe
repo
rtoutput.
8/6/2019 Reports 9i Training
19/99
LayoutEditorOverv
iew L
ayoutRegions
LayoutRegions
ToolBar
ToolBar:Perfo
rm
basicreport
activities
ToolPalette
ToolPalette:P
erform
Layoutspecific
functions
LayoutCanvas
LayoutCanvas:
Workspacefors
etting
upreportlayout
8/6/2019 Reports 9i Training
20/99
LayoutEditorOverv
iew
Header
Section
Main
Section
Trailer
Section
Edit
Margin
8/6/2019 Reports 9i Training
21/99
LayoutEditorOverv
iew
Confine
Mode
Flex
Mode
SelectParent
Fra
me
8/6/2019 Reports 9i Training
22/99
HintConfineMode
On
Off
On
Off
Co
nfineModeOn/Off:
Wh
entheconfinemodeis
On,
anobjectcannotbemoved
outsideoforplacedbelow
its
par
ent.
Fle
xModeOn/Off:
Wh
entheconfinemodeis
On,
the
parentobjectisresized
when
achildobjectisresized.
Us
eConfineModew
henmoving
ob
jectstokeepwithin
groupsandrepea
ting
Frames.
IfconfinemodeisOff,youmayaccidentally
moveoutsideofthec
orrectframe,andcause
reporttocompletewitherror.
8/6/2019 Reports 9i Training
23/99
Trig
gersOverview
Triggersfireat
sp
ecificevents
and
canexecute
PL/SQL
8/6/2019 Reports 9i Training
24/99
Trig
gersOverview
BeforeReportTrigger
BeforeReportTrigger
F
iresaftertheParameterformis
executed,butbef
orereportisspooled
F
alseconditions
stopsprocessin
g
8/6/2019 Reports 9i Training
25/99
Trig
gersOverview
AfterReportTrigger
AfterReportTrigger
Fireswhenrepo
rtfinishesspooling
regardlessifrep
ortcompleted
successfully
Usedforpost-re
portprocessing
:
Cleaningup
tables
Capturingstatistics
Falseconditions
generatesmessage
butdoesnotstopexecution
8/6/2019 Reports 9i Training
26/99
8/6/2019 Reports 9i Training
27/99
Trig
gersOverview
A
fterParameter
Form
A
fterParameter
Form
Firesafterpar
ameterformis
executed
Usedtovalidateparameters
Falsecondition
sendsyouback
to
parameterfortore-enterparam
eters
8/6/2019 Reports 9i Training
28/99
Trig
gersOverview
FormatTriggers
Form
atTrigger
Form
atTrigger
Can
beusedinany
Layoutobject
Fireswheneveryobject
isformatted
False
conditionprevents
objec
tfromprinting
8/6/2019 Reports 9i Training
29/99
Trig
gersOverview
Hint
AF
ALSEcond
itionforeitheragroup
orrepeatingframewillcauseall
enc
losedobjectssuchas
fieldsand
columnstoinh
eritthiscon
ditionand
NO
Tprint.
8/6/2019 Reports 9i Training
30/99
WorkingintheData
Model
Query:SQLstatementth
atfetchdatefromthedatabase
Groups:Groupsdeterminethehierarchyofthedatatha
tappears
inthereportandareusedtocreatebreaksinth
ereport.
Youcancreateyouowngroupsbydraggingacolumn
aboveorbelow
agroup.
Column:Columnsareow
nedbygroupsandareautomatically
createdforthec
olumnsincludedintheselect
statement.You
cancreateyourowncolumnsu
singthe
SUMMARY,FORMULA,andPLACEHOLERtools.
Links:Linksareusedtoe
stablishparent-childrelationsh
ips
betweenqueriesa
ndgroupsviamatchingcolumns.
Param
eters:Parametersallowyo
utochangeselectioncriteria
(whereclause)andcalculatio
nsatruntime.
8/6/2019 Reports 9i Training
31/99
WorkingintheData
Model
SQL
Step1:
FromObjectNavigator
accessData
Model
Double
clickDataModelicon
Rightc
lickDateMode
landselect
Editor
BuildingaSEL
ECTStatemen
t
8/6/2019 Reports 9i Training
32/99
WorkingintheData
Model
SQL
ClickSqlButton.
Plac
ecursoranywhere
in
DataModelcanvasand
click
.
This
opensaSQLwindow,
whe
reyouwillenteryo
ur
sqlstatement.
Note*Youmustbe
con
nectedtothedatabase
toe
nteryoursql,impo
rtsql,
oru
setheQueryBuild
er
8/6/2019 Reports 9i Training
33/99
WorkingintheData
Model
Groups
U
seBreakGroups
T
ocreaterelationshipinthedata
m
odelyouneed
todragacolum
n
fromG_O
RDER
Sbetween
G
_ORDERSand
G_date_req
Step1:Poin
t,clickandholdd
ownacolumnfro
mG_
ORDERS
Step2:Drag
booked_
flagabo
veG_
ORDERSandbelowG_
date_
req
8/6/2019 Reports 9i Training
34/99
WorkingintheData
Model
Groups
Use
BreakGroups
New
breakgroupiscreatedwithth
e
nam
eofG_
8/6/2019 Reports 9i Training
35/99
WorkingintheData
Model
Linkin
gQueries
UseLinkedQueries
1.Createsecondquery
5
.Releasethem
ouse
2.PointandclickLinkIc
on
4.DRAGthemo
usetothecolum
n
thatdefinesthed
etailrelationship
3.Pointand
click(andhold)on
thecolumnthatdefinesthe
masterrelationship
8/6/2019 Reports 9i Training
36/99
WorkingintheData
Model
DataGroupsvs.LinkedQueries
Esse
ntially,thegroupsandlinkedqueriescreatethesame
relationshipbetweend
ata.
IfSQLisalreadywritten,andperformanceisgood,thenone
quer
yshouldbefine.Ifperformanceseemstobeaproble
m,
may
tryandbreakupintosmaller,more
efficientqueries
anduseadatalinkbe
tweenqueries.Re
member,younee
d
similarcolumnsfromb
othqueriesthatw
illproducethelin
k.
Itishelpfultogiveatleastthesecondqueryacolumnalia
s
onth
efieldthatwillbe
usedforthelink.
Ifreportisbeingmodified
andneedtoadd
moregroupsof
data,maybeeasierto
addadditionalqu
eryandusedata
linkbetweenqueries.
8/6/2019 Reports 9i Training
37/99
WorkingintheData
Model
Summ
aryColumn
ASum
maryColumnis
afield
thatsu
msitemsinanother
columnandgenerates
atotal
(oroth
erfunction)
Step1:
PointandclickontheSummary
Columnicon
Step2:
Pointandclickinthe
APPROPRIATEareaoftheD
ata
Model
8/6/2019 Reports 9i Training
38/99
WorkingintheData
Model
Summ
aryColumn
Step
3:
Acce
ssthe
SummaryColumn
propertypalette
8/6/2019 Reports 9i Training
39/99
WorkingintheData
Model
Summ
aryColumn
Step
4:Renamethe
field
,BUTKEEPCS
_
Step6:IdentifyaSource
columntobe
sum
marized
Step7:Selectwhentheto
tal
willresetS
tep
5:Choosewha
ttype
ofsummaryfunction
8/6/2019 Reports 9i Training
40/99
WorkingintheData
Model
Summa
ryColumn-Tip
Pla
ceyourSummaryColumnwithin
the
groupyou
wanttotota
l.The
sou
rcedoesN
OThaveto
beinthat
gro
up
8/6/2019 Reports 9i Training
41/99
WorkingintheData
Model
FormulaColumn
AForm
ulacolumnperfo
rmsa
user-definedcomputatio
non
thedataofoneormore
columns.
Addaformulacolumnsim
ilarto
adding
asummarycolumn.
Clickontheappropriateic
on,
andpla
ceinthegroupwh
ere
youwa
nttheformulacolu
mn.
8/6/2019 Reports 9i Training
42/99
WorkingintheData
Model
FormulaColumn
Op
enPropertyPalette
fornewformula
co
lumn
Renamethefield
,
BUTKEEPCF_
ChooseDatatype
andwidth
ClickonPL/SQL
Formulatoaddcode
totheformula
column
8/6/2019 Reports 9i Training
43/99
WorkingintheData
Model
FormulaColumn
Defineanyvariables
beforebegin
Addlogichere.You
can
calldatabase
fun
ctions/procedure
s/p
ackagesfrom
herealso.
Referenc
eexisting
reportco
lumnsor
parametersusinga
colon.
Defineexceptions
forfunc
tion.
8/6/2019 Reports 9i Training
44/99
WorkingintheData
Model
FormulaColumns
C
lickCompile.
Ifnoerrorsshowa
t
thebottomofthe
w
indow,youcan
c
losethewindow.
Iferrorsfixerror
s
a
ndcompileagain
.
8/6/2019 Reports 9i Training
45/99
WorkingintheData
Model
FormulaColumns
UseFormulaC
olumnswh
enthedata
you
needcann
otbeeasilyaddedto
the
query.
Addformulacolumnstothesame
gro
upsthatthecolumnsr
esideinyou
willbereferencingintheformula
column.
Formulacolum
nscanbeusedin
con
junctionwithplaceholdercolumns.
8/6/2019 Reports 9i Training
46/99
Workinginth
eDataM
odel
FormulaColumns
withPlaceh
older
Colum
ns
Cr
eatePlaceholder
co
lumnsinthesam
e
wa
yastheformula
an
dsummary
co
lumns.Namewill
be
CP_
(name)
Cr
eateFormula
co
lumn,andwrite
co
detopopulate
placeholder
co
lumns.Reference
theplaceholder
co
lumnsasyou
wo
uldanyother
reportcolumns.
8/6/2019 Reports 9i Training
47/99
WorkingintheLayo
utEditor
Wh
enbuilding
anewrepo
rt,youcan
use
theReportWizardto
createa
new
layout.**
Makesure
Character
Mo
deissetto
Yes.
Ifm
odifyingex
istingreportthatonly
nee
dsafewchangestolayout,donot
use
theReportWizard.
8/6/2019 Reports 9i Training
48/99
WorkinginLayoutE
ditor
Prope
rtyPalette(
setpagesiz
e)
Fro
mtheobjectNavig
ator:
Go
toLayoutModel>
MainSection.
Rig
htclickandbringu
p
pro
pertypalette.
Setpagesizeininche
sfor
wid
thandheight,
AndalsoforCharacte
rMode.
Thiswilla
lsodetermin
e
orie
ntation.
Ch
aractermodewidth
:
80
=portrait
132=landscape
180=landwide
8/6/2019 Reports 9i Training
49/99
WorkingintheLayo
utEditor
SetR
ulersandGridSnap
Checkto
makesureGrida
ndSnaptoGrida
re
enabled:
View>Grid
SnaptoGrid-bothshouldbechecked.
Che
ckGridSpaceOp
tions:
Format>
LayoutOptions>
Rulers
8/6/2019 Reports 9i Training
50/99
WorkingintheLayo
utEditor
SetR
ulersandGridSnap U
nits:CharacterCellssh
ouldbe
selecte
d.
GridSpacing:1Shouldb
e
selecte
d.
Numbe
rofSnapPointsPerGrid
Spacing:
1
Charac
terCellSize(points)
should
defaultcorrectly.
8/6/2019 Reports 9i Training
51/99
WorkingintheLayo
utEditor
ReportWizard(fromdatamodel)
Data
Wizard
Report
Wiza
rd
ClickReportWizard
8/6/2019 Reports 9i Training
52/99
WorkingintheLayo
utEditor
ReportWizard
Tabularreportsare
gre
atforsimple
listing
GroupLeftandG
roup
AboveReportsare
gre
attoshowparent-
childrelationships
8/6/2019 Reports 9i Training
53/99
WorkingintheLayo
utEditor
ReportWizard
Se
lect
Re
portgroups
Yo
uwanttodisplayinthe
lay
out.
8/6/2019 Reports 9i Training
54/99
WorkingintheLayo
utEditor
ReportWizard
Choosethefieldsyouwantto
displayin
yourlayout
8/6/2019 Reports 9i Training
55/99
WorkingintheLayo
utEditor
Rep
ortWiza
rd
Giveeachfielda
meaningfullabel
8/6/2019 Reports 9i Training
56/99
WorkingintheLayo
utEditor
ReportWizard
8/6/2019 Reports 9i Training
57/99
WorkingintheLayo
utEditor
ReportWizard
Mu
stbeconne
ctedtothe
databaseto
finishwiththe
ReportWiz
ard.
ReportLayout
willt
henbe
readyto
workwithany
fieldsthatw
erechosen
inthewizards
teps.
8/6/2019 Reports 9i Training
58/99
WorkingintheLayo
utEditor
ReportWizard
8/6/2019 Reports 9i Training
59/99
WorkingintheLayo
utEditor
Frames
Aframepro
tectstheobjectsite
nclosesandcontrolsthefrequencywith
whichthose
objectsareformatted.Framescanenc
loseotherframes.
Reportsgeneratesonegroupframearoundtheentirelayoutwhen
creatingmostlayouts.Groupframesarenormally
namedwiththe
convention
G_
VariableGroupFrames
FixedFrames
Afixedsizedframeisnormallycreatedaroundboilerplateobjectsin
the
layout.
8/6/2019 Reports 9i Training
60/99
WorkingintheLayo
utEditor
Frames
Repeatin
gFrames
Reportsgene
ratesonerepeating
frameforeachgroupwhencreatinga
defaultlayou
tandplacesfieldsinsidetherepeatingframe.Repeating
framescanin
cludeotherrepeati
ngframes.Also,th
eycancontrolrecord
levelformatting.Usuallynamed
R_
PropertiesofRepeatingFrames
VariableorFixed
Spacebetweenrecords
8/6/2019 Reports 9i Training
61/99
8/6/2019 Reports 9i Training
62/99
WorkingintheLayo
utEditor
Frames
VisualF
ramesProperties
FrameSizing
PrintDirection
(repeatingframes)
Down
Across
Down/Across
Across/Down
Contract
Expa
nd
Variable
Fixed
8/6/2019 Reports 9i Training
63/99
WorkingintheLayo
utEditor
Fields
SystemVariablesuchasadate
orpagenumber
Columnnamefromthequery
SystemParameters,suchasitemnumber,revision
SourceofFields
ValidSou
rceColumns
Thesourceo
fthefieldmustbeintherelevantgrou
pfortherepeating
frame
8/6/2019 Reports 9i Training
64/99
WorkingintheLayo
utEditor
Fields
Acolumn,
variable,orparameterasdefinedinthereportdatamodel
Asystemvariablesuchasacu
rrentdate,orpage
number
RelationshiptoDataMo
del
Afieldisap
laceholderforaco
lumnoraparameter,includingpage
numbers,an
dcurrentdate.Reportscreatesonefie
ldforeachcolumn
whenyouselectthedefaultlayo
ut,andplacesthese
fieldsinarepeating
frame.
8/6/2019 Reports 9i Training
65/99
WorkingintheLayo
utEditor
Anchors
Ananchordeterminesvertical/horizontalpositioningoftheparent/child
objects.
Parent
Child
Thereare
twotypesofan
chors
Implicit(notvisible,Reportscreated)
ByDefault,Reportsimplicitlyanchorseachobje
cttoitsimmediate
enclosingobject.
Explicit(visible,Designercreated)
8/6/2019 Reports 9i Training
66/99
8/6/2019 Reports 9i Training
67/99
WorkingintheLayo
utEditor
Pagin
ation
FourPaginationProperties
PageBreak
Before-forcetheobjecttobeformatted
onthenextlogical
pageaftertheoneonwhichitw
ouldinitiallyprint
PageBreak
After-forceallexternalchildobjectsto
printonthenext
logicalpage
PageProtect-causetheentireo
bjectanditsenclosedobjectstobekept
togetheron
thesamelogicalpag
e.
KeepWith
AnchoringObject-causetheobjectandtheobjecttowhich
itsanchore
dtobekepttogetheronthesamelogical
page
8/6/2019 Reports 9i Training
68/99
WorkingintheLayo
utEditor
PrintCondition
PrintObjectOnindicatehowoften
theobjectinrelationtoanotherparent
object.
PrintObjectOn
Objec
t
All
Alllo
gicalpagesofthepa
rent
AllButFirst/Last
Alllo
gicalpagesexceptfirst/lastpage
First/Last
Thefirst/lastpageonly.
Default
Reportssetsthistype,usin
ganalgorithm
8/6/2019 Reports 9i Training
69/99
WorkingintheLayo
utEditor
Data
andLayou
tRelationship
M_orders_
GR
PFR
Whiteframe
surroundingentire
layout
R_orders
SourceisG_orders
fromdatamodel
GreenRepeating
Frame
(alsosurrounds
turquoisframe)
R_
date_req
Sourceis
G_
date_re
qfrom
datamode
l.Red
repeatingframethat
enclosesallother
frames(except
M_orders_
GRPFR)
8/6/2019 Reports 9i Training
70/99
WorkingintheLayo
utEditor
Data
andLayou
tRelationship
F_order_type
orde
r_typecolumnfrom
G_ordersgroupframe
8/6/2019 Reports 9i Training
71/99
WorkingintheLayo
utEditor
ModifyLayoutandObjectNavigator
Itis
besttowork
withtheobje
ctnavigator
visiblewhenworkinginlayout
editorespeciallywhenaddingnew
colu
mnstoyour
layout,ormo
vingfields
around.Thisallo
wsyoutose
ewhich
groupsyouarein.
Whenyouclickonafieldinth
ereport
layo
ut,youwills
eethisfieldh
ighlightedin
the
objectnavigator.
8/6/2019 Reports 9i Training
72/99
WorkingintheLayo
utEditor
ModifyLayout-T
ips
Use
colorsongroup
framesandrepeatingframesto
visuallyseewhatlev
elyouareworkingat.
Ifus
erswantdonot
wanttoseecertaingroupofdata,
trytoaddagroupframearoundthos
eobjectsandput
aformattriggersettofalse.Theymaychangetheir
mindslater.
Trynottodouble-clickorrightclicko
nanobject.
Reportsiskindofqu
irkysometimes
andfieldorfram
e
may
disappear.Instead,useTools>
PropertyPalette
option.
Use
Arrowkeystom
ovefields.Tryn
ottomovewith
mou
se.
8/6/2019 Reports 9i Training
73/99
WorkingintheLayo
utEditor
ModifyLayout-T
ips
SAVEOFTEN
!!alongw
ithdifferent
ver
sions.
S
aveafter:
Interimmilestones
Majormilestones
Dailywithdescriptionofchangesfrom
previousday
8/6/2019 Reports 9i Training
74/99
WorkingintheLayo
utEditor
ModifyLayout
If
youhavetoadda
group
frameorrepeatingfr
ame,or
severalfields,
Addplentyofextraroomso
th
atyoucanwork.
Dothisbystartingatthe
outermostframe,which
canbefoundbylook
ingin
th
eobjectnavigator.
8/6/2019 Reports 9i Training
75/99
WorkingintheLayo
utEditor
ModifyLayout
Lab:
Requirement:
Userhasaskedtosee
these
bas
edonaparameterbeing
set
toyes.
Tasks:
1.A
ddagroupframe
around
req
uest_dateand
sch
edule_
dateinthe
R_attachmentsgroup
frame
(turquoise).
8/6/2019 Reports 9i Training
76/99
WorkingintheLayo
utEditor
ModifyLayout
ClickIconto
add
newFrame
Drawframeo
verthe
datefields,an
dthen
changecolorofthe
frame.
8/6/2019 Reports 9i Training
77/99
WorkingintheLayo
utEditor
ModifyLayout
Hig
hlightnewframe.
Go
to
Arrange>MoveBackward
Sho
rtcutforthisisF8key.
Thiswillmovethenewgroup
fram
ebehindthedatefields.
Note:thegroupframemust
com
pletelysurroundthe
frames
you
wanttoenclose.
8/6/2019 Reports 9i Training
78/99
Workinginthelayou
tEditor
ModifyLayout
Dateframes
arenow
enclosed
by
groupfra
me.
Verifywith
Object
Navigato
r
8/6/2019 Reports 9i Training
79/99
WorkingintheLayo
utEditor
ModifyLayout
Re-sizenewgroup
frametonormal
Gotoprope
rty
palletefor
newgroup
frame
.
Assig
na
name
,using
M_
AddFormatTrigger.
Logictoprintifparameter=Y(oryes).
Dontprintifparameter=N.
8/6/2019 Reports 9i Training
80/99
WorkingintheLayo
utEditor
More
thanoneLa
yout
BuildMorethanon
e
layoutfromoneDa
ta
Model.
Afterfirstlayout,yo
umust
buildmanually.Copyand
pastecanworkver
y
carefully.
Saveoften.
Thereareseveralreas
ons
you
maywanttobuildmore
than
onelayout,
Suchasdifferentsorts
or
grou
pings,differentusers
wan
tsamedata,butin
totallydifferentformats
.
8/6/2019 Reports 9i Training
81/99
WorkingintheLayo
utEditor
More
thanoneLa
yout
FormatTriggerforoutermostframeonfirstlayout.
Thisoneisbasedonparametercouldpossiblybebasedondata
:
8/6/2019 Reports 9i Training
82/99
WorkingintheLayo
utEditor
More
thanoneLa
yout
Forma
tTriggerforSecondLayoutbasedon
parameter:
8/6/2019 Reports 9i Training
83/99
Adv
ancedT
opics
Cre
atingUser
Parameters
Bin
dReferenc
es
Lex
icalParam
eters
Triggers
ReportProperties
SR
W.EXITS
8/6/2019 Reports 9i Training
84/99
Adv
ancedT
opics
Youcancreateyourownparamet
ersandusethemto
changetheSELEC
T
statementofy
ourqueryatruntime
.
AUSERparam
eterisanobjectth
atyoucreatetoholdavaluethatusers
can
changeatruntime.
Restrictvalu
esintheWHEREclauseoftheSELECTstatement
SubstituteanypartoftheSELECTstatement
Substitutea
singlecolumnorex
pressionintheSEL
ECTstatement.
RestrictprintingintheLayout.
Creating
UserParam
eters
RelationshiptoAOLParameters
ThereisadirectrelationshipbetweenAOLandReports
Parameters.
8/6/2019 Reports 9i Training
85/99
Ada
vanced
Topics
Therearetwo
waysyoucanreferenceparametersinaquery:useabind
referenceora
lexicalreference.
BindReference-replacesasinglevalueorexpres
sion.
Tocre
ateabindreferenc
esinaquery,referencetheparameter
witha
colon(:).
LexicalRefe
rence-replacesa
nypartofaSELECTstatement,sucha
s
columnnames
,theFROMclause,theWHEREclause
,ortheORDERBY
clause.
Tocreatealexicalreferenceinaquery,prefixth
eparameternamewithan
ampersand(&)
Referenc
ingParame
tersinaReport
8/6/2019 Reports 9i Training
86/99
Adv
ancedT
opics
Type
Pref
ix
Usetoreplace
Parameter
CreatedbyDefault
Bind
:
WHERE,GROUPBY
Yes,ifitdoesnotalready
exist
ORDERBY,HAVING
CONNECTBY,
STARTWITH
Lexical
&
anypartofthe
SELECT
No,Youmustalwayscrea
te
statement
theparameterin
the
Object
Navigatoryourself.Datatype
mustbeCHARACTER
Compari
ngBindandLexicalPa
rameters
8/6/2019 Reports 9i Training
87/99
Adv
ancedT
opics
BindReferences-Examples
SINGLEL
ITERALVALUE:
SELEC
Torder_number,customer_i
d
FROM
so_headers_a
ll
WHERE
header_i
d=:P_H
EADER_I
D
VARIOUS
REPORTSOPTI
ONS
SELECTorder_number,customer_i
d
FROM
so_headers_a
ll
SORTB
YDECODE(:P_SO
RT,1,order_numbe
r,2,customer_i
d)
8/6/2019 Reports 9i Training
88/99
Adv
ancedT
opics
LexicalParameters-Examples
REPLACIN
GTHEWHERE
orORDERBYC
LAUSE:
SELECT
order_number,customer_i
d
FROM
so_headers_a
ll
&P_W
HERE_C
LAUSE
&P_O
RD
ER_B
Y
SpecifyColumnNames
SELECT&P_O
RDER_N
UM
BER,customer_id
FROM
so_headers_a
ll
SORTB
YDECODE(:P_SO
RT,1,order_numbe
r,2,customer_i
d)
8/6/2019 Reports 9i Training
89/99
8/6/2019 Reports 9i Training
90/99
Adv
ancedT
opics
Enterainitialv
alueforpa
rameters
tha
taffectque
ryvalidationwhen
NU
LL
Cre
atelexical
parameters
explicitlyin
the
ObjectNavigator
Forlexicalparameters,de
finethea
validclause
8/6/2019 Reports 9i Training
91/99
Adv
ancedT
opics
DataMo
delTriggers-Formula
YoucancodeaPL/SQLfunctionin
aformulacolumntopopulateotherobje
cts,
suchasplaceholdercolumns,aswe
llasthecolumnitself.
EXAMPLE
FUNCTIONset_bonusRETURN
CHARIS
BEGIN
IF:salary>
10000THEN
:bonu
s:=salary*.10;
ELSE :
bonu
s:=salary*.05;
ENDIF;
RETURN();--topopulatethe
formulacolumn
END;
8/6/2019 Reports 9i Training
92/99
Adv
ancedT
opics
LayoutT
riggers
Formattriggersallowyoutomodifythedisplayofobjectsdynamicallyatruntime,
ortosuppressdisplayaltogether.
Frames
Rep
eatingFrames
Fiel
ds
BoilerplateObjects
8/6/2019 Reports 9i Training
93/99
Adv
ancedT
opics
FormatT
rigger-Example
FUNCTIONhide_sales_order_numberRETURNBOOLEANIS
BEGIN
IF:P_O
RD
ER_N
UMBERISNULLTHEN
return
(false);
ELSE r
eturn
(true);
ENDIF;
END;
8/6/2019 Reports 9i Training
94/99
Adv
ancedT
opics
SRW-F
ormatField
s
TheSRWreferencesareusedto
modifyobjectsintothereport.
functionc_exten
ded_price_dspFormula
returnCharis
begin
srw.reference(:currency1);
srw.reference(:c_extended_price);
srw.reference(:RP_C
URR_P
ROFILE);
srw.user_exit('FND
FORMAT_C
URRENC
Y
CODE=":currency1"
DISP
LAY_W
IDTH="13"
AMO
UNT=":c_extended_price"
DISP
LAY=":c_extended_pr
ice_dsp"
');
return(:c_extend
ed_price_dsp);
end;
8/6/2019 Reports 9i Training
95/99
Adv
ancedT
opics
SRW-S
etEnvironm
entforMu
ltiOrg
BeforeRepor
tTrigger-Setsthe
Views
BEGIN
BEGIN
SRW.USER_
EXIT('FNDSRWIN
IT');
EXCEPTION
WHENSRW.USER_E
XIT_F
AILURETHEN
SRW
.MESSAGE(1000,'FailedinBEFORER
EPORTtrigger-
SRWINITUSE
REXIT');
return(FAL
SE);
END;
8/6/2019 Reports 9i Training
96/99
Adv
ancedT
opics
SRW-S
etEnvironm
entforMu
ltiOrg
AfterReportTrigger-ResetstheEnvironment
SRW.USER_E
XIT('FNDSRWEXIT');
EXCEPTION
whensrw.user_exit_failurethen
srw.messag
e(1,'FailedinAFTERREPORTTRIGGE
R');
return(FALSE);
END;return(TRUE);
8/6/2019 Reports 9i Training
97/99
Adv
ancedT
opics
Exampleto
PopulateR
eport
tablefromareport
formulacolumn.
Tableexistson
database:
8/6/2019 Reports 9i Training
98/99
AdvancedTo
pics
FND_
REQEUST.
SUBMIT_RE
QUST
Usedthistocallreportfro
mareport,form,o
rpl/sql.Ifthiscallis
succes
sful,l_request_id=
concurrentmanag
errequest_id,else
itwillequal0:
l_reque
st_id:=FND_
REQ
UEST.SUBMIT_R
EQUEST('XGDR',
'XGDR_
WIP_
LABELS',
'','', FALSE,
jobs.d_job,'','','','','','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','',
'','','','','');
8/6/2019 Reports 9i Training
99/99
ancedT
opics