Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linked Pivot Chart in a report (2003)

    I have a monthly report showing some results for some customers. these results are displayed with pivot charts (subform) and these charts are linked to the report data to change with each customer.
    The problem that I have is that the color of the bars in the pivot chart change for some customers but the legend continue to show the initial set of color. I have tried to review the color in the individual subform and also to set up the colors by some lines of code but without any success.
    Any idea to cancel this strange behavior of Access.

    Marcel

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked Pivot Chart in a report (2003)


  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked Pivot Chart in a report (2003)

    Hans,

    The KB article is for form, I try to format a pivot table on a report so I don't have a current event for a report. I have tried to insert some code directly in the current event of the subform

    Private Sub Form_Current()
    Dim objChartSpace As OWC10.ChartSpace
    Dim chtChart As OWC10.ChChart

    Set objChartSpace = Me.ChartSpace

    Set chtChart = objChartSpace.Charts(0)
    chtChart.Axes(1).NumberFormat = "$###,###,##0"

    Set chtChart = objChartSpace.Charts(1)
    chtChart.Axes(1).NumberFormat = "$###,###,##0"

    Set chtChart = objChartSpace.Charts(2)
    chtChart.Axes(1).NumberFormat = "$###,###,##0"
    End Sub

    Sometimes it works and sometimes I have a runtime 1004 on the line Set chtChart = objChartSpace.Charts(1) with chart(1) or chart(0).

    So I wil try a little tomorrow.

    Regards,
    Marcel

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked Pivot Chart in a report (2003)

    I have tried the following code in the current subform event but I still have the problem, any suggestions?

    Best regards,

    Marcel


    Private Sub Form_Current()
    Dim objChartSpace As OWC10.ChartSpace
    Dim chtChart As OWC10.ChChart
    Dim objseries As OWC10.ChSeries
    Dim i As Integer



    'Set objChartSpace = Me.PivotChart.Form.ChartSpace
    Set objChartSpace = Me.ChartSpace



    Set chtChart = objChartSpace.Charts(0)
    chtChart.Axes(1).NumberFormat = "$###,###,##0"
    chtChart.Axes(1).HasAutoMinorUnit = False
    'chtChart.Axes(1).MinorUnit = 0


    chtChart.SeriesCollection(0).Interior.Color = RGB(128, 128, 255)
    chtChart.SeriesCollection(1).Interior.Color = RGB(128, 32, 96)


    End Sub

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked Pivot Chart in a report (2003)

    I was away on vacation. Do you still have this problem?

  6. #6
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked Pivot Chart in a report (2003)

    Hi Hans,

    Seems that my Spam system toss out your e-mail and by chance I was checking my previous pots.
    Yes I still have the problem with the colors and I can't fix it.

    Regards,
    Marcel

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked Pivot Chart in a report (2003)

    Could you post a stripped-down copy of the database? See <post#=401925>post 401925</post#> for instructions.

Posting Permissions

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