PC Review


Reply
Thread Tools Rate Thread

Create CubeFields with C#

 
 
Bishman
Guest
Posts: n/a
 
      29th May 2008
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.


 
Reply With Quote
 
 
 
 
Bishman
Guest
Posts: n/a
 
      30th May 2008
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;


"Bishman" wrote:

> 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.
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Microsoft Excel Charting 1 30th Sep 2009 04:04 PM
how to create an auto reply rule/macro that wont create a new mess squalltheonly Microsoft Outlook Discussion 4 15th Nov 2008 04:03 PM
Refresh CubeFields for existing Pivot Table on OLAP cube dustbort Microsoft Excel Discussion 1 4th Mar 2008 04:22 PM
CubeFields =?Utf-8?B?VG9ueQ==?= Microsoft Excel Programming 0 13th Oct 2005 03:21 PM
Create user on win2k domain does not create mailbox on ex2k server Jeff Howard Microsoft Windows 2000 0 1st Oct 2003 12:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 AM.