Ok,
I have a setup on my reports form that will allow you to select from 5 different options with radio buttons, and between certain dates. It keeps crashing on me, telling me that this line is not a valid filter:
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
Basically, you select a filter with the radio buttons, enter more search info from conditional buttons that appear with each different radio button, enter a start and end date (you do this everytime), and then you hit a button to run that particular report. Here is a copy of the code:
if option = 1 then 'print All ANIs
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
else if option = 2 then 'print Single ANI
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
list_invno = stritran(ani,",",crlf()) 'turn the list into a cr-lf delimited list
list_invo = alltrim(list_invno)
filter = *for_each(x,"ani = " + quote(x) ,list_invo)
filter = alltrim(filter)
filter = stritran(filter,crlf()," .or. ")
else if option = 3 then 'print Serial Number
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
list_invno = stritran(serial,",",crlf()) 'turn the list into a cr-lf delimited list
list_invo = alltrim(list_invno)
filter = *for_each(x,"serial = " + quote(x) ,list_invo)
filter = alltrim(filter)
filter = stritran(filter,crlf()," .or. ")
else if option = 4 then 'print Account List
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
filter = "between(invoice_number,[varC-"begin_inv],[varC-"end_inv])"
else if option = 5 then 'print Service Zone
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
filter = "between(invoice_number,[varC-"begin_inv],[varC-"end_inv])"
end if
'substitute the parameters in the filter expression
'filter2 = replace_parameters(filter,local_variables())
'filter3 = replace_parameters(filter1,local_variables())
filter = replace_parameters(filter,local_variables())
filter = replace_parameters(filter,local_variables())
report.preview("coin2",filter1 +filter)
Is there something i'm supposed to put on the report? The date field on the report is called "offhookdate". The date varialbe line is straight from Alpha Sports, so I shouldn't be getting this error. Any ideas on how I can fix my script?
Thanks!
Steve Hall
I have a setup on my reports form that will allow you to select from 5 different options with radio buttons, and between certain dates. It keeps crashing on me, telling me that this line is not a valid filter:
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
Basically, you select a filter with the radio buttons, enter more search info from conditional buttons that appear with each different radio button, enter a start and end date (you do this everytime), and then you hit a button to run that particular report. Here is a copy of the code:
if option = 1 then 'print All ANIs
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
else if option = 2 then 'print Single ANI
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
list_invno = stritran(ani,",",crlf()) 'turn the list into a cr-lf delimited list
list_invo = alltrim(list_invno)
filter = *for_each(x,"ani = " + quote(x) ,list_invo)
filter = alltrim(filter)
filter = stritran(filter,crlf()," .or. ")
else if option = 3 then 'print Serial Number
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
list_invno = stritran(serial,",",crlf()) 'turn the list into a cr-lf delimited list
list_invo = alltrim(list_invno)
filter = *for_each(x,"serial = " + quote(x) ,list_invo)
filter = alltrim(filter)
filter = stritran(filter,crlf()," .or. ")
else if option = 4 then 'print Account List
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
filter = "between(invoice_number,[varC-"begin_inv],[varC-"end_inv])"
else if option = 5 then 'print Service Zone
filter1 = "between(date,[varD-"begindate],[varD-"enddate])"
filter = "between(invoice_number,[varC-"begin_inv],[varC-"end_inv])"
end if
'substitute the parameters in the filter expression
'filter2 = replace_parameters(filter,local_variables())
'filter3 = replace_parameters(filter1,local_variables())
filter = replace_parameters(filter,local_variables())
filter = replace_parameters(filter,local_variables())
report.preview("coin2",filter1 +filter)
Is there something i'm supposed to put on the report? The date field on the report is called "offhookdate". The date varialbe line is straight from Alpha Sports, so I shouldn't be getting this error. Any ideas on how I can fix my script?
Thanks!
Steve Hall
Comment