dbTalk Databases Forums  

Show Properties in Report programmatically

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


Discuss Show Properties in Report programmatically in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ELEMA.LO@terra.es
 
Posts: n/a

Default Show Properties in Report programmatically - 06-11-2005 , 07:10 AM






Hi all, in this newsgroup I had the very helpufl answer that I can use
'Show Properties in Report' OWC11 functionality to have the Pivot to
show also custom properties of the fields.

I would like to know if there is a way to apply that functionaly
programmatically that is I there is an API by which I could have 'Show
Properties in Report' applied for all the fields in a cube - or
something or similar - so that the user could automatically have the
custom properties shown in the report by default without having to
right click the field and apply 'Show Properties in Report' option.

Thanks and regards

Elena


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Show Properties in Report programmatically - 06-13-2005 , 10:16 PM






The OWC Object Model includes a "PivotMemberProperty" Object, whose
"DisplayIn" Property can be controlled:

http://msdn.microsoft.com/library/de.../en-us/owcvba1
1/html/ocobjPivotMemberProperty.asp
Quote:
...
Represents a member property for a PivotTable member. A member property
is a custom property that has been defined for the member in an OLAP
cube.

Using the PivotMemberProperty object
The following properties return a PivotMemberProperty object:

The PivotMemberProperties collection's Item property

The PivotResultMemberProperty object's MemberProperty property

Use the DisplayIn property to control whether the specified member
property is displayed in the PivotTable list, ScreenTip, both the
PivotTable list and ScreenTip, or not at all. Use the Caption property
to set the caption for a member property.

The following example sets the captions of, and then displays the member
captions of the Store Name field.

Sub DisplayMemberProperties()

Dim ptView
Dim ptConstants
Dim fldStoreName

Set ptConstants = PivotTable1.Constants

' Set a variable to the active view of the PivotTable.
Set ptView = PivotTable1.ActiveView

' Set a variable to the Store Name field.
Set fldStoreName = ptView.FieldSets("Store").Fields("Store Name")

' The following three lines of code specify that the member
properties are
' displayed in the PivotTable list.
fldStoreName.MemberProperties("Store Manager").DisplayIn =
ptConstants.plDisplayPropertyInReport
fldStoreName.MemberProperties("Store Type").DisplayIn =
ptConstants.plDisplayPropertyInReport
fldStoreName.MemberProperties("Store Sqft").DisplayIn =
ptConstants.plDisplayPropertyInReport

' The following three lines of code set the caption for the member
properties.
fldStoreName.MemberProperties("Store Manager").Caption = "Manager
Name"
fldStoreName.MemberProperties("Store Type").Caption = "Store Type"
fldStoreName.MemberProperties("Store Sqft").Caption = "Size in SQFT"

End Sub
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.