I have a dropdown field in the search part of a grid which is based on a calculated field below
Warranty_Filter = iif(warranty_expiry-Date()<=30.and.warranty_expiry-Date()>=0,"30 and under",iif(warranty_expiry-Date()<=60.and.warranty_expiry-Date()>=0,"60 and under",iif(warranty_expiry-Date()<=90.and.warranty_expiry-Date()>=0,"90 and under",iif(warranty_expiry-Date()>90,"90 and Over",iif(warranty_expiry-Date()<0,"Overdue","PastDue")))))
The search dropdown contains '30 and under', 60 and under' etc.... When the search criteria is selected the grid is filtered according to the above code.
I have placed an advance button at the bottom of the page which points to warranty_print.a5w containing
The PDF report appears but all entries in the database are listed and not just the filtered ones.
I know i have to carry over the filter perhaps in the form of a session variable or some other way. Can someone please advise me how i can implement the filter code for the correct filtered results to appear on the PDF report.
Thanks
Denis
Warranty_Filter = iif(warranty_expiry-Date()<=30.and.warranty_expiry-Date()>=0,"30 and under",iif(warranty_expiry-Date()<=60.and.warranty_expiry-Date()>=0,"60 and under",iif(warranty_expiry-Date()<=90.and.warranty_expiry-Date()>=0,"90 and under",iif(warranty_expiry-Date()>90,"90 and Over",iif(warranty_expiry-Date()<0,"Overdue","PastDue")))))
The search dropdown contains '30 and under', 60 and under' etc.... When the search criteria is selected the grid is filtered according to the above code.
I have placed an advance button at the bottom of the page which points to warranty_print.a5w containing
Code:
dim filter as C dim order as C dim filename as C Filter = "" Order = "" 'Print Report filename = session.session_folder + chr(92) + "tempreport.pdf" filename = report.saveas("rptWarranty_Rep@<adb_path>\assets.ddd", "pdf", filter, order, filename,.f.) if file.exists(filename) response.redirect(session.session_url + "tempreport.pdf?" + time("hms3")) end if
I know i have to carry over the filter perhaps in the form of a session variable or some other way. Can someone please advise me how i can implement the filter code for the correct filtered results to appear on the PDF report.
Thanks
Denis