在窗体上加个数据集代理
unit MainForm;
interface
uses
Business.System, Business.Forms, Business.Model, Business.Data;
type
TMainForm = class(TForm)
DataNavigator1: TDataNavigator;
FuncBroker1: TFuncBroker;
InfoBroker1: TInfoBroker;
DataSetBroker1: TDataSetBroker;
DataGrid1: TDataGrid;
procedure BizFormCreate(Sender: TObject);
private
{private declarations}
procedure DataSetTSSJJ1CreateFieldName(AKind: TPivotFieldKind; AOriginFields: TOriginFields; const AColumnField, AColumnDisplay: string; var AFieldName, ADisplayName: string);
public
{public declarations}
end;
implementation
procedure TMainForm.BizFormCreate(Sender: TObject);
begin
TPivotDataSet(DataSetBroker1.DataSet).OnCreateFieldName := DataSetTSSJJ1CreateFieldName;
DataSetBroker1.DataSet.open;
end;
procedure TMainForm.DataSetTSSJJ1CreateFieldName(AKind: TPivotFieldKind; AOriginFields: TOriginFields; const AColumnField, AColumnDisplay: string; var AFieldName, ADisplayName: string);
begin
ADisplayName := 'ss';
end;
end. |