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; //
}
} |