Problem when using Groups

Discussion forum for PivotCube VCL users. Common questions. Bug and problem reports

Moderator: Alex Zencovich

Problem when using Groups

Postby wjsantana » Mon Oct 29, 2007 7:58 pm

I have a problem with the PivotCube.

I have to build groups in execution time by code using TMapDimensionItem.

When the PivotCube open the vision in Pivot map, value displayed in groups don’t correspond a correct values calc of the values group.

When a build the group whit the PivotCube interface this calc are make corrects.

The internal structure of the groups is correct, this correspond an identical structure build by PivoteCube whit his graphic interface.



How I do the PivoteCube calc a new value of the groups?

I try to use RefreshData(True), but this don’t have effect.
wjsantana
Developer
 
Posts: 20
Joined: Thu Feb 01, 2007 11:04 am
Location: Brazil

Postby AlexZencovich » Tue Oct 30, 2007 6:10 am

Plese show the code you use to create new group item. Probbaly you do not assign right item's Key or ID values
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby wjsantana » Tue Oct 30, 2007 11:37 am

Alex, this is the code....

function BuidGrups(Dimension:TMapDimension;Group:TLista;Menu:TMapDimensionItem):TMapDimensionItem;
var
iNrSubGroup:Integer;
Item: TMapDimensionItem;
qry:TADOQuery;
spName : String;
begin

Item := TMapDimensionItem.Create;

Item.isGroup := true;
Item.isCustomGroup := true;

Item.Name := Group.sDescription;//Group description

Item.Key := Group.iNrGroup;//originate generated by pivotecube

Item.Dimension := Dimension;

// The new ID do no be modified

if Menu = nil then
Dimensao.AddItem(Item)// add group into dimension
else
begin
Menu.AddItem(Item);// add group into other group
end;

Result := Item;
end;

thank's
Wesley
wjsantana
Developer
 
Posts: 20
Joined: Thu Feb 01, 2007 11:04 am
Location: Brazil

Postby AlexZencovich » Tue Oct 30, 2007 4:46 pm

1. I have no idea what is Group.iNrGroup
2. You should set item.ID. Absolutely required.

ID may be same as Key and should be more than $FFFF

There is code from PivotCube VCL which used to create new group

item := TMapDimensionItem.Create;
Inc(MaxID); // internal counter
item.ID := MaxID + $FFFF;
item.isGroup := True;
item.isCustomGroup := True;

item.Name := cNewGroup;

item.Owner := nil;
item.Key := item.ID;
item.State := disActive;
item.Dimension := TDimInfo(Items[0]).Item.Dimension;
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Postby wjsantana » Wed Oct 31, 2007 1:06 pm

OK Alex, later that I placed "$FFFF" is functioning perfectly.
Why reason is necessary to place "$FFFF"?

Thank's
wjsantana
Developer
 
Posts: 20
Joined: Thu Feb 01, 2007 11:04 am
Location: Brazil

Postby wjsantana » Wed Oct 31, 2007 1:07 pm

Detail: After to place $FFFF in field ID.
wjsantana
Developer
 
Posts: 20
Joined: Thu Feb 01, 2007 11:04 am
Location: Brazil

Postby AlexZencovich » Wed Oct 31, 2007 5:12 pm

Max dimension item count (for build) is $FFFA. Groups should have ID not interferenced with data item because it should not be search for custom group items in cube data. It has little different calulating way.
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am


Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 5 guests

cron