I store my reports in a BLOb. How to change the "Open/Save" dialogs in the designer?

类别:编程语言 点击:0 评论:0 推荐:

Look at TfrDesigner component. It has necessary events: OnLoadReport and OnSaveReport. Here is a small example:

procedure TForm1.frDesigner1LoadReport(Report: TfrReport;   var ReportName: String; var Opened: Boolean);
begin
  with MyOpenDialog do
  begin
    Opened := ShowModal = mrOk;
    if Opened then
    begin
      Report.LoadFromBlobField(...);
      ReportName := ...;
    end;
  end;
end;

procedure TForm1.frDesigner1SaveReport(Report: TfrReport; var ReportName: String; SaveAs: Boolean; var Saved: Boolean);
begin
  if SaveAs then
    with MySaveDialog do
    begin
      Saved := ShowModal = mrOk;
      if Saved then
      begin
        Report.SaveToBlobField(...);
        ReportName := ...;
      end;
    end
  else
    Report.SaveToBlobField(...);
end;

本文地址:http://com.8s8s.com/it/it24370.htm