Add measure from code
Hello
I use free Turbo Delphi 2006. I create all fastcube objects at runtime (turbo delphi doesn't allow to add new components to components palette ).
All my code is above:
fcCube1 := TfcCube.Create(nil);
fcCube1.DataSet := ADataSet;
fcSlice1 := TfcSlice.Create(nil);
fcSlice1.Cube := fcCube1;
fcGrid1 := TfcGrid.Create(frmKostka);
fcGrid1.Parent := panGRid;
fcGrid1.Align := alClient;
fcGrid1.Slice := fcSlice1;
fcToolBar1 := TfcToolBar.Create(frmKostka);
fcToolBar1.Parent := panBar;
fcToolBar1.Grid := fcGrid1;
fcChart1 := TfcChart.Create(frmKostka);
fcChart1.Parent := panchart;
fcChart1.Slice := fcSlice1;
fcChart1.Align := alClient;
fcChartToolBar1 := TfcChartToolBar.Create(frmKostka);
fcChartToolBar1.Parent := panchart;
fcChartToolBar1.Chart := fcChart1;
fcCube1.Open;
fcGrid1.Active := True;
fcChart1.Active := True;
I need to have Count measure in measures list.
I add above code but no success - measure isn't on list
fcSlice1.BeginUpdate;
fcSlice1.Clear;
fcSlice1.AddFieldTo('Count', '', 'Count', rf_CapFacts, af_Count);
fcSlice1.EndUpdate;
Can You help me
Reagrds
Tygiel
Of course i use full version of FastCube
I use free Turbo Delphi 2006. I create all fastcube objects at runtime (turbo delphi doesn't allow to add new components to components palette ).
All my code is above:
fcCube1 := TfcCube.Create(nil);
fcCube1.DataSet := ADataSet;
fcSlice1 := TfcSlice.Create(nil);
fcSlice1.Cube := fcCube1;
fcGrid1 := TfcGrid.Create(frmKostka);
fcGrid1.Parent := panGRid;
fcGrid1.Align := alClient;
fcGrid1.Slice := fcSlice1;
fcToolBar1 := TfcToolBar.Create(frmKostka);
fcToolBar1.Parent := panBar;
fcToolBar1.Grid := fcGrid1;
fcChart1 := TfcChart.Create(frmKostka);
fcChart1.Parent := panchart;
fcChart1.Slice := fcSlice1;
fcChart1.Align := alClient;
fcChartToolBar1 := TfcChartToolBar.Create(frmKostka);
fcChartToolBar1.Parent := panchart;
fcChartToolBar1.Chart := fcChart1;
fcCube1.Open;
fcGrid1.Active := True;
fcChart1.Active := True;
I need to have Count measure in measures list.
I add above code but no success - measure isn't on list
fcSlice1.BeginUpdate;
fcSlice1.Clear;
fcSlice1.AddFieldTo('Count', '', 'Count', rf_CapFacts, af_Count);
fcSlice1.EndUpdate;
Can You help me
Reagrds
Tygiel
Of course i use full version of FastCube
Comments
Your code is right.
I test it in Delphi 7.
Try add:
fcSlice.AddFieldTo(sMeasuresFieldName,'',rf_CapXAx);
after AddFieldTo
Oleg Pryalkov.
Thanks for reply, I found other solution: save cube schema with manually created measure and just load it when user create cube
Regards