How to extract aggregate values from PivotTable

I

Ivanchain

Hi, friends. Please look this:

I know there is an article answered this question at
http://support.microsoft.com/kb/q294782/. But I still want to know how to
extract aggregate value in a cell when columnmember is null.

For example: drag a measure into the datafield, drag a dimemsion into the
rowaxis field, but keep the columnaxis field to be empty. Now, I try to
extract the measure cell's aggregate value by" CellValue =
AxPivotTable1.ActiveData.Cells(RowMember, ColumnMember).Aggregates(0).Text",
just like the kb 294782 said. But, now it will report an error, because there
is NO columnmember now.

But the AxPivotTable1.ActiveData.Cells() method need the columnmember
parameter, and if I send nothing to it, also get an error.

What I need to do?
Thanks,
Ivan
 
A

Alvin Bruney [ASP.NET MVP]

aggregate values are found in the totals object, consult the documentation
for code on how to extract it.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
 
I

Ivanchain

Thanks Bruney. Do you mean I could not extract the aggregate value from the
cell object but the totals object? But when the column field and row field
are filled dimensions, I could extract the aggregate from the cell object
correctly, just as the http://support.microsoft.com/kb/q294782/ told me.

So you mean if the row field and column field is empty, then we need to
extract the aggregate value from the totals object?




Alvin Bruney said:
aggregate values are found in the totals object, consult the documentation
for code on how to extract it.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------



Ivanchain said:
His anyone see it?
 
I

Ivanchain

hi,thanks for your help.
How to find the aggregate values in the totals object?
I can't find any property of totals. like aggregate value.
I do like this:

pivottable1.ActiveData.DataAxis.Totals(i).
but the totals' property from "AutoFit" to "Width", no things like to have
something to do with aggregate value there.

Could you give me more tips?


Alvin Bruney said:
aggregate values are found in the totals object, consult the documentation
for code on how to extract it.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------



Ivanchain said:
His anyone see it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top