If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Pivottable Component

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-03, 16:05
coder_boy coder_boy is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
Question Pivottable Component

I am having a hard time finding a detailed object model for the pivottable component with a few examples. Has anyone worked with the activedata portion.

I am trying to enumerate through the record set to write the details to a .csv.

I think I am close but the problem is I can't find key words and Im guessing.

The following code goes through 1 aggregate only. I am currently looking for the nomenclature that will return the number of aggregates from the data area of the pivot table. The following is html for quick and dirty extract which works:

Dim oPivot
Set oPivot = dialogArguments

Dim oData 'As PivotData
Dim oRow0 'As PivotMember -- First level Row Member
Dim oRow1 'As PivotMember -- Second Level Row Member
Dim oCol 'As PivotMember -- First level Column Member
Dim nCols
Dim sHTML
Dim CellValue
Dim c, r

Set oData = oPivot.ActiveData
'msgbox oData.Aggregates.Count
nCols = oData.ColumnMembers.Count

sHTML = "<TABLE BORDER='1' WIDTH='100%' BORDERCOLOR='Gray' CELLSPACING=0>" & vbCrLf & _
"<COLGROUP SPAN='1' BGCOLOR='Silver'></COLGROUP>" & vbCrLf & _
"<COLGROUP SPAN='" & nCols + 1 & "' ALIGN='Right'></COLGROUP>"
'Retrieve Column Member Captions.
sHTML = sHTML & vbCrLf & " <TR><TD COLSPAN='1'>&#xa0;</TD>"
For Each oCol In oData.ColumnMembers
sHTML = sHTML & "<TD BGCOLOR='Silver'>" & Trim(oCol.Caption) & "</TD>"
Next
sHTML = sHTML & vbCrLf & " </TR>"
'Retrieve Row Member Captions and Data Sets
For Each oRow0 In oData.RowMembers
sHTML = sHTML &"<tr><td>"&Trim(oRow0.Caption)&"</td>"
'msgbox Trim(oData.Cells(oRow0,oData.ColumnMembers(0)).Agg regates(0).Value)
'looping through data cells
For c = 0 To nCols - 1
sHTML = sHTML & "<TD>" & oData.Cells(oRow0, oData.ColumnMembers(c)).Aggregates(0).Value & "</TD>"
Next
sHTML = sHTML &"</tr>"
next

'This is the table closing tag.
sHTML = sHTML & vbCrLf & "</TABLE>"

document.body.innerHTML = sHTML


Any help would be greatly appreciated
Bygs
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On