请看看如下代码对你有用吗?我也是在网上发现的,顺便向高手请教RAVE打印图表的问题:网上有一篇文章,说TChart可以调进去,可提供的方法报“类型”方面的错误,如有高手解决了此问题,请发个文章给小弟,谢谢!
问题10: 分栏显示(snaking columns)
name1 name6
name2 name7
name3 name8
name4
name5
窗体添加以下控件Rvsystem1,table1,DataSource1
procedure TForm1.Button1Click(Sender: TObject);
begin
ReportSystem1.Execute;
end;
procedure TForm1.ReportSystem1Print(Sender: TObject);
begin
With (Sender as TBaseReport),Table1do
begin
SetFont('Times New Roman', 20);
Bold := True;
Underline := True;
Home;
PrintCenter('NAME LISTING', PageWidth / 2.0);
SectionTop := 1.0;
MarginBottom := 0.75;
Home;
While not Table1.EOFdo
begin
SetColumns(2,0.5);
{OnNewColumn will be called after each call to SetColumns and on each
new column after that}
While (ColumnLinesLeft > 0) AND (NOT Table1.EOF)do
begin
If FieldByName('NAME').AsString <> '' then
begin
Println(FieldByName('NAME').AsString);
end;
{if}
Table1.Next;
end;
{while}
If not Table1.EOF then
begin
NewPage;
end;
{if}
end;
{while}
end;
{ with }
end;
procedure TForm1.ReportSystem1BeforePrint(Sender: TObject);
begin
Table1.First;
end;
procedure TForm1.ReportSystem1NewColumn(Sender: TObject);
begin
With Sender as TBaseReportdo
begin
SetFont('Times New Roman', 14);
Bold := True;
UnderLine := True;
AdjustLine;
Println(' NAME');
SetFont('Arial',12);
AdjustLine;
end;
{with}
end;
procedure TForm1.ReportSystem1PrintFooter(Sender: TObject);
begin
With Sender as TBaseReportdo
begin
MarginBottom := 0.5;
PrintFooter('Page ' + Macro(midCurrentPage)
+ ' of ' + Macro(midTotalPages), pjCenter);
MarginBottom := 0.75;
end;
{with}
end;