I have multi value filter for a report.
Below is my code to product the report:
<%a5
if (eval_valid("bill_month") = .F.) then
goto skipreport
'and (eval_valid("bill_year") = .F.) and (eval_valid("sponsorship_type") = .F.)
else
'?"There is a parameter pass. By SEAMS"
if sponsorship_type ="SC" then
dim vFilter as c
dim vOrder as c
dim vFilename as c
report = "rptBillMonthlyScholar2_W"
vFilter= " bill_year = "
vFilter = vFilter + alltrim(str( bill_year ))
vFilter = vFilter + " and bill_month = "
vFilter = vFilter + alltrim(str( bill_month ))
'vFilter = vFilter + " and Sponsorship_Type_Sponsorship_Type = '"
'vFilter = vFilter + "'" + alltrim(sponsorship_type) + "' "
' vfilter=""
vOrder = " STUDENT_Full_Name, STUDENT_New_IC "
vFilename = session.session_folder + chr(92) + "BillPrintStudent.pdf"
vFilename = report.saveas(report,"pdf",vFilter,vOrder,vFilename,.f.)
IF file.exists(vFilename)
response.redirect(session.session_url + "BillPrintStudent.pdf?" + time("hms3"))
END IF
else
dim vFilter as c
dim vOrder as c
dim vFilename as c
report = "rptBillMonthlyLoan_Web"
vFilter= " bill_year = "
vFilter = vFilter + alltrim(str( bill_year ))
vFilter = vFilter + " and bill_month = "
vFilter = vFilter + alltrim(str( bill_month ))
'vFilter = vFilter + " and Sponsorship_Type_Sponsorship_Type = '"
'vFilter = vFilter + "'" + alltrim(sponsorship_type) + "'"
' vfilter=""
vOrder = " STUDENT_Full_Name, STUDENT_New_IC "
vFilename = session.session_folder + chr(92) + "BillPrintStudent.pdf"
vFilename = report.saveas(report,"pdf",vFilter,vOrder,vFilename,.f.)
IF file.exists(vFilename)
response.redirect(session.session_url + "BillPrintStudent.pdf?" + time("hms3"))
END IF
end if
goto ReportEnd
end if
skipreport:
?"There was an error. Unable to print report. By SEAMS"
ReportEnd:
%>
I got the following error:
Amyuni Low Level Print:
Layout name: rptBillMonthlyScholar2_W
Layout type: report
Invalid report filter expression: 'bill_year = 2008 and bill_month = 7'."
Any help is very appreciated
Below is my code to product the report:
<%a5
if (eval_valid("bill_month") = .F.) then
goto skipreport
'and (eval_valid("bill_year") = .F.) and (eval_valid("sponsorship_type") = .F.)
else
'?"There is a parameter pass. By SEAMS"
if sponsorship_type ="SC" then
dim vFilter as c
dim vOrder as c
dim vFilename as c
report = "rptBillMonthlyScholar2_W"
vFilter= " bill_year = "
vFilter = vFilter + alltrim(str( bill_year ))
vFilter = vFilter + " and bill_month = "
vFilter = vFilter + alltrim(str( bill_month ))
'vFilter = vFilter + " and Sponsorship_Type_Sponsorship_Type = '"
'vFilter = vFilter + "'" + alltrim(sponsorship_type) + "' "
' vfilter=""
vOrder = " STUDENT_Full_Name, STUDENT_New_IC "
vFilename = session.session_folder + chr(92) + "BillPrintStudent.pdf"
vFilename = report.saveas(report,"pdf",vFilter,vOrder,vFilename,.f.)
IF file.exists(vFilename)
response.redirect(session.session_url + "BillPrintStudent.pdf?" + time("hms3"))
END IF
else
dim vFilter as c
dim vOrder as c
dim vFilename as c
report = "rptBillMonthlyLoan_Web"
vFilter= " bill_year = "
vFilter = vFilter + alltrim(str( bill_year ))
vFilter = vFilter + " and bill_month = "
vFilter = vFilter + alltrim(str( bill_month ))
'vFilter = vFilter + " and Sponsorship_Type_Sponsorship_Type = '"
'vFilter = vFilter + "'" + alltrim(sponsorship_type) + "'"
' vfilter=""
vOrder = " STUDENT_Full_Name, STUDENT_New_IC "
vFilename = session.session_folder + chr(92) + "BillPrintStudent.pdf"
vFilename = report.saveas(report,"pdf",vFilter,vOrder,vFilename,.f.)
IF file.exists(vFilename)
response.redirect(session.session_url + "BillPrintStudent.pdf?" + time("hms3"))
END IF
end if
goto ReportEnd
end if
skipreport:
?"There was an error. Unable to print report. By SEAMS"
ReportEnd:
%>
I got the following error:
Amyuni Low Level Print:
Layout name: rptBillMonthlyScholar2_W
Layout type: report
Invalid report filter expression: 'bill_year = 2008 and bill_month = 7'."
Any help is very appreciated
Comment