各位,这个现象是这样的,当不先调用OpenDialog时一切正常,
注: OpenDialog不是用在FastReport上的,
调用代码如下:
procedure Tfrm_PrdcSchedulePrintSettings.bbtn_EnterClick(Sender: TObject);
var
Report: TfrReport;
begin
Report:=DM_FlexSide.rpt_Common;
//主从表
with DM_FlexSide.AQry_RptMasterdo
begin
Close;
SQL.Clear;
SQL.Add('SELECT tbl_MOBFilialePlan.PrdcPlanNo, tbl_MOBFilialePlan.PrdcNoteNo,');
SQL.Add('tbl_MOBFilialePlan.SourceNo, tbl_BASUserInfo.Name,tbl_MOBFilialePlan.PlanNoteDate ');
SQL.Add('FROM tbl_MOBFilialePlan Left Outer JOIN tbl_BASUserInfo ON ');
SQL.Add('tbl_MOBFilialePlan.FollowManID = tbl_BASUserInfo.IDNo where tbl_MOBFilialePlan.PrdcNoteNo=
rdcNoteNo');
Parameters.ParamByName('PrdcNoteNo').Value:=trim(edt_PrdcNoteNo.Text);
end;
with DM_FlexSide.AQry_RptDetailsdo
begin
Close;
SQL.Clear;
SQL.Add('SELECT tbl_MOSDept.DeptName, tbl_MOSWorkingProc.WorkingProcName, tbl_MOBPrdcLine.TransNextDate,');
SQL.Add('tbl_MOBPrdcLine.TransNextNum,tbl_MOBPrdcLine.TransNextUnit, tbl_MOBPrdcLine.InferiorRate,');
SQL.Add('tbl_MOBPrdcLine.WorkingProcRequest FROM tbl_MOBPrdcLine Left Outer JOIN tbl_MOSDept ON ');
SQL.Add('tbl_MOBPrdcLine.DeptNo = tbl_MOSDept.DeptNo Left Outer JOIN tbl_MOSWorkingProc ON ');
SQL.Add('tbl_MOBPrdcLine.WorkingProcNo = tbl_MOSWorkingProc.WorkingProcNo ');
SQL.Add('where dbo.tbl_MOBPrdcLine.PrdcNoteNo=
rdcNoteNo');
if trim(edt_DeptNo.Text)<>'' then
begin
SQL.Add(' and tbl_MOBPrdcLine.DeptNo=
eptNo');
Parameters.ParamByName('DeptNo').Value:=trim(edt_DeptNo.Text);
end;
end;
try
Report.LoadFromFile('PrdcSchedule.frf');
except
Application.MessageBox('PrdcSchedule.frf文件不存在','Information');
exit;
end;
Report.Preview:=nil;
if Report.PrepareReport then
Report.ShowPreparedReport;
end;