dbTalk Databases Forums  

Drillthrough Multi Partition - Modification of Drillthrough.htc

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Drillthrough Multi Partition - Modification of Drillthrough.htc in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nugon
 
Posts: n/a

Default Drillthrough Multi Partition - Modification of Drillthrough.htc - 05-24-2004 , 12:16 AM






Dear All

the Existing drillthrough.htc of BI Portal or Office XP Toolpack cannot retrieve the drillthrough result correctly because the code only get and retrieve single recordset which representative only single partition. For accessing more drillthrough result of others partition, we must explore by using NextRecordset method

The following code is modification of existing drillthrough.htc, please analyze and use it, and may be revise it if any bug found here

Regards

Nugroho Laiso
PT eBiz Cipta Solus
Microsft Certified Partner - Indonesi


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
replace existing function drillthroughset and getrecordset with below cod
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

function DrillthroughSet(

this.MDX = "
this.Tuple = null
this.Recordset = null
this.GetRecordset = getRecordset

// this is the code that actually does the calling out to PivotTable services to get the drillthrough data
function getRecordset(

var sMDX
var iMax
var rsTemp
var iNumRecords
var fUsingOverallLimit = true
var winTemp
var sName
var i, iOut, iFirstRecord

iNumRecords = 0;
iOut = 0
iFirstRecord = 0

if (this.Recordset != null
return this.Recordset

rs = new ActiveXObject("ADODB.Recordset")
rsTemp = new ActiveXObject("ADODB.Recordset"); /
rs.ActiveConnection = element.Connection

sMDX = this.MDX

// do some limits checking and make sure we set MAXROWS in the drillthrough call to return only the max number o
// rows
if (dt.MaxDrillthroughRecords < 1) // if the user has set maxdrillthorugh to 0, assume they don't want a limit
iMax = -1
els
iMax = (dt.MaxDrillthroughRecords - dt.CurrentRowCount)

if (iMax < 0 || (dt.MaxDrillthroughRecordsPerSet >= 0 && dt.MaxDrillthroughRecordsPerSet < iMax)

iMax = dt.MaxDrillthroughRecordsPerSet
fUsingOverallLimit = false


if (iMax > 0

sMDX = sMDX.replace("DRILLTHROUGH", "DRILLTHROUGH MAXROWS " + String(iMax))

else if (iMax == 0

this.Recordset = null
return null


// alert(sMDX

rs.Source = sMDX

tr

rs.Open()

catch (e

// uhoh, something went wrong when talking to PivotTable services. As the alert says, it might be some sor
// of security error (e.g., by default, only OLAP administrators have permission to do drillthrough). Or perhap
// drillthrough is not enabled/setup right in the cube.

// figure out which window to show this alert from
if (winChild != null && dt.UserInterface.GetViewMode() == constants.plDrillthroughViewModeSpawn
winTemp = winChil
els
winTemp = window

winTemp.alert(L_Err8_ErrorMessage)
return null


for (i=0; i<rs.Fields.Count; i++) /
{ /
sName = rs.Fields(i).Name /
rsTemp.Fields.Append(sName, rs.Fields(i).Type, rs.Fields(i).DefinedSize, rs.Fields(i).Attributes); /
} /
/
rsTemp.Open(); /
/
while (rs != null && rs.RecordCount==0

tr

rs = rs.NextRecordset()

if (rs == null

iOut = 1
break

//

catch(e

iOut = 1
break



while (iOut == 0

if(iFirstRecord == 0

rs.MoveFirst()
iFirstRecord = 1


rsTemp.AddNew(); /
/
for (i=0; i<rs.Fields.Count; i++) /
{ /
rsTemp.Fields(i).Value = rs.Fields(i).Value; /
} /
/
iNumRecords++; /
rs.MoveNext(); /
/
if (rs.EOF) /
{ /
d

rs = rs.NextRecordset()
if (rs == null

iOut = 1
break

iFirstRecord = 0

while (rs != null && rs.RecordCount==0

} /
/


/
rsTemp.UpdateBatch(); /
//
//
dt.CurrentRowCount = dt.CurrentRowCount + iNumRecords;

if (iNumRecords >= iMax)
{
// set a flag so that we show a warning later on when we are done collecting our recordset.
if (fUsingOverallLimit)
dt.ShowTotalMaxWarning = true;
else
dt.ShowIndividualMaxWarning = true;
}

this.Recordset = rsTemp; //
if(iNumRecords > 0) //
{ //
rsTemp.MoveFirst(); //
} //

return rsTemp; //
}
}




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.