In the course of making numerous small tweaks to my application, I seem to have somehow broken the ability to do filtering in reports. My application is such that I have an AfterUpdateRecords event to generate a report to a file, send it in an e-mail, then delete the file via the following code:
I could swear that the above code functioned perfectly last week (and even confirmed this by referencing an older backup), but now every time I trigger it, I get e-mailed a report that says "Report does not contain any records". If I change the filter to explicitly pick an existing record by ID (i.e.: filter = "ID = 1"), I get the same results. Only when I change the filter to be filter = "" do I get anything different (I get all the records). Being a numeric field, I also tried converting ID and Args.DataSubmitted.R1.ID using various functions, prior to concatenating it into a final filter expression.
Thinking it may be some WAS issue, I tried the same by opening the report in Design Mode, going to the Report menu and selecting Select Records. Attempting to use the same filters (even ID = n, where n=some record's ID) would result in a message when I generate the report stating "There are no pages in the layout". I even tried building it using the Expression Builder with no positive results.
Am I missing something embarassingly obvious?
Regards,
Tarek
Code:
function AfterUpdateRecords as v (Args as P, PageVariables as P) with PageVariables name = "notification@c:\alpha five project\notification.dbf" format = "PDF" filter = "ID = " + Args.DataSubmitted.R1.ID order = "" filename = "c:\notification.pdf" report.saveas(name,format,filter,order,filename,.F.) addr = "[email protected]" subject = "Notification Update" body = "Please see attached file." email_send(addr,subject,body,filename,"","",.T.,format,"","Default",.F.,.T.) file.remove("c:\notification.pdf") end with end function
Thinking it may be some WAS issue, I tried the same by opening the report in Design Mode, going to the Report menu and selecting Select Records. Attempting to use the same filters (even ID = n, where n=some record's ID) would result in a message when I generate the report stating "There are no pages in the layout". I even tried building it using the Expression Builder with no positive results.
Am I missing something embarassingly obvious?
Regards,
Tarek
Comment