Dear all,
I am having problems getting a report printed on the web as a pdf doc.
As an example I used the PrintInvoice component of Alpasports and renamed the logical names to the variables that I am using.
Code:
IF eval_valid("SupportCallnr") = .f. then
goto skipreport
end if
dim filter as C
dim order as C
dim callnum as C
dim filename as C
'since SupportCallnr is a multi-select dropdownbox, it is actually an array that contains the selected values.
callnum = Supportcallnr.dump()
callnum = remove_blank_lines(callnum)
callnum = *for_each(x,"callnr = " + quote (x) , callnum)
filter = stritran(alltrim(callnum), crlf()," .or. ")
Order = ""
filename = session.session_folder + chr(92) + "tempreport.pdf"
filename = report.saveas("SupportCall@[PathAlias.ADB_Path]\supportcall.set", "pdf", filter, order, filename,.f.)
if file.exists(filename)
currentform.RedirectTarget = session.session_url + "tempreport.pdf?" + rand_string(5)
end if
skipreport:
And the doument that starts the print task is the following:
if eval_valid("SupportCallnr")
dim filter as c
dim order as c
Filter = "Callnr = " + quote(Supportcallnr)
Order = ""
Dim filename as c
filename = session.session_folder + chr(92) + "tempreport.pdf"
filename = report.saveas("Supportcall@[PathAlias.ADB_Path]\supportcall.set","pdf", filter, order, filename,.f.)
if file.exists(filename)
response.redirect(session.session_url + "tempreport.pdf?" + time("hms3"))
end if
else
? "Error: You must call this page with a query string that specifies the Supportcall number.<br>"
? "For example: " + request.script_name + "?invoiceNumber=000001<br>"
end if
%><meta content="MSHTML 6.00.2900.2873" name=GENERATOR></head>
<body></body></html>
My questions:
- is the code right?
- how do the to docs work together?? The first = (component in page) and second is just a page with code (like the example in Alkphasports PrintMultipleInvoice)
Your help so much appreciated!
Best regards, Edwin Middelkoop
I am having problems getting a report printed on the web as a pdf doc.
As an example I used the PrintInvoice component of Alpasports and renamed the logical names to the variables that I am using.
Code:
IF eval_valid("SupportCallnr") = .f. then
goto skipreport
end if
dim filter as C
dim order as C
dim callnum as C
dim filename as C
'since SupportCallnr is a multi-select dropdownbox, it is actually an array that contains the selected values.
callnum = Supportcallnr.dump()
callnum = remove_blank_lines(callnum)
callnum = *for_each(x,"callnr = " + quote (x) , callnum)
filter = stritran(alltrim(callnum), crlf()," .or. ")
Order = ""
filename = session.session_folder + chr(92) + "tempreport.pdf"
filename = report.saveas("SupportCall@[PathAlias.ADB_Path]\supportcall.set", "pdf", filter, order, filename,.f.)
if file.exists(filename)
currentform.RedirectTarget = session.session_url + "tempreport.pdf?" + rand_string(5)
end if
skipreport:
And the doument that starts the print task is the following:
if eval_valid("SupportCallnr")
dim filter as c
dim order as c
Filter = "Callnr = " + quote(Supportcallnr)
Order = ""
Dim filename as c
filename = session.session_folder + chr(92) + "tempreport.pdf"
filename = report.saveas("Supportcall@[PathAlias.ADB_Path]\supportcall.set","pdf", filter, order, filename,.f.)
if file.exists(filename)
response.redirect(session.session_url + "tempreport.pdf?" + time("hms3"))
end if
else
? "Error: You must call this page with a query string that specifies the Supportcall number.<br>"
? "For example: " + request.script_name + "?invoiceNumber=000001<br>"
end if
%><meta content="MSHTML 6.00.2900.2873" name=GENERATOR></head>
<body></body></html>
My questions:
- is the code right?
- how do the to docs work together?? The first = (component in page) and second is just a page with code (like the example in Alkphasports PrintMultipleInvoice)
Your help so much appreciated!
Best regards, Edwin Middelkoop
Comment