Hi there,
Hi,
Thanks for your posting and using Aspose.Cells.
Currently, you can create Pivot Tables using Aspose.Cells API. Please see this documentation article for your reference.
(Insert Pivot Table|Documentation)
However, your requested feature may not be supported. Could you please provide us Microsoft Excel steps performed to integrate data from OLAP Cubes into the Pivot Table? It will give us clear picture of your requirements and we will investigate if this feature can be performed using Aspose.Cells API or if there is any workaround.
Also, we will investigate if such a feature can be implemented in our future versions.
Thanks for your cooperation
Hi Shakeel,
And this link contains the code to implement the same using Microsoft.Office.Interop.Excel:
http://blogs.msdn.com/b/andreww/archive/2008/07/25/creating-a-pivottable-programmatically.aspx
Hope this helps.
(Copying the code from the link here)
Excel.PivotCache pivotCache = this.Application.ActiveWorkbook.PivotCaches().Add(
Excel.XlPivotTableSourceType.xlExternal, missing);
pivotCache.Connection = connection;
pivotCache.MaintainConnection = true;
pivotCache.CommandText = **“CubeName”**;
pivotCache.CommandType = **Excel.XlCmdType.xlCmdCube**;
I can then add a new PivotTable to the worksheet, based on the PivotCache I’ve just configured:
Excel.Worksheet sheet = (Excel.Worksheet)this.Application.ActiveSheet;
Excel.PivotTables pivotTables = (Excel.PivotTables)sheet.PivotTables(missing);
Excel.PivotTable pivotTable = pivotTables.Add(pivotCache, this.Application.ActiveCell, “PivotTable1”, missing, missing);
pivotTable.SmallGrid = false;
pivotTable.ShowTableStyleRowStripes = true;
pivotTable.TableStyle2 = “PivotStyleLight1”;
Set up the SalesTerritory field as the page field, and FullName as the row field:
Excel.PivotField pageField = (Excel.PivotField)pivotTable.PivotFields(“SalesTerritory”);
pageField.Orientation = Excel.XlPivotFieldOrientation.xlPageField;
Excel.PivotField rowField = (Excel.PivotField)pivotTable.PivotFields(“FullName”);
rowField.Orientation = Excel.XlPivotFieldOrientation.xlRowField;
Hi,
Thanks for your posting and using Aspose.Cells.
Aspose.Cells cannot fetch the data from database. However, you can fetch the data from your database in a datatable and then import the datatable into your worksheet.
Please see the following documentation article that explains how to import data into worksheet using Aspose.Cells.
( Import Data into Worksheet|Documentation )
Please go through it and it should fit your needs. Let us know your feedback.
I’m afraid this approach will not work for us as we have a lot of data, and need to query it on need basis, as user drills down using the pivot table.
Hi,
Thanks for your posting and considering Aspose.Cells.
We will look into this feature. Could you please provide us some simple Excel file having Pivot Table with OLAP support for our investigation. It will help us analyze this feature and we will see if we could implement it or not.
Thanks for your cooperation.
Hey Shakeel,
The following link (together with the sample code in one of my replies above) should give you a fair idea about this feature.
Hi,
Thanks for your posting and using Aspose.Cells.
We have logged this issue in our database to investigate its feasibility. We will evaluate your requirements and see if we could implement it or not. Once, there is some update for your regarding this issue, we will let you know asap.
This issue has been logged as
- CELLSNET-43537 - Pivot Tables: OLAP Support
Hello,