Error loading map from Stream: Dimensions are mismatch

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

Moderator: Alex Zencovich

Error loading map from Stream: Dimensions are mismatch

Postby Paul@TohoTenax » Wed Apr 08, 2009 10:52 am

Hello,

I am using PivotCube with a dynamically created Dataset. All Fields are added as Dimension, any numeric format also added as measure.
As not all Measures are helpfull a Masteruser creates a default map with useless measures deleted and calculated measures added.
This Map is saved to Stream by using
map.SaveToStream(Blobstream,false);// without Dimensions
(Blobstream beeing a TMemoryStream)

Normal users load this default map automatically.

This does always work as long as the Datasetdefinition is unchanged.
If Definition of the Dataset is changed (eg. adding a colum) the map can still be loaded (as desired).
If Definition of the Dataset is rebuilt (eg. transered from a different Database) , even if the Columnames are equal, they might be in totally different positions, the Map cannot be loaded again although all columns are still available.

The Message would be : The loaded map is not compatible with currently loaded cube! Dimensions are mismatch.

Do I need to save the Cube into a Memorystream too? Would that help?
that would be something like
cube.SaveToStream(TStreamAdapter.create(Blobstream)); ??

The reloading by
Blobstream.Seek(0, 0);
cube.LoadFromStream(TStreamAdapter.Create(Blobstream));
does not work. Error Message 'Could not read from Stream'.
Anybody any suggestions?
Thanks in advance
Paul
Paul@TohoTenax
Guest
 
Posts: 1
Joined: Wed Apr 08, 2009 8:27 am

Re: Error loading map from Stream: Dimensions are mismatch

Postby AlexZencovich » Wed Apr 08, 2009 3:26 pm

1. Check if you have SAME
number of measures
number of dimensions
for all measures and dimensions you have SAME AliasName values (it used to find equlity between cube data and loaded ma data)

2
I suppose there something wrong with TStreamAdapter work. We use that way to save?load cubes from file (with filestream) and it works as expected, but for memorystream youmay need keep styream adapter in memory too and use Seek not blobstream but streamadapter.seek


PS
I suggest you to save map to XML as it more flexible for load data if database changed and binary if you just need quick restore
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 3 guests

cron