Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Not applicable

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?

1 Solution

Accepted Solutions
Employee
Employee

Re: collapse rows in excel pivot table - Nprinting

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.

4 Replies
Employee
Employee

Re: collapse rows in excel pivot table - Nprinting

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 &amp; 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.

ladislavcapo
New Contributor III

Re: collapse rows in excel pivot table - Nprinting

Hi Daniel,

Is this aplicable for NPrinting 17.2 as well?

Thanks

Employee
Employee

Re: collapse rows in excel pivot table - Nprinting

Hi Ladislav,

In NPrinting 17.2 you cannot set the output format to XLSM. Therefore not applicable.

- Daniel.

stig1984
Contributor

Re: collapse rows in excel pivot table - Nprinting

For reference the xlsm templates are back in place for sept 2018 onwards

Community Browser