Integrated Application Platform › Forums › General › Printing from a button › Re: Re: Printing from a button
I implemented the code as you suggested. It seems to almost work. It is reading the bill_num into the query but the query does not find that record. It acts like the current record has not been saved yet. If I change the id= line to id =.Access.GetData().bill_num – 1, It works fine to bring up the prev record. Below is the code:
Controller
{
Controls:
#(Access ‘bol’
startNew: true
title: ‘Bill of Lading’
nextNum: #(field: bill_num,
table: bol_nextnum, table_field: nextnum)
(Vert
(Horz
(Static, ‘Cosignee Name:’)
#(Key “cosignee_db” field:”cosign_name” fillin:(shipper_num, cosign_name, cosign_address, cosign_city, cosign_st, cosign_zip)))
(cosign_address)
(Horz
cosign_city (Skip 2) cosign_st (Skip 2) cosign_zip)
Skip
(Horz (Skip 400)(Static, ‘Bill of Lading Information’, font: ‘Arial’, size: 16, weight: 600))
Skip
Skip
(Horz bill_date (Skip 450) bill_num)
cosignee_name
(Horz (Static, ‘ ‘) export (Skip 535) ship_num)
Skip
(Horz carrier (Skip 343) trailer_num)
Skip
material
Skip
booking
po
release
load
vessel
voyage
seal
Skip
gross_wt
tare_wt
net_wt
Skip
Skip
(Horz (Skip 450)
(Button ‘Print’, size: 16))
)
)
On_Print()
{
id = .Access.GetData().bill_num
Dialog(.Window.Hwnd, Object(‘Params’
Object(QueryFormat
{
Query()
{
Alert(.Data.id)
return “bol where bill_num is ” $ Display(.Data.id) $ ” sort bill_num”
}
Output()
{
return Object(“Vert”
#(“Text”, “This is a test”)
#(bill_num))
Print(‘Test’)
}
Before()
{
Object(“Vert”
#(“Text”, “Before”))
}
}
Data: Object(id: id)
)
title: “BOL Print”
name: “Bol_bol_print”
))
}
}
Sorry to be causing so much trouble.
Benny