Pivot Table - Show in Tabular Form

Is there a way to apply the “Show in tabular form” option to the Pivot Table?

I’ve tried by setting the ShowInOutlineForm property of all the row fields to false, but I still don’t get the desired behavior. And I don’t see this option at Pivot table level.
What I’m looking for it’s like in the Excel file while having the pivot table selected I choose Design -> Report Layout -> Show in tabular form.

thanks in advance!


Hi,

Thanks for your posting and using Aspose.Cells.

To get tabular form as report layout, please try pivotField.setShowSubtotalAtTop(false)

Thanks for the quick response, but I can’t find the setShowSubtotalAtTop (or similar) neither as a method nor a property on the pivotField. I’m using VB.NET, by the way.


Dim pivotFields As Aspose.Cells.Pivot.PivotFieldCollection = pivotTable.RowFields

For i = 0 To pivotTable.RowFields.Count - 1
pivotTable.RowFields(i).ShowInOutlineForm = False
pivotTable.RowFields(i).ShowCompact = False
Next

Dho! found it


pivotTable.RowFields(i).ShowSubtotalAtTop = False

Testing now…

Didn’t work, after setting the ShowSubtotalAtTop = False I have the same behavior and the pivot is not being shown in Tabular form. Any other idea?



Hi,

Thanks for your posting and using Aspose.Cells.

Please try:

pivotField.ShowInOutlineForm(false)

Well, to set the layout of the fields in compact, outline or tabular form, please use the following boolean attributes for PivotField.

ShowInOutlineForm --> Indicates whether layout this field in outline form on the Pivot Table view.
If you specify false, it will set in tabular form.

You may loop through your desired fields and specify the layouts accordingly.

Thanks, but i’ve already tried that.

This is the code i’m using to be sure that all the fields and cols are in tabular form.

For i = 0 To pivotTable.RowFields.Count - 1
pivotTable.RowFields(i).ShowInOutlineForm = False
Next

For col = 0 To pivotTable.ColumnFields.Count - 1
pivotTable.ColumnFields(col).ShowInOutlineForm = False
Next

But still not is what i’m looking for.

Let me attach some pictures to show you exactly what I want:

This is what I got from Aspose Cells:
http://screencast.com/t/nVlyFBnH1T

And this is what I’m expecting (i’ve selected the pivot table -> Design -> Report Layout -> Show in tabular form)
http://screencast.com/t/2VwY8F8MOQI

Thanks in advance!




Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please provide us your actual and expected output xlsx file which you can create manually using MS-Excel. Also provide us your sample code. We will look into your issue and help you asap.