N
nantwww
Unregistered / Unconfirmed
GUEST, unregistred user!
为上fastreport里的控件里面的例子,请问各位如何控制列的宽度?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
frxClass, StdCtrls, frxCross, Db, DBTables, Grids, DBGrids, ADODB;
type
TForm1 = class(TForm)
Button1: TButton;
frxCrossObject1: TfrxCrossObject;
Table1: TTable;
AC1: TADOConnection;
AQ1: TADOQuery;
DBGrid1: TDBGrid;
DataSource1: TDataSource;
frxReport1: TfrxReport;
procedure Button1Click(Sender: TObject);
procedure frxReport1BeforePrint(c: TfrxReportComponent);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
frxReport1.ShowReport;
end;
procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
var
Cross: TfrxCrossView;
i, j: Integer;
begin
if c is TfrxCrossView then
begin
Cross := TfrxCrossView(c);
AQ1.First;
i := 0;
while not AQ1.Eof do
begin
for j := 0 to AQ1.Fields.Count - 1 do
Cross.AddValue(, [AQ1.Fields[j].DisplayLabel], [AQ1.Fields[j].AsString]);
AQ1.Next;
Inc(i);
end;
end;
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
frxClass, StdCtrls, frxCross, Db, DBTables, Grids, DBGrids, ADODB;
type
TForm1 = class(TForm)
Button1: TButton;
frxCrossObject1: TfrxCrossObject;
Table1: TTable;
AC1: TADOConnection;
AQ1: TADOQuery;
DBGrid1: TDBGrid;
DataSource1: TDataSource;
frxReport1: TfrxReport;
procedure Button1Click(Sender: TObject);
procedure frxReport1BeforePrint(c: TfrxReportComponent);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
frxReport1.ShowReport;
end;
procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
var
Cross: TfrxCrossView;
i, j: Integer;
begin
if c is TfrxCrossView then
begin
Cross := TfrxCrossView(c);
AQ1.First;
i := 0;
while not AQ1.Eof do
begin
for j := 0 to AQ1.Fields.Count - 1 do
Cross.AddValue(, [AQ1.Fields[j].DisplayLabel], [AQ1.Fields[j].AsString]);
AQ1.Next;
Inc(i);
end;
end;
end;
end.