解决方案很简单,就是把Memo所在的Band勾选Stretch就行了。另外还可勾选StartNewPage。
至于UserDataSet本身,猜测就是人为的构造一个类似数据库的集合,大致使用代码如下:
var
MyData: array[.., ..] 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 := ;
nFile := ;
nExclu := ;
// 使用数据填充数组,构造一个类似于数据库的内容
for i:= to XMLConfig.Tasks.Count- do
begin
No := i+;
MyData[No][] := ttt.Nom;
MyData[No][] := '中午12点';
MyData[No][] := '晚上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][]
else if VarName = 'fstarttime' then Value := MyData[MasterNo][]
else if VarName = 'fstoptime' then Value := MyData[MasterNo][]
end; procedure TFormMainForm.frxUserDataSet1First(Sender: TObject);
begin
MasterNo := ;
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;