R
RayTheOtherRay
I have a PivotChart, published to a web page, that uses different
formats (percent, currency, or comma) for the labels beside the
vertical axis depending upon which filter is in use. Right now I am
accomplishing this through the use of form buttons on the html page
that store the appropriate format string as a cookie value and then
reloads the page. On reload, the page picks up the cookie value and
sets the formatting for the vertical axis.
What I would like to do is find an event that is fired when the filter
is changed and let that event check the value of the filter to
determine the proper format string, send it to cookie, and reload the
page. This would keep the user from having to manually choose the
format for themselves.
One of the events I've been looking at from OCWVBA10.CHM is the
DataChange() event. The documentation says that it fires when the
PivotTable changes. It is supposed to return a reason for the change
in the form of a PivotDataReasonEnum. I looked through the constants
for PivotDataReasonEnum and found the following likely candidates that
appeared to have something to do with filtering.
plDataReasonFilterContextChange
plDataReasonFilterFunctionChange
plDataReasonFilterFunctionValueChange
plDataReasonFilterOnChange
plDataReasonFilterOnScopeChange
I believe that if I can find the "reason" that goes with a filter
change, then I can check the value of the filter an determine the
appropriate format string.
Does anyone have any experience with these events and constants, or
events that will do what I'm asking? I'm primarily using JavaScript,
but will gladly look at VBA examples to get the idea of how to do this.
Thanks!
RayTheOtherRay <><
formats (percent, currency, or comma) for the labels beside the
vertical axis depending upon which filter is in use. Right now I am
accomplishing this through the use of form buttons on the html page
that store the appropriate format string as a cookie value and then
reloads the page. On reload, the page picks up the cookie value and
sets the formatting for the vertical axis.
What I would like to do is find an event that is fired when the filter
is changed and let that event check the value of the filter to
determine the proper format string, send it to cookie, and reload the
page. This would keep the user from having to manually choose the
format for themselves.
One of the events I've been looking at from OCWVBA10.CHM is the
DataChange() event. The documentation says that it fires when the
PivotTable changes. It is supposed to return a reason for the change
in the form of a PivotDataReasonEnum. I looked through the constants
for PivotDataReasonEnum and found the following likely candidates that
appeared to have something to do with filtering.
plDataReasonFilterContextChange
plDataReasonFilterFunctionChange
plDataReasonFilterFunctionValueChange
plDataReasonFilterOnChange
plDataReasonFilterOnScopeChange
I believe that if I can find the "reason" that goes with a filter
change, then I can check the value of the filter an determine the
appropriate format string.
Does anyone have any experience with these events and constants, or
events that will do what I'm asking? I'm primarily using JavaScript,
but will gladly look at VBA examples to get the idea of how to do this.
Thanks!
RayTheOtherRay <><