I have an application in which I need a user to print a (project) report, but before the actual printing certain things need to be checked on the server. One way to try to do this is to have the operator click a button which has, as its click event, the synchronous execution of two Action Javascript routines (the first to check, the second to print). Problem with this is of course that if the conditions are NOT met (so that the report will end up being empty) then I have no way (at least I am not aware of one) to stop the second routine from executing. I watched the long video in which Selwyn shows how to separate Ajax callbacks but that won't seem to work where the second one is the "Open report" action.
Then I ran across the "a5_xb_runReport" function and am trying to use that in an Ajax callback. I've copied the code online and have the following function:
my code calls this as an Ajax callback only if there is something to print.
Unfortunately, this doesn't work. In Live Preview I get a Javascript error message (a5_xb_runReport not recognized, or something like that) and when I try to run my routine from a browser nothing happens. I know the callback is working because I prepended an alert message to the js string and it shows in the browser, but the report doesn't print. Can you use a5_xb_runReport with Project reports? If so, then do I have the syntax of the reportName wrong?
Any pointers appreciated.
Then I ran across the "a5_xb_runReport" function and am trying to use that in an Ajax callback. I've copied the code online and have the following function:
Code:
function PrintInvoiceRun as c (e as p) dim params as P params.reportName = "[email protected]" params.initialView = "pdf" params.sqlFilter = "Invoicing = 1" dim js as C = "a5_xb_runReport(params);" PrintInvoiceRun = js end function
Unfortunately, this doesn't work. In Live Preview I get a Javascript error message (a5_xb_runReport not recognized, or something like that) and when I try to run my routine from a browser nothing happens. I know the callback is working because I prepended an alert message to the js string and it shows in the browser, but the report doesn't print. Can you use a5_xb_runReport with Project reports? If so, then do I have the syntax of the reportName wrong?
Any pointers appreciated.
Comment