The following xbasic code is an attempt to get the start date and end date into global variables vcStartdate and vcEnddate and then to place these variables on a report.
The problem is that after selecting the date range from the record list box and selecting preview I get a response that "there are no records in the layout". Ther are records there but this code does not seem to hold the dates selected.
'Preview a report, label, letter, form or browse layout. You can specify which records to preview.
filter = " (Var->vcStartdate >= [varC->prms.Parameter1] ) .AND. (Var->vcEnddate prms.Parameter2] )"
get_parameters_string = \cr\lf\cr\lf\cr\lf
Parameter2|Var-vcEnddate|Character|Record List-List Box||\cr\lf\cr\lf\cr\lf
%string%
ok_label = "&OK"
cancel_label = "&Cancel"
dialog_title = "Parameters"
'Prompt for parameter values. Store results in a 'dot' variable called 'prms'
dim prms as p
prms = ui_get_parameters(dialog_title,get_parameters_string,ok_label,cancel_label)
if prms.last_button_pressed = "OK" then
'Replace parameters in the filter with actual values
query.filter = replace_parameters(filter,local_variables())
query.order = ""
else
end
end if
'Prompt user whether to print, or preview the layout. Set default to Preview
prompt_result = ui_get_print_or_preview("Preview ")
If prompt_result = "Print" then
:Report.Print("CoG Consolidated",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("CoG Consolidated",query.filter,query.order)
End if
Any ideas
Alan
The problem is that after selecting the date range from the record list box and selecting preview I get a response that "there are no records in the layout". Ther are records there but this code does not seem to hold the dates selected.
'Preview a report, label, letter, form or browse layout. You can specify which records to preview.
filter = " (Var->vcStartdate >= [varC->prms.Parameter1] ) .AND. (Var->vcEnddate prms.Parameter2] )"
get_parameters_string = \cr\lf\cr\lf\cr\lf
Parameter2|Var-vcEnddate|Character|Record List-List Box||\cr\lf\cr\lf\cr\lf
%string%
ok_label = "&OK"
cancel_label = "&Cancel"
dialog_title = "Parameters"
'Prompt for parameter values. Store results in a 'dot' variable called 'prms'
dim prms as p
prms = ui_get_parameters(dialog_title,get_parameters_string,ok_label,cancel_label)
if prms.last_button_pressed = "OK" then
'Replace parameters in the filter with actual values
query.filter = replace_parameters(filter,local_variables())
query.order = ""
else
end
end if
'Prompt user whether to print, or preview the layout. Set default to Preview
prompt_result = ui_get_print_or_preview("Preview ")
If prompt_result = "Print" then
:Report.Print("CoG Consolidated",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("CoG Consolidated",query.filter,query.order)
End if
Any ideas
Alan
Comment