I have a button on a form that saves a report using the Report.Saveas routine. The sample of code is below:
dim filter as c
dim where as c
dim rptdate as c
dim rptvalue as c
dim rptcustref as c
DIM wherewhat AS C
topparent.commit()
Ordernum = topparent:Order_number.value
filter = "Order_number="+"'"+trim(ordernum)+"'"
where = trim(lookupc("F","100","Quote_location","master file","Co_Num"))
rptdate = dtoc(topparent:Date.value,"6-")
rptvalue = substr(topparent:Ref.value,1,15)
rptcustref = trim(topparent:Tag_Num.value)
what = rptvalue+"{"+rptdate+"}"+"{"+trim(rptcustref)+"}"+"{"+trim(Ordernum)+"}"
wherewhat = where+what
Report.saveas("Customer Quote","PDF",filter,"",wherewhat,.f.)
This works great and allows me to save the report with any naming convention I dictate. The problem is I'm trying to free up real estate on my form and I'm trying to move these options to a custom menu. I had to change the code a bit as you can see below:
dim filter as c
dim where as c
dim rptdate as c
dim rptvalue as c
dim rptcustref as c
DIM wherewhat AS C
:Order_Entry.commit()
Ordernum = Order_Entry:Order_number.value
filter = "Order_number="+"'"+trim(ordernum)+"'"
where = trim(lookupc("F","100","Quote_location","master file","Co_Num"))
rptdate = dtoc(Order_Entry:Date.value,"6-")
rptvalue = substr(Order_Entry:Ref.value,1,15)
rptcustref = trim(Order_Entry:Tag_Num.value)
what = rptvalue+"{"+rptdate+"}"+"{"+trim(rptcustref)+"}"+"{"+trim(Ordernum)+"}"
wherewhat = where+what
Report.saveas("Customer Quote","PDF",filter,"",wherewhat,.f.)
This code works fine until the Report.saveas command is initiated. The program hangs and I have to end A5 and restart. Was wondering if anyone can recreate this or see if I have an error in my coding. I have debugged and all variables fill as expected.
Thanks for any assistance.
dim filter as c
dim where as c
dim rptdate as c
dim rptvalue as c
dim rptcustref as c
DIM wherewhat AS C
topparent.commit()
Ordernum = topparent:Order_number.value
filter = "Order_number="+"'"+trim(ordernum)+"'"
where = trim(lookupc("F","100","Quote_location","master file","Co_Num"))
rptdate = dtoc(topparent:Date.value,"6-")
rptvalue = substr(topparent:Ref.value,1,15)
rptcustref = trim(topparent:Tag_Num.value)
what = rptvalue+"{"+rptdate+"}"+"{"+trim(rptcustref)+"}"+"{"+trim(Ordernum)+"}"
wherewhat = where+what
Report.saveas("Customer Quote","PDF",filter,"",wherewhat,.f.)
This works great and allows me to save the report with any naming convention I dictate. The problem is I'm trying to free up real estate on my form and I'm trying to move these options to a custom menu. I had to change the code a bit as you can see below:
dim filter as c
dim where as c
dim rptdate as c
dim rptvalue as c
dim rptcustref as c
DIM wherewhat AS C
:Order_Entry.commit()
Ordernum = Order_Entry:Order_number.value
filter = "Order_number="+"'"+trim(ordernum)+"'"
where = trim(lookupc("F","100","Quote_location","master file","Co_Num"))
rptdate = dtoc(Order_Entry:Date.value,"6-")
rptvalue = substr(Order_Entry:Ref.value,1,15)
rptcustref = trim(Order_Entry:Tag_Num.value)
what = rptvalue+"{"+rptdate+"}"+"{"+trim(rptcustref)+"}"+"{"+trim(Ordernum)+"}"
wherewhat = where+what
Report.saveas("Customer Quote","PDF",filter,"",wherewhat,.f.)
This code works fine until the Report.saveas command is initiated. The program hangs and I have to end A5 and restart. Was wondering if anyone can recreate this or see if I have an error in my coding. I have debugged and all variables fill as expected.
Thanks for any assistance.
Comment