Please see below for an xbasic code that I have designed to print my reports.
I have check boxes that I use to select each account number that I call "depcomb". What I want to do is this, since I am printing in a duplex format I want each account that I checked to print and return to the previous state and then fetch the next checked "depcomb" and print, kind of a print and return.
I want it this way because if I dont do like this, I will have to check the checkboxes one after and print after each checked box is finished printing. Time consuming indeed. Could someone please help me to automate this?
==============================================
'Preview a report, label, letter, form or browse layout. You can specify which records to preview.
filter = " (Depcomb = [varCMulti->prms.Parameter1] )"
get_parameters_string = <<%string%
Parameter1|Depcomb|Character|Check Box-List Box|000000|=table.external_record_content_get("lkupdpt","Depcomb","Depcomb",".t. .and. unique_key_value()")
%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 Print
prompt_result = ui_get_print_or_preview("Print")
If prompt_result = "Print" then
:Report.Print("Report_portrait-monthy",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("Report_portrait-monthy",query.filter,query.order)
End if
===========================================
Thanks
I have check boxes that I use to select each account number that I call "depcomb". What I want to do is this, since I am printing in a duplex format I want each account that I checked to print and return to the previous state and then fetch the next checked "depcomb" and print, kind of a print and return.
I want it this way because if I dont do like this, I will have to check the checkboxes one after and print after each checked box is finished printing. Time consuming indeed. Could someone please help me to automate this?
==============================================
'Preview a report, label, letter, form or browse layout. You can specify which records to preview.
filter = " (Depcomb = [varCMulti->prms.Parameter1] )"
get_parameters_string = <<%string%
Parameter1|Depcomb|Character|Check Box-List Box|000000|=table.external_record_content_get("lkupdpt","Depcomb","Depcomb",".t. .and. unique_key_value()")
%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 Print
prompt_result = ui_get_print_or_preview("Print")
If prompt_result = "Print" then
:Report.Print("Report_portrait-monthy",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("Report_portrait-monthy",query.filter,query.order)
End if
===========================================
Thanks
Comment