Peoblem loading a second table without reinitiate the vb prg

Discussion forum for PivotCubeX component. Common usage questions. Bug and problem reports

Moderator: Alex Zencovich

Peoblem loading a second table without reinitiate the vb prg

Postby raul » Thu Nov 30, 2006 4:20 am

I load a Tabke from Access and using PCX.CubeMeasures.Add and PCX.MapAddCalculatedMeasure from vb program.
click to load another Table with other fields and another CubeMeasures and MapAddCalculatedMeasure
delete previous Measures with
For i = 0 To PCX.CubeMeasures.Count
PCX.CubeMeasures.delete (i)
Next i
and
For i = 0 To PCX.MapMeasureCount
PCX.MapDeleteCalculatedMeasure (PCX.MapMeasures(i).name)
Next i

and have a conflict. measures beacause they still are there although deleting

I need to load data without closing prograam and restarting
Thanks
raul
User
 
Posts: 9
Joined: Mon Oct 30, 2006 9:39 pm

Postby AlexZencovich » Thu Nov 30, 2006 8:11 am

1. Better will use CubeMeasures.Clear method

2. In your code fro Calc. measures you have a little bug - when you delete item (0), the item (1) become item(0) but loop variable become 1 so actually you delete item(2) etc....

Right loop will like next pseudocode example

for i := Count -1 downto 0 do
Delete(i)

or

while Count > 0 do
Delete(0)
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 ActiveX

Who is online

Users browsing this forum: No registered users and 2 guests

cron