我想将这个 preview改成我自己定义的标题史呀 
 

解决方案 »

  1.   

    下面这个我看不懂呀
    在Report   Title中添加一个Memo,命名为〔title〕   
        (就是用中括号将title括起来)   
        
      在frReport的GetValue事件中这样写   
      if   ParName   =   'title'   then   
            ParValue   :=   '我的报表';   
        
      这样显示后报表的标题就是“我的报表”   
    =========================================
    请大家回贴时,代码写详细点先谢谢了
      

  2.   

    在FR_Class中修改源码可以:
    procedure TfrReport.ShowPreparedReport;
    var
      s: String;
      p: TfrPreviewForm;
    begin
      CurReport := Self;
      MasterReport := Self;
      DocMode := dmPrinting;
      CurBand := nil;
      if EMFPages.Count = 0 then Exit;
      s := frLoadStr(SPreview);  //if Title <> '' then s := s + ' - ' + Title;  这是原来的代码
      if Title <> '' then s := Title; //这是修改后的代码
      if not (csDesigning in ComponentState) and Assigned(Preview) then
        Preview.Connect(Self)
      else
      begin
        if csDesigning in ComponentState then
          p := TfrPreviewForm.Create(nil) else
          p := TfrPreviewForm.Create(Self);
        if MDIPreview then
        begin
          p.WindowState := wsNormal;
          p.FormStyle := fsMDIChild;
        end;
        p.Caption := s;
        p.Show_Modal(Self);
        Application.ProcessMessages;
      end;
    end;
      

  3.   

    你在delphi的代码中有这个定义吧:放一个fastreport控件就有
    frReport1: TfrReport;
    在TfrReport上按ctrl+鼠标,就能打开它的源码,就是FR_Class.pass文件