git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.DevExpressVCL@21 05c56307-c608-d34a-929d-697000501d7a
75 lines
2.0 KiB
ObjectPascal
75 lines
2.0 KiB
ObjectPascal
unit OrderReportsMain;
|
|
|
|
{$I ..\cxVer.inc}
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, {$IFDEF DELPHI6} Variants, {$ENDIF} Forms, Dialogs,
|
|
SysUtils, Menus, StdCtrls, Controls, cxLookAndFeels, DemoBasicMain,
|
|
cxControls, cxCustomPivotGrid, cxDBPivotGrid, DemoBasicDM, cxStyles,
|
|
cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
|
Classes, cxClasses;
|
|
|
|
type
|
|
TfrmOrderReport = class(TfrmDemoBaisicMain)
|
|
DBPivotGrid: TcxDBPivotGrid;
|
|
pgfPurchaseDate: TcxDBPivotGridField;
|
|
pgfPaymentType: TcxDBPivotGridField;
|
|
pgfQuantity: TcxDBPivotGridField;
|
|
pgfCarName: TcxDBPivotGridField;
|
|
pgfUnitPrice: TcxDBPivotGridField;
|
|
pgfCompanyName: TcxDBPivotGridField;
|
|
pgfPaymentAmount: TcxDBPivotGridField;
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure pgfPaymentTypeGetGroupImageIndex(Sender: TcxPivotGridField;
|
|
const AItem: TcxPivotGridViewDataItem; var AImageIndex: Integer;
|
|
var AImageAlignHorz: TAlignment;
|
|
var AImageAlignVert: TcxAlignmentVert);
|
|
private
|
|
protected
|
|
function GetPivotGrid: TcxCustomPivotGrid; override;
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
frmOrderReport: TfrmOrderReport;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
function TfrmOrderReport.GetPivotGrid: TcxCustomPivotGrid;
|
|
begin
|
|
Result := DBPivotGrid;
|
|
end;
|
|
|
|
procedure TfrmOrderReport.FormCreate(Sender: TObject);
|
|
begin
|
|
PivotGrid.ApplyBestFit;
|
|
end;
|
|
|
|
procedure TfrmOrderReport.pgfPaymentTypeGetGroupImageIndex(
|
|
Sender: TcxPivotGridField; const AItem: TcxPivotGridViewDataItem;
|
|
var AImageIndex: Integer; var AImageAlignHorz: TAlignment;
|
|
var AImageAlignVert: TcxAlignmentVert);
|
|
var
|
|
Card: string;
|
|
begin
|
|
Card := VarToStr(AItem.Value);
|
|
if SameText(Card, 'AmEx') then
|
|
AImageIndex := 1
|
|
else
|
|
if SameText(Card, 'Cash') then
|
|
AImageIndex := 0
|
|
else
|
|
if SameText(Card, 'Master') then
|
|
AImageIndex := 2
|
|
else
|
|
if SameText(Card, 'Visa') then
|
|
AImageIndex := 3;
|
|
end;
|
|
|
|
end.
|