Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Create CubeFields with C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bishman - 29 May 2008 22:43 GMT
Hello all,

I am been trying to figure this out and I failed.   I am using VS 2008, and
Office 2007.  

I ran a Macro to add a field from SSAS Cube, and I am trying to convert it
to code in C# but I failed.

The code that is generated by the macro is:

With ActiveSheet.PivotTables("PivotTable1").CubeFields( _
   "[Account].[All Members]")
   .Orientation = xlRowField
   .Position = 1
End With

The problem I am runing in is I have a variable that is my pivottable, when
I try to type pt.CubeFields I only get the options to AddSet which I also
have not figure it out.

What I am trying to do is based on the user selection create the pivottable
for them.

Any help you provide is greatly apprecited.
Bishman - 30 May 2008 17:37 GMT
That is how I got it to work, just in case someone else is looking for this.

Excel.CubeField cf = null;

cf = pt.CubeFields["[Account].[All Members]"];
cf.Orientation =
Microsoft.Office.Interop.Excel.XlPivotFieldOrientation.xlRowField;
cf.Position = 1;

> Hello all,
>
[quoted text clipped - 20 lines]
>
> Any help you provide is greatly apprecited.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.