+ Reply to Thread
Results 1 to 2 of 2

Printing PivotCharts with multiple page fields or sorting the printed charts by axis title

  1. #1
    Registered User
    Join Date
    12-31-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Question Printing PivotCharts with multiple page fields or sorting the printed charts by axis title

    Hi All,

    I need to print a PivotChart for each combination of two page fields. I found a little code that helps with printing when there is one page field. When I use it with two page fields it cross references each PageField1 with each PageField2 - if that makes sense. Here is an example of what I mean

    Page Field 1 - MedicalPractice
    Page Field 2 - Doctor

    The data is about how many office visits, well-visits etc.

    The code I have used on my other charts (With one Page Field) is:
    Sub PrintPivotCharts2()
    'prints a chart for each item in the page field
    On Error Resume Next
    Dim pt As PivotTable
    Dim pf As PivotField
    Dim pi As PivotItem
    Set pt = ActiveChart.PivotLayout.PivotTable
    For Each pf In pt.PageFields
    For Each pi In pf.PivotItems
    pt.PivotFields(pf.Name).CurrentPage = pi.Name
    ' ActiveSheet.PrintOut
    ActiveSheet.PrintPreview 'print preview for testing
    Next
    Next pf
    End Sub



    This code works great with only one page field but again when there is more than one it prints for each practice by each doctor. So if there are 10 doctors and 2 practices I end up with 20 charts - which doesn't make sense.

    My workaround has been to keep just the doctor in the Page Field area. I put the practice as an Axis Title, so when I print there is just one chart per doctor, and their practice name is listed in the axis title. Seems like a good solution - EXCEPT - there are a few instances where a doctor works for more that one practice (many to many relationship) - therefore the two practices show up at the axis on the same report. I need to send these reports to the practices for each, so that doesn't work. I thought, "why not handle the outliers manually with a slicer" so this is what I am doing.

    Here's the kicker - I would really like the reports to print out alphabetically by practice name. Or at least grouped by practice name. As the ultimate goal is to send the reports to the practice. I'd like to avoid someone having to hand sort the reports.

    Any thoughts on any of this?

    Much thanks!
    Last edited by vicky464; 10-23-2016 at 11:59 AM.

  2. #2
    Registered User
    Join Date
    12-31-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Printing PivotCharts with multiple page fields or sorting the printed charts by axis t

    May have found my own solution - I concatenated the Practice & DocName in the original data. Used that as the new Page field. I think that did the trick.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. templates can't be applied to PivotCharts with multiple "axis (category)" fields
    By 58906341589615896 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 10-30-2014, 07:50 AM
  2. Replies: 7
    Last Post: 01-09-2014, 01:16 PM
  3. Printing sequential Page numbers on each copy printed.
    By jhansen04 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2013, 01:44 PM
  4. Replies: 1
    Last Post: 12-07-2008, 12:21 PM
  5. My Y axis title in my charts run together
    By Otyokwa in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-19-2006, 01:45 PM
  6. How can I prevent y-axis title from truncating in Excel charts (o.
    By Lou T in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-19-2005, 04:06 PM
  7. [SOLVED] Printing the last column on every page printed.
    By naiveprogrammer in forum Excel General
    Replies: 1
    Last Post: 02-04-2005, 08:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1