Class Tfrmxtab (unit Cross16) |
Inherits from
TForm
procedure FormCreate(Sender: TObject);
Now we "rotate" the data to ouput the crosstab report
procedure FormDestroy(Sender: TObject);
procedure QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRGroup2BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRSubDetail1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRSubDetail2BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QuickRep1BeforePrint(Sender: TQuickRep;
var PrintReport: Boolean);
Now we fill our array, each state gets it's own row.
QRBand1 : TQRBand;
QRBand2 : TQRBand;
QRBand3 : TQRBand;
QRDBText1 : TQRDBText;
QRDBText3 : TQRDBText;
QRExpr1 : TQRExpr;
QRExpr2 : TQRExpr;
QRGroup1 : TQRGroup;
QRGroup2 : TQRGroup;
QRLabel1 : TQRLabel;
QRLabel2 : TQRLabel;
QRLabel3 : TQRLabel;
QRLabel4 : TQRLabel;
QRLabel5 : TQRLabel;
QRLabel6 : TQRLabel;
QRMemo1 : TQRMemo;
QRSubDetail1 : TQRSubDetail;
QRSubDetail2 : TQRSubDetail;
Query1 : TQuery;
Query1State : TStringField;
QuickRep1 : TQuickRep;
TitleBand1 : TQRBand;
Matrix : array [1..50,1..2] of string;
Public declarations } { Define a matix array for 50 states with 2 columns
qrlCustomers : array [0..10] of TQRLabel;
qrlStates : array [0..10] of TQRLabel;
Row : integer;
procedure FormCreate(Sender: TObject);
Now we "rotate" the data to ouput the crosstab report
procedure FormDestroy(Sender: TObject);
procedure QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRGroup2BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRSubDetail1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRSubDetail2BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QuickRep1BeforePrint(Sender: TQuickRep;
var PrintReport: Boolean);
Now we fill our array, each state gets it's own row. We are basicly
building a copy of the dataset in memory, because it's faster to navigate
the array when dong a crosstab report.
}
Matrix[row,1] := IntToStr(Query1Customers.Value);
QRBand1 : TQRBand;
QRBand2 : TQRBand;
QRBand3 : TQRBand;
QRDBText1 : TQRDBText;
QRDBText3 : TQRDBText;
QRExpr1 : TQRExpr;
QRExpr2 : TQRExpr;
QRGroup1 : TQRGroup;
QRGroup2 : TQRGroup;
QRLabel1 : TQRLabel;
QRLabel2 : TQRLabel;
QRLabel3 : TQRLabel;
QRLabel4 : TQRLabel;
QRLabel5 : TQRLabel;
QRLabel6 : TQRLabel;
QRMemo1 : TQRMemo;
QRSubDetail1 : TQRSubDetail;
QRSubDetail2 : TQRSubDetail;
Query1 : TQuery;
Query1State : TStringField;
QuickRep1 : TQuickRep;
TitleBand1 : TQRBand;
Matrix : array [1..50,1..2] of string;
Public declarations } { Define a matix array for 50 states with 2 columns
qrlCustomers : array [0..10] of TQRLabel;
qrlStates : array [0..10] of TQRLabel;
Row : integer;