-
Sorting in PivotTable
Hi All,
I have tried a number of web sites and forums to sort the data in a PivotTable.
I have 3 columns namely WebPage,Url and Hits.
Have to display the column WebPage as the first column, the Pivot sorts the table by the first column by default although the data that is bound to the Pivot is sorted by the last column Hits.
How do i prevent the default sorting happening in the Pivot or how do I custom sort the Pivot Table by the Hits column.
I am building the PivotTable purely by vbscript , I cannot do it in the code behind file.
formname.PivotTable1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\Babli\SiteMetrics\sitemetrics.mdb;User Id=;Password=;"
formname.PivotTable1.CommandText = "SELECT WebPage,Url,Hits from SiteMetricsTable"
I even tried inserting a total column but didnt work
Set ptConstants = frmSiteMetrics.PivotTable1.Constants
Set totNewTotal = vwView.AddTotal("Total Hits", vwView.Fieldsets("Hits").Fields(0), _
ptConstants.plFunctionSum)
vwView.DataAxis.InsertTotal totNewTotal
vwView.RowAxis.Fieldsets("Hits").Fields("Hits").SortDirection = ptConstants.plSortDirectionDescending
Set vwView.RowAxis.Fieldsets("Hits").Fields("Hits").SortOn = vwView.Totals("Total Hits")
where TotalHits is the new extra column that I added to try my luck on sorting.
Similar Threads
-
By Rathi in forum ASP.NET
Replies: 0
Last Post: 05-09-2006, 07:01 AM
-
Replies: 3
Last Post: 07-29-2005, 10:00 AM
-
By Basel in forum ASP.NET
Replies: 1
Last Post: 04-05-2002, 11:18 AM
-
By Ramkumar in forum Java
Replies: 1
Last Post: 01-11-2001, 06:32 AM
-
By Joel Matto in forum Web
Replies: 0
Last Post: 05-02-2000, 03:58 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|