在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;
在Report Title中添加一个Memo,命名为〔title〕
(就是用中括号将title括起来)
在frReport的GetValue事件中这样写
if ParName = 'title' then
ParValue := '我的报表';
这样显示后报表的标题就是“我的报表”
=========================================
请大家回贴时,代码写详细点先谢谢了
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;
frReport1: TfrReport;
在TfrReport上按ctrl+鼠标,就能打开它的源码,就是FR_Class.pass文件