Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to set sort column in straight-table chart

Greetings.

I have a QVW that has a number of charts that gets delivered to a customer. Right now, when I've made modifications, I have to manually go through every straight-table chart and make sure that they're all sorting on the correct column (Patient Last Name). I was hoping to write a macro I could run, to save the manual steps each time.

I found "SortBy" in the macros, that indicates it will set whatever column number indicate (such as SortBy 1), to the top of the sorting priority. However, when I try applying this, it seems to pick random columns. I assumed it meant internal columns (some of them are hidden) or just by counting the ones displayed, but either way, I'm getting inconsistent results.

This has got to be something simple and I'm being dense. But I'm not getting any joy with the API Guide. Help! Please!

2 Replies
Not applicable
Author

Hi Sally,

This may help.

Not applicable
Author

Thanks for the response. That's basically the code I have. I tried yours, it works great. I try mine, it doesn't. But some of my charts are minimized. I also have multiple tabs with charts, that I want all processed by the same macro. If I minimize your charts, and try running your macro, it doesn't update the chart. I also moved the button to another tab on your document, and it failed to change any of your charts.

So - it seems I'm doing the right commands, but it only works if the macro is initiated from the page that has the charts on them, and if they're visible (not minimized).

I've tried restoring the chart, and changing focus to the page before running SortBy, but it seems to have no affect. Any other ideas?