No matter what I do, This report prints a blank every other time I print it. I can pick the same paramaters each time and it prints it blank as if there were no records. It dims the Fields at the start of it running each time - so there has to be something else i am missing.
DIM SHARED v_Project as C
DIM Shared v_Proj_no as C
DIM SHARED v_Lessor as C
DIM Shared V_Vert_Pugh as L
DIM Shared v_Horiz_Pugh as L
DIM Shared v_Cont_Drill as L
dim SHARED V_Exp_Datefrom as D
dim shared v_Exp_dateto as D
dim shared v_Option_to as D
dim shared v_Option_expFrom as D
DIM SHARED varC_result as C
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
DIM v_Proj_no_rl_def_orig as C
v_Proj_no_rl_def_orig = "kl=project,{keylist_build(\"H=.05,1:40[Project]\",''+Proj_no,left(''+Project,40))}{Project >= [varC->v_Project]}"
DIM v_Proj_no_rl_def as C
v_Proj_no_rl_def = replace_parameters(v_Proj_no_rl_def_orig,local_variables())
varC_result = ui_dlg_box("Select Filters For Pugh Report-Leave Blank to Select All",<<%dlg%
{region}
Proejct:| [.40v_Project!v_Project_changed];
| [%@v_Proj_no_rl_def%.40,5v_Proj_no];
Lessor Name or Part of Name:| [.40v_Lessor];
Vertical Pugh?: Yes Only | (40V_Vert_Pugh);
Horizontal_Pugh: Yes Only| (40v_Horiz_Pugh);
Continous Drilling?:Yes Only| (40v_Cont_Drill);
Expiration Date From:| [%DATE;P=popup.calendar(dtoc(V_Exp_Datefrom));I=popup.calendar%.15V_Exp_Datefrom!V_Exp_Datefrom_*];
Expiration Date To:| [%DATE;P=popup.calendar(dtoc(v_Exp_Dateto));I=popup.calendar%.15v_Exp_Dateto!v_Exp_Dateto_*];
Option Expiration From:| [%DATE;P=popup.calendar(dtoc(v_Option_expFrom));I=popup.calendar%.15v_Option_expFrom!v_Option_expfrom_*];
Option Expiration To:| [%DATE;P=popup.calendar(dtoc(v_Option_To));I=popup.calendar%.15v_Option_to!v_Option_to_*];
{endregion};
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%,<<%code%
If a_dlg_button = "v_Project_changed" then
v_Proj_no_rl_def = replace_parameters(v_Proj_no_rl_def_orig,local_variables())
a_dlg_button = ""
end if
if left(a_dlg_button,15) = "V_Exp_Datefrom_" then
if a_dlg_button = "V_Exp_Datefrom_killfocus" then
V_Exp_Datefrom = ctod(dtoc(V_Exp_Datefrom))
end if
a_dlg_button = ""
end if
if left(a_dlg_button,13) = "v_Exp_Dateto_" then
if a_dlg_button = "v_Exp_Dateto_killfocus" then
v_Exp_Dateto = ctod(dtoc(v_Exp_Dateto))
end if
a_dlg_button = ""
end if
if left(a_dlg_button,12) = "v_Option_To_" then
if a_dlg_button = "v_Option_To_killfocus" then
v_Option_To = ctod(dtoc(v_Option_To))
end if
a_dlg_button = ""
end if
if left(a_dlg_button,17) = "v_Option_expFrom_" then
if a_dlg_button = "v_Option_expFrom_killfocus" then
v_Option_expFrom = ctod(dtoc(v_Option_expFrom))
end if
a_dlg_button = ""
end if
%code%)
dim global v_horiz as C
dim global v_Vert as C
dim global v_Cont as C
v_Horiz = If(v_Horiz_Pugh=.t.,"YES","")
v_Vert = if (V_Vert_Pugh=.t.,"YES","")
v_Cont = if(v_Cont_Drill=.t.,"YES","")
dim global v_EDateFrom as D
dim global V_EDateTo as D
dim global v_Edate_optFrom as D
dim Global V_Edate_OptTo as D
v_EDateFrom = if(V_Exp_Datefrom={//},{01/01/1990},V_Exp_Datefrom)
v_EDateTo = If(v_Exp_dateto={/ / },{12/31/2100},v_Exp_dateto)
v_Edate_optFrom = if(v_Option_expFrom={//},{01/01/1990},v_Option_expFrom)
V_Edate_OptTo = if(V_Edate_OptTo={//},{12/31/2100},v_Option_to)
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=Var->varC_result=\"OK\"") THEN
'Print a report, label, letter, form or browse layout. You can specify which records to print.
query.filter="(Proj_no = val(Var->v_Proj_no) ).and.((lease_Info->Lease_Expires>= var->V_EDatefrom ).and. (lease_Info->Lease_Expires<= var->V_EDateTo )).and.((lease_Info->Option_exp_date>= var->V_EDate_Optfrom ).and. (lease_Info->Option_exp_date<= var->V_EDate_OptTo )) .and. (if(v_Vert='',(lease_provision->PU_Vert_Sev =v_Vert.or.lease_provision->PU_Vert_Sev<>v_Vert),lease_provision->PU_Vert_Sev=\"Yes\")).and. (if(v_Horiz='',(lease_provision->PU_Depth_Sev =v_Horiz.or.lease_provision->PU_Depth_Sev<>v_Horiz),lease_provision->PU_Depth_Sev=\"Yes\")).and. (if(v_Cont='',(lease_provision->OP_Cont =v_Cont.or.lease_provision->OP_Cont<>v_CONT),lease_provision->OP_Cont=\"Yes\"))"
query.order = "recno()"
'replace variables in the filter with their actual values
query.filter = convert_expression(query.filter,"V")
'Prompt user whether to print, or preview the layout. Set default to Print
prompt_result = ui_get_print_or_preview("Preview")
If prompt_result = "Print" then
:Report.Print("Lease_Info_Pughtst",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("Lease_Info_Pughtst",query.filter,query.order)
End if
END IF
DIM SHARED v_Project as C
DIM Shared v_Proj_no as C
DIM SHARED v_Lessor as C
DIM Shared V_Vert_Pugh as L
DIM Shared v_Horiz_Pugh as L
DIM Shared v_Cont_Drill as L
dim SHARED V_Exp_Datefrom as D
dim shared v_Exp_dateto as D
dim shared v_Option_to as D
dim shared v_Option_expFrom as D
DIM SHARED varC_result as C
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
DIM v_Proj_no_rl_def_orig as C
v_Proj_no_rl_def_orig = "kl=project,{keylist_build(\"H=.05,1:40[Project]\",''+Proj_no,left(''+Project,40))}{Project >= [varC->v_Project]}"
DIM v_Proj_no_rl_def as C
v_Proj_no_rl_def = replace_parameters(v_Proj_no_rl_def_orig,local_variables())
varC_result = ui_dlg_box("Select Filters For Pugh Report-Leave Blank to Select All",<<%dlg%
{region}
Proejct:| [.40v_Project!v_Project_changed];
| [%@v_Proj_no_rl_def%.40,5v_Proj_no];
Lessor Name or Part of Name:| [.40v_Lessor];
Vertical Pugh?: Yes Only | (40V_Vert_Pugh);
Horizontal_Pugh: Yes Only| (40v_Horiz_Pugh);
Continous Drilling?:Yes Only| (40v_Cont_Drill);
Expiration Date From:| [%DATE;P=popup.calendar(dtoc(V_Exp_Datefrom));I=popup.calendar%.15V_Exp_Datefrom!V_Exp_Datefrom_*];
Expiration Date To:| [%DATE;P=popup.calendar(dtoc(v_Exp_Dateto));I=popup.calendar%.15v_Exp_Dateto!v_Exp_Dateto_*];
Option Expiration From:| [%DATE;P=popup.calendar(dtoc(v_Option_expFrom));I=popup.calendar%.15v_Option_expFrom!v_Option_expfrom_*];
Option Expiration To:| [%DATE;P=popup.calendar(dtoc(v_Option_To));I=popup.calendar%.15v_Option_to!v_Option_to_*];
{endregion};
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%,<<%code%
If a_dlg_button = "v_Project_changed" then
v_Proj_no_rl_def = replace_parameters(v_Proj_no_rl_def_orig,local_variables())
a_dlg_button = ""
end if
if left(a_dlg_button,15) = "V_Exp_Datefrom_" then
if a_dlg_button = "V_Exp_Datefrom_killfocus" then
V_Exp_Datefrom = ctod(dtoc(V_Exp_Datefrom))
end if
a_dlg_button = ""
end if
if left(a_dlg_button,13) = "v_Exp_Dateto_" then
if a_dlg_button = "v_Exp_Dateto_killfocus" then
v_Exp_Dateto = ctod(dtoc(v_Exp_Dateto))
end if
a_dlg_button = ""
end if
if left(a_dlg_button,12) = "v_Option_To_" then
if a_dlg_button = "v_Option_To_killfocus" then
v_Option_To = ctod(dtoc(v_Option_To))
end if
a_dlg_button = ""
end if
if left(a_dlg_button,17) = "v_Option_expFrom_" then
if a_dlg_button = "v_Option_expFrom_killfocus" then
v_Option_expFrom = ctod(dtoc(v_Option_expFrom))
end if
a_dlg_button = ""
end if
%code%)
dim global v_horiz as C
dim global v_Vert as C
dim global v_Cont as C
v_Horiz = If(v_Horiz_Pugh=.t.,"YES","")
v_Vert = if (V_Vert_Pugh=.t.,"YES","")
v_Cont = if(v_Cont_Drill=.t.,"YES","")
dim global v_EDateFrom as D
dim global V_EDateTo as D
dim global v_Edate_optFrom as D
dim Global V_Edate_OptTo as D
v_EDateFrom = if(V_Exp_Datefrom={//},{01/01/1990},V_Exp_Datefrom)
v_EDateTo = If(v_Exp_dateto={/ / },{12/31/2100},v_Exp_dateto)
v_Edate_optFrom = if(v_Option_expFrom={//},{01/01/1990},v_Option_expFrom)
V_Edate_OptTo = if(V_Edate_OptTo={//},{12/31/2100},v_Option_to)
'Conditional code follows. Executes only if the condition expression is True.
IF a5_eval_expression("=Var->varC_result=\"OK\"") THEN
'Print a report, label, letter, form or browse layout. You can specify which records to print.
query.filter="(Proj_no = val(Var->v_Proj_no) ).and.((lease_Info->Lease_Expires>= var->V_EDatefrom ).and. (lease_Info->Lease_Expires<= var->V_EDateTo )).and.((lease_Info->Option_exp_date>= var->V_EDate_Optfrom ).and. (lease_Info->Option_exp_date<= var->V_EDate_OptTo )) .and. (if(v_Vert='',(lease_provision->PU_Vert_Sev =v_Vert.or.lease_provision->PU_Vert_Sev<>v_Vert),lease_provision->PU_Vert_Sev=\"Yes\")).and. (if(v_Horiz='',(lease_provision->PU_Depth_Sev =v_Horiz.or.lease_provision->PU_Depth_Sev<>v_Horiz),lease_provision->PU_Depth_Sev=\"Yes\")).and. (if(v_Cont='',(lease_provision->OP_Cont =v_Cont.or.lease_provision->OP_Cont<>v_CONT),lease_provision->OP_Cont=\"Yes\"))"
query.order = "recno()"
'replace variables in the filter with their actual values
query.filter = convert_expression(query.filter,"V")
'Prompt user whether to print, or preview the layout. Set default to Print
prompt_result = ui_get_print_or_preview("Preview")
If prompt_result = "Print" then
:Report.Print("Lease_Info_Pughtst",query.filter,query.order)
Else if prompt_result = "Preview" then
:Report.Preview("Lease_Info_Pughtst",query.filter,query.order)
End if
END IF
Comment