
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
collapse rows in excel pivot table - Nprinting
I have created an excel pivot chart in nprinting reports. After refresh the chart is always expanded. Is a way to get it collapsed after refresh?
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Christiana,
You will need to use XLSM format and write VBA code in the Workbook Open event.
Taken from the Training Materials: NPrinting 16 Training & Installation/Upgrade Information
If you have a Pivot Table in your template like this:
You can use this code to collapse the field <Country>:
Private Sub Workbook_Open()
Sheets("Excel Pivot Table").Select
ActiveSheet.PivotTables("PivotTable1").PivotSelect "Country[All]", xlLabelOnly _
+ xlFirstRow, True
ActiveSheet.PivotTables("PivotTable1").PivotFields("Country").ShowDetail = _
False
Range("B2").Select
End Sub
Remember to save and preview as XLSM.
HTH - Daniel.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Christiana,
You will need to use XLSM format and write VBA code in the Workbook Open event.
Taken from the Training Materials: NPrinting 16 Training & Installation/Upgrade Information
If you have a Pivot Table in your template like this:
You can use this code to collapse the field <Country>:
Private Sub Workbook_Open()
Sheets("Excel Pivot Table").Select
ActiveSheet.PivotTables("PivotTable1").PivotSelect "Country[All]", xlLabelOnly _
+ xlFirstRow, True
ActiveSheet.PivotTables("PivotTable1").PivotFields("Country").ShowDetail = _
False
Range("B2").Select
End Sub
Remember to save and preview as XLSM.
HTH - Daniel.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Daniel,
Is this aplicable for NPrinting 17.2 as well?
Thanks


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ladislav,
In NPrinting 17.2 you cannot set the output format to XLSM. Therefore not applicable.
- Daniel.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For reference the xlsm templates are back in place for sept 2018 onwards
