Can any one help me with this code, its almost there but not quite working....
I want my Client variable to be filled with one client, when the card number matchs...... so I have my filter as the ULINK (CU)
When i run it the Client variable fills with a list of all of the clients, so I get this error :---
Errors in: event.AfterValidate code:
Amyuni Low Level Print:
Layout name: points_link@c:\company\canc\alphadat...norad_link.set
Layout type: report
Invalid report filter expression: '(between(norad->Depart_date,ctod("01/01/2009"),ctod("20/07/2009")) ) .and. (norad->Client_id = "Amsafe Bridport Ltd Amsafe Bridport Ltd Amsafe Bridport Ltd Gearbulk (UK) Ltd " )'.
This is driving me mad, please please please HELP...
Thanks
Miles
THE CODE......
fromdate = CurrentForm.Controls.From
todate = CurrentForm.Controls.to
cu = session.card_No
dim client as c
dim vFilter as C
vFilter = "(\""+cu+"\")"
client = table.external_record_content_get("[pathalias.adb_path]\users.dbf", "client_id","client_id",vfilter)
Dim global starting_date as c = currentform.controls.from.value
Dim global ending_date as c = currentform.controls.to.value
IF eval_valid("fromdate") = .f. .or. eval_valid("todate") = .f. .or. eval_valid("cu") = .f. Then
goto skipreport
end if
dim filter as c
dim order as c
Filter = "(between(norad->Depart_date,ctod(\""+fromdate+"\"),ctod(\""+todate+"\")) ) .and. (norad->Client_id = \""+client+"\" )"
Order = "norad->Depart_date"
Dim filename as c
filename = session.session_folder + "tempreport.html"
filename = report.saveas("points_link@[PathAlias.ADB_Path]\norad_link.set","html",filter,order,filename,.f.)
if file.exists(filename)
currentform.RedirectTarget = session.session_url + "tempreport.html?" + time("hms3")
end if
skipreport:
I want my Client variable to be filled with one client, when the card number matchs...... so I have my filter as the ULINK (CU)
When i run it the Client variable fills with a list of all of the clients, so I get this error :---
Errors in: event.AfterValidate code:
Amyuni Low Level Print:
Layout name: points_link@c:\company\canc\alphadat...norad_link.set
Layout type: report
Invalid report filter expression: '(between(norad->Depart_date,ctod("01/01/2009"),ctod("20/07/2009")) ) .and. (norad->Client_id = "Amsafe Bridport Ltd Amsafe Bridport Ltd Amsafe Bridport Ltd Gearbulk (UK) Ltd " )'.
This is driving me mad, please please please HELP...
Thanks
Miles
THE CODE......
fromdate = CurrentForm.Controls.From
todate = CurrentForm.Controls.to
cu = session.card_No
dim client as c
dim vFilter as C
vFilter = "(\""+cu+"\")"
client = table.external_record_content_get("[pathalias.adb_path]\users.dbf", "client_id","client_id",vfilter)
Dim global starting_date as c = currentform.controls.from.value
Dim global ending_date as c = currentform.controls.to.value
IF eval_valid("fromdate") = .f. .or. eval_valid("todate") = .f. .or. eval_valid("cu") = .f. Then
goto skipreport
end if
dim filter as c
dim order as c
Filter = "(between(norad->Depart_date,ctod(\""+fromdate+"\"),ctod(\""+todate+"\")) ) .and. (norad->Client_id = \""+client+"\" )"
Order = "norad->Depart_date"
Dim filename as c
filename = session.session_folder + "tempreport.html"
filename = report.saveas("points_link@[PathAlias.ADB_Path]\norad_link.set","html",filter,order,filename,.f.)
if file.exists(filename)
currentform.RedirectTarget = session.session_url + "tempreport.html?" + time("hms3")
end if
skipreport:
Comment