Select a Report to Print

Description

The following Xdialog box provides a convenient list of available reports to print.

images/XB_Select_a_report_to_print.gif
DIM SHARED a_reports[100] as C
DIM SHARED varC_result as C
report_list = a5.Report_Enum(2)
report_list = sortsubstr(report_list,crlf())
a_reports.initialize(report_list)
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("Select a Report to Print",<<%dlg%
{frame=1,2:Select a Report to Print}
{sp=.5}
{lf=1}
{region}
[.80,15reportlist^#a_reports!select_report];
{endregion};
{region}
{justify=center}
[.80,1report_name^#reportlist]
{lf=1};
{sp=3}<*15=ok_button_label!OK>{sp=2}<15=cancel_button_label!CANCEL>
{endregion};
%dlg%,<<%code%
if a_dlg_button="select_report" then
    a_dlg_button=""
end if
if a_dlg_button = "OK" then
    if (report_name <> "") then
        preview_report(report_name)
    end if
end if
%code%)

Thanks To

Keith Hubert