Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools


This sample will show you

1) How to programmatically connect to OLAP source (i.e. cube)
2) How to programmatically add fields on row and columns
3) How to programmatically add measures (i.e. total)

Have fun...........

Click here to copy the following block
Private Sub Command4_Click()
 PivotTable1.Visible = True
 ChartSpace1.Visible = False
 'Connect to the data source
 PivotTable1.ConnectionString = "Provider=MSOLAP.2;Data Source=localhost;Initial Catalog=Foodmart 2000;"
 PivotTable1.DataMember = "Sales"
 Label1.Caption = "Profit generated by each customer"
 
 With PivotTable1.ActiveView

  'Use number formats and cell fore/back colors from the server

  .UseProviderFormatting = True
  '.DisplayCellColor = True

  'Add Dimensions to the row axis
  .RowAxis.InsertFieldSet .FieldSets("Time")
  .RowAxis.InsertFieldSet .FieldSets("Customers")
  
  .RowAxis.FieldSets("Customers").Fields("Country").Expanded = False
  .RowAxis.FieldSets("Customers").Fields("State Province").Expanded = False

  'Add a calculated member to the data axis
  .DataAxis.InsertTotal .Totals("Profit")
  '.DataAxis.InsertTotal .Totals("Unit Sales")
 End With
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.