Integrated Application Platform › Forums › General › Newie Lost in creating a report
- This topic has 1 reply, 2 voices, and was last updated 12 years ago by
amckinlay.
-
AuthorPosts
-
September 14, 2011 at 2:45 pm #711
Anonymous
InactiveHello, I am slowly starting to grasp this program. I have been out of programming for 20+ yrs and things have changed a bit. I am trying to general a report using a Master Detail. I have everything working except totaling the bale count. I am sure thats its something simple in the syntax that I am missing. Below is the code that I am using. Any help would be appreciated.
//SSB Load Report
#(Params
title: “SSB Load Report”
name: “ssb_load”
Params:
(Form
(ParamsSelect load_num))
QueryFormat
{
Query()
{
where = _report.GetParamsWhere(“load_num”)
return “ssb_load” $ where $ ” sort load_num”
}
Output()
{
Object(“Vert”
#(Vskip)
#(Text, ” LOAD TOTALS”, font: #(name: ‘Arial’ size: 24 weight: 800))
#(Text, ” Date Processed Load number”, font: #(name: ‘Arial’ size: 18 weight: 500))
#(“Horz”
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(date_proc, font: #(name: ‘Arial’ size: 16))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(load_num, font: #(name: ‘Arial’ size: 16 weight: 500)))
#(Vskip)
#(Vskip)
#(‘Horz’
#(Text, “Location: “, font: #(name: ‘Arial’ size: 18))
#(ld_loc, font: #(name: ‘Arial’ size: 18)))
#(Vskip)
#(Vskip)
#(Vskip)
#(Vskip)
#(Text, ” Al Cans Drink bottles Pill Bottles OW Hangers Platic Film Books Trash CB”, font: #(name: ‘Arial’ size: 12))
#(“Horz”
#(ld_al_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_drink_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_pill_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_ow_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_hanger_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_film_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_book_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_trash_wt, font: #(name: ‘Arial’ size: 12))
#(Text, ” “, font: #(name: ‘Arial’ size: 16))
#(ld_cb_wt, font: #(name: ‘Arial’ size: 12)))
#(Vskip)
#(Vskip)
#(Text, ” Store num Num bales”, font: #(name: ‘Arial’ size: 14))
)
}
After_load_num(data)
{
.Append(Object(QueryFormat
{
tot_bales: 0
Query()
{
// .tot_bales += .num_bales
return “ssb_ld_bales where load_num is ” $ Display(.Hdr.load_num)
}
Before()
{return false
}Output()
{
Object(‘Horz’
#(store_num, font: #(name: ‘Arial’ size: 14))
#(Text, ” “, font: #(name: ‘Arial’ size: 14))
#(num_bales, font: #(name: ‘Arial’ size: 14)))}
}Hdr: data))
.Append(Object(‘Vert’,
#(Vskip)
#(Vskip)
#(‘Horz’
#(Text, “Total Bales “, font: #(name: ‘Arial’ size: 14))
#(tot_bales, font: #(name: ‘Arial’ size: 14))
)))
return ‘pg’
}
})
Thanks
BennySeptember 14, 2011 at 4:33 pm #888amckinlay
KeymasterI would suggest keeping the total inside the sub-report, using the Total option in QueryFormat (see the help). Otherwise it will be hard to get the total “out” of the sub-report.
Another option is to just do a separate QueryTotal to get the total. (Somewhat redundant, but simple.)
One thing to remember is that reports run somewhat “asynchronously”. They don’t necessarily execute in the order that you might expect, making it difficult (or impossible) to pass variables around.
-
AuthorPosts
- You must be logged in to reply to this topic.