I am trying to use a button to save a PDF report with arguments. I am successful in saving the report without the arguments, but am too newbie to get it to work with arguments. I have been studying this Alpha help: http://support.alphasoftware.com/alp..._.SAVEAS().htm
The example in that article for using arguments is:
The code I'm trying to run is below. It works fine if I leave out the arguments part. Do I need to open an sql connection or something? If anyone can spot my problem, can you let me know. I'm being pretty clutsy about using arguments. Thanks!
The example in that article for using arguments is:
Code:
This script saves copy of the Invoice report with an argument. You can add as many arguments to the arguments collection as you want. DIM myargs as SQL::arguments myargs.add("whatcity","London") report.saveas("report1", "", "", .f., .f., myargs)
Code:
function SavePOReportNoItems as c (e as p) dim reportLayoutName as c reportLayoutName = "PurchaseOrderWithoutIems@web_chs_alpha.alb" dim reportFileName as c reportFileName = "PO_"+e._currentRowDataNew.PO_NUM+".pdf" dim reportSavePath as c reportSavePath = "C:\TestSaveReports"+"\\"+reportFileName DIM args as SQL::arguments args.add("whatponum",e._currentRowDataNew.PO_NUM) args.add("whatpocode",e._currentRowDataNew.PO_CODE) report.saveas(reportLayoutName, "PDF", "" , "" , reportSavePath,.F.,,args) 'The line below works with the args removed. 'report.saveas(reportLayoutName, "PDF", "" , "" , reportSavePath,.F.) SavePOReportNoItems = "alert('The report has been saved.');" end function
Comment