report scripts baanerp 5.0c tools. agenda design environment relation report/session relation report...
TRANSCRIPT
![Page 1: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/1.jpg)
Report ScriptsBaanERP 5.0c Tools
![Page 2: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/2.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 3: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/3.jpg)
Training objectivesTraining objectives
Insight in:• the structure and operation of reports, report
scripts and sessions• the main functions of BAAN-C• application possibilities of report scripts
Skills in:• construction and customization of report scripts
![Page 4: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/4.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 5: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/5.jpg)
Design EnvironmentDesign Environment
0101110110
T TT
OPER_001
tdB50O_c_cus1 tpB50O_c_cus1
DSGN_001
T TT
Ontwikkelaar
tdB50O_c_cus2 tpB50O_c_cus2
0101110110
0101110110
0101110110
0101110110
0101110110
0101110110
0101110110
0101110110
0101110110
tdB50_c tpB50_c
B50Sc
tdB50U_c_stnd tpB50U_c_stnd
![Page 6: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/6.jpg)
Relation report/session (1)Relation report/session (1)
Printsession
form
0101110110
object report main table
![Page 7: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/7.jpg)
Relation report/session (2)Relation report/session (2)
Printsession
form
0101110110
object report 1 main tablereport 2
![Page 8: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/8.jpg)
Relation report layout/report scriptRelation report layout/report script
Applicatie Dictionary Runtime Dictionary
application
pakket dmversie a
forms
nedmodule oes
forms
engmodule oes
tools
1010100011
If … then ……else …...endif
Reportlayout
Report script(BAAN-C)
Report objectCompile
Application Dictionary Runtime Dictionary
![Page 9: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/9.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 10: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/10.jpg)
Usage of report scriptsUsage of report scripts
• Complex calculations• Complex field expressions
• Complex layout conditions• Complex field conditions• Complex aggregate expressions
• Reading of not related tables
![Page 11: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/11.jpg)
Structure report scriptStructure report script
• Sections without subdivision• Sections with subsection(s)
![Page 12: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/12.jpg)
Sections without subdivisionSections without subdivision
• Declaration• Before.program• After.program
• Functions
Declaration variables + tables
Initialization variables
Release allocated memory space
Define own functions
![Page 13: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/13.jpg)
Sections with subsection(s)Sections with subsection(s)
• before.report.<seq.nr.>
• header.<seq.nr.>
• before.<field name>.<seq.nr.>
• detail.<seq.nr.>
• after.<field name>.<seq.nr.>
• footer.<seq.nr.>
• after.report.<seq. nr.>
• field.<text field name>
Subsection(s)
after.layout
Actions after printing
before.layout
Actions before printing
before.print
![Page 14: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/14.jpg)
Examples - Examples - DeclarationDeclaration
declaration:string description(30) | Item descriptionlong tot.number | Total number of items per warehousedouble tot.amount | Total amount per warehouse
By means of data types
declaration:domain cudscr description | Item descriptiondomain cuquan tot.number | Total number of items per warehousedomain cupris tot.amount | Total amount per warehouse
By means of domains
![Page 15: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/15.jpg)
Examples - Examples - Before.program, detail and Before.program, detail and after.fieldafter.field
before.program:tot.number = 0tot.amount = 0
detail.1:after.layout:
tot.number = tot.number + cuoes020.quantot.amount = tot.amount + (cuoes020.quan * cuoes001.spri)
after.cuoes020.cwar.1:after.layout:
tot.number = 0tot.amount = 0
![Page 16: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/16.jpg)
BAAN-C syntaxBAAN-C syntax
• Program structures• Operators• Predefined variables and functions• Special report variables and functions
![Page 17: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/17.jpg)
Program structuresProgram structures
if....then....else.....endif
on.....case..:...case...:..default:...endcase
while......endwhile
repeat....until.......
for....=....to.....step....endfor
break/continue
<condition> ? <expression-1> : <expression-2>
![Page 18: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/18.jpg)
Program structures - Program structures - On caseOn case
on case cuoes001.igpc:
case “010”: newprice = 1.10 * cuoes001.spribreak
case “015”: newprice = 1.25 * cuoes001.spribreak
case “032”: newprice = 1.15 * cuoes001.spribreak
case “067”: newprice = 1.35 * cuoes001.spribreak
default: newprice = 1.05 * cuoes001.spribreak
endcase
![Page 19: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/19.jpg)
OperatorsOperators
Mathematical operators
+ - * / \ &
Logical operators
AND OR NOT
Relational operators
= <> > < >= <=
EQ NE GT LT GE LE
![Page 20: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/20.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 21: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/21.jpg)
Predefined variablesPredefined variables
logname$ (BAAN user code)
user.type$ (User type: Normal or Super)
date$ (Current date, format DDMMYY)
time (Current time, format HHMM)
language$ (Current language code)
free$ (Free to use variable)
curr.pacc$ (Current Package Combination)
prog.name$ (Session name)
![Page 22: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/22.jpg)
Predefined functionsPredefined functions
date.num(), num.to.date$(), date.to.num()shiftl$(), shiftr$(), shiftc$()strip$()edit$()get.compnr()get.company()tt.user()getenv$()sprintf$()toupper$(), tolower$()lval(), val(), str$()form.text$()
![Page 23: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/23.jpg)
Special report variablesSpecial report variables
lattr.print
lattr.textexpand
lattr.lineno
lattr.break
lattr.enddata
lattr.prline
spool.pg.length
spool.pg.width
spool.device
![Page 24: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/24.jpg)
Special report functionsSpecial report functions
page()
to.page()
skip()
skip.to()
layout.again()
reset.suppress()
need()
![Page 25: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/25.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 26: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/26.jpg)
Embedded SQLEmbedded SQL
Select <Fields>
From <Table(s)>
Where <Condition>
Selectdo
<Action(s) on each selected record>
Selecteos
<Action(s) after last selected record>
Selectempty
<Action(s) if no records are selected>
Selecterror
<Action(s) in case of an error>
Endselect
![Page 27: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/27.jpg)
First and second degree reference First and second degree reference tablestables
Item groups
igpc dscrcuoes010
10 autos
Items
item igpccuoes001
1017 bmw
Stockmaintenance
itemcuoes020
171
![Page 28: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/28.jpg)
Reading tables with embedded SQLReading tables with embedded SQL
declaration:table tcuoes010
detail.1:before.layout:
select cuoes010.dscrfrom cuoes010where cuoes010.igpc=:cuoes001.igpcselectdoendselect
Report script Stock Maintenance
where cuoes010._index1={:cuoes001.igpc}
Item groups
Items
Stockmaintenance
![Page 29: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/29.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 30: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/30.jpg)
Own functionsOwn functions
• Type• long, double, string, domain, void
• Prototype• declaration
• Definition• functions
• Call• before.program, detail, et cetera
![Page 31: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/31.jpg)
Own functions - Own functions - type voidtype void
declaration:function fill.arrays()
detail.1:before.layout:
fill.arrays()
functions:function fill.arrays(){
tot.stock(ap1) = tot.stock(ap1) + cuoes001.stcktot.StockValue(ap1) = tot.StockValue(ap1) +(cuoes001.stck*cuoes001.spri)
}
Prototype
Call
Definition
(Not mandatory)
![Page 32: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/32.jpg)
Own functions - Own functions - type doubletype double
declaration:function double incl_vat(double spri, double perc)
double price.incl.vat
detail.1:before.layout:
price.incl.vat = incl_vat(cuoes001.spri, cuoes012.perc)
functions:function double incl_vat(double spri, double perc){
double i | local variablei = spri + (spri * (perc / 100))return i
}
Call
Definition
Prototype
![Page 33: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/33.jpg)
ArraysArrays
• Table/matrix• Maximal 4 dimensions• Data type: long, double, string• Usage: collect + print subtotals
![Page 34: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/34.jpg)
Arrays - Arrays - Declaration (1)Declaration (1)
declaration:
long tot.stock(5)
double tot.StockValue(5)
string GroupDescription(30,5)
30
tot.stock(2)
tot.StockValue(2)
GroupDescription(1,2)
![Page 35: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/35.jpg)
Arrays - Arrays - Declaration (2)Declaration (2)
declaration:
long tot.stock(5,3)
double tot.StockValue(5,3)
string GroupDescription(30,5,3)
30
tot.stock(4,2)
tot.StockValue(4,2)
GroupDescription(1,4,2)
![Page 36: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/36.jpg)
Arrays - Arrays - FillFill
before.program:ap1 = 0
before.cuoes001.igpc.1:before.layout:
ap1 = ap1 + 1GroupDescription(1,ap1)=cuoes010.dscr
detail.1:after.layout:
tot.stock(ap1) = tot.stock(ap1) + cuoes001.stcktot.StockValue(ap1) = tot.StockValue(ap1) +(cuoes001.stck*cuoes001.spri)
30
![Page 37: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/37.jpg)
Arrays - Arrays - PrintingPrinting
before.program:ap2 = 1
after.report.2:before.layout:
if ap2 <= ap1 thenlattr.print = true
elselattr.print = false
endif
after.layout:if ap2 < ap1 then
ap2 = ap2 + 1layout.again()
endif
30
![Page 38: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/38.jpg)
Macro’sMacro’s
declaration:#define MAX 5
long tot.stock(MAX)
double tot.StockValue(MAX)
string GroupDescription(30,MAX)
30
![Page 39: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/39.jpg)
AgendaAgenda
• Design Environment• Relation report/session• Relation report layout/report script• Usage of report scripts• Structure report script• BAAN-C syntax• Reading tables with embedded SQL• Own Functions• Arrays• Macros• Debugger
![Page 40: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/40.jpg)
Debugger - Debugger - UseUse
• Track errors• Run program step by step• “Trace” variables
![Page 41: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/41.jpg)
Debugger - Debugger - OptionsOptions
[s] Step
[b] “linenr” Break at “linenr.”
[t] “var” Trace “var”
[stop if] “expr” Stop in case “expr”
[stop in] “func” Stop in “function”
[g] “linenr” Go to “linenr”
[j] “func” Jump to “function”
[c] Continue
[q] Quit debugger
![Page 42: Report Scripts BaanERP 5.0c Tools. Agenda Design Environment Relation report/session Relation report layout/report script Usage of report scripts Structure](https://reader035.vdocument.in/reader035/viewer/2022081520/5697bf9b1a28abf838c92df0/html5/thumbnails/42.jpg)
The EndThe End
Report ScriptsBaanERP 5.0c Tools