Integrated Application Platform › Forums › General › Putting column totals on screen
- This topic has 6 replies, 2 voices, and was last updated 11 years, 8 months ago by
Anonymous.
-
AuthorPosts
-
September 20, 2011 at 8:52 pm #712
Anonymous
InactiveI want to thank you in advance for the help that you have given me. I am slowly learning. I have a simple problem that I cant figure out what I’m doing wrong. I want to total several columns in a table and display on screen showing current inventory. I have the Controller set up and rules that query the table. The rule function generates the data but is not filling in the fields on screen below is the code that I am trying to use:
Rule_tot_ld_drink_wt
function()
{return QueryTotal(‘ssb_load’ ‘ld_drink_wt’)
}Rule_tot_ld_al_wt
function()
{return QueryTotal(‘ssb_load’ ‘ld_al_wt’)
}Controller
{
keep_placement: true
Xstretch: 1
Ystretch: 1
Title: “SSB Inventory”
Controls:
(Vert
#(Static ‘ Wagram Paperstock SSB Inventory’, font: ‘Arial’ ,size: 18 ,weight: 600)
#(Skip)
#(Skip)
(Horz
#(Static ‘ Inventory Totals as of :’, font: ‘Arial’ ,size: 18 ,weight: 300)
)
#(Skip)
#(Skip)
#(Skip)
#(Skip)
#(tot_ld_al_wt)
#(tot_ld_drink_wt)
)}
Thanks
BennySeptember 20, 2011 at 9:31 pm #889amckinlay
KeymasterRules only work in records. To use them in a screen you need to use a RecordControl. e.g.
Controls: (Record (Vert
...
))The RecordControl only has to be around the data fields, but then you’d have to put them in another Vert so it’s easier to wrap it around everything.
September 21, 2011 at 3:26 pm #890Anonymous
InactiveI tried that and now nothing prints to the window. Below is a simplified version just to get it working. Let me know if there is another way to put totaled columns to the screen. I tried it without the Object in front of the Vert ans was getting a syntax error. Im still using the same rules posted above.
Controller
{
Xstretch: 1
Ystretch: 1
Title: “SSB Inventory”
Controls:
Record(
Object(Vert
(tot_ld_al_wt)
(tot_ld_drink_wt)
(Static ‘ Wagram Paperstock SSB Inventory’, justify: ‘CENTER’, font: ‘Arial’ ,size: 18 ,weight: 600)
))
}September 21, 2011 at 3:29 pm #891Anonymous
InactiveOh. I see one prob. I had an extra set of (). but removind the Object in front of the Vert still is not working for me.
September 21, 2011 at 3:32 pm #892Anonymous
InactiveNow I am getting empty fields on the screen. The Rules still done seem to be working.
September 21, 2011 at 8:17 pm #893amckinlay
KeymasterSorry, I missed one part. For some reason (long standing quirk), the rules don’t run until you Set the RecordControl. Try adding:
New()
{
.Data.Set(Record())
}(“Data” is the name of the RecordControl)
September 22, 2011 at 1:23 am #894Anonymous
InactiveThanks. That seems to have done the trick. I will fully implement it tomorrow. Its help like this that sold me on using Suneido. I should be able to finish this project now.
-
AuthorPosts
- You must be logged in to reply to this topic.