begin
      if not FileExists(sFileName) then
        if (Application.MessageBox('打印模板文件没有找到,要手动查找吗?','系统提示',MB_YESNO+MB_ICONINFORMATION)=IDYES) then
          if (OpenDlg.Execute) then
            FRReport.LoadFromFile(OpenDlg.FileName)
          else
            if (pPrintData.PrintState=frDesign)then
              FRReport.Clear
            else
              Exit
        else
          Exit
      else
        FRReport.LoadFromFile(sFileName);
      PrintData(pPrintData);
end;procedure TDesignForm.PrintData(pPrintData:ST_PRINTDATA);
begin
  Case pPrintData.PrintState of
    frPrint:
      begin
        FRReport.PrepareReport;
        FRReport.PrintPreparedReport('', 1, True, frAll);
      end;
    frPreview:
      begin
        FRReport.ShowReport;
      end;
    frDesign:
      begin
        FRReport.DesignReport;
      end;
  else
    Exit;
  end;
end;