解决方案很简单,就是把Memo所在的Band勾选Stretch就行了。另外还可勾选StartNewPage。
至于UserDataSet本身,猜测就是人为的构造一个类似数据库的集合,大致使用代码如下:
var MyData: array[1..100, 1..20] of String; MasterNo: Integer; procedure TFormMainForm.ExporterPDF(Sender: TObject); var strList : TStringList; i, No : integer; list : TStringList; ttt : IXMLTaskType; strFilePath : String; oExportfilter : TfrxCustomExportFilter; begin nPath := 0; nFile := 0; nExclu := 0; // 使用数据填充数组,构造一个类似于数据库的内容 for i:=0 to XMLConfig.Tasks.Count-1 do begin No := i+1; MyData[No][1] := ttt.Nom; MyData[No][2] := '中午12点'; MyData[No][3] := '晚上9点'; end; SaveDialog1.InitialDir:=GetShellFolders('Personal'); SaveDialog1.Filter := 'PDF file|*.pdf'; SaveDialog1.DefaultExt := 'pdf'; if SaveDialog1.Execute then begin strFilePath := SaveDialog1.FileName; oExportfilter := TfrxCustomExportFilter(frxPDFExport1); oExportFilter.ShowDialog := False; oExportFilter.FileName := strFilePath; frxReport1.PrepareReport(True); frxReport1.Export(oExportFilter); ShellExecute(Self.Handle, 'open', PChar(strFilePath),'', '',SW_SHOW); //oExportfilter.Free; end; exit; frxReport1.PrepareReport(); frxReport1.ShowPreparedReport(); frxReport1.Print; frxReport1.ShowReport(); end; procedure TFormMainForm.frxUserDataSet1GetValue(const VarName: String; var Value: Variant); begin if VarName = 'fname' then Value := MyData[MasterNo][1] else if VarName = 'fstarttime' then Value := MyData[MasterNo][2] else if VarName = 'fstoptime' then Value := MyData[MasterNo][3] end; procedure TFormMainForm.frxUserDataSet1First(Sender: TObject); begin MasterNo := 1; end; procedure TFormMainForm.frxUserDataSet1Next(Sender: TObject); begin Inc(MasterNo); end; procedure TFormMainForm.frxUserDataSet1Prior(Sender: TObject); begin Dec(MasterNo); end; procedure TFormMainForm.frxUserDataSet1CheckEOF(Sender: TObject; var Eof: Boolean); begin Eof := MasterNo > XMLConfig.Tasks.Count;//High(MyData); end;