Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have code behind a button that does the follow:
1) Selected the current Year
2) Select the current Month
3) Selects the email recipient
4) Export a chart to excel
5) Emails the excel file the user.
All works, however, the YTD set analysis portion of the chart does not reflect YTD data in the email (or on the chart).
However, if I select everything manually (ie not through the button) the YTD set analysis portion of the chart is calculates acurately.
Any ideas what is happening?
Stephen
Hi,
What is the formula you are using for the set analysis portion? What Actions (or Macro?) does the button have?
Is it possible for you to post an example qvw?
Mike.
I can only guess that the commands are being processed so fast that the chart is being exported before it's recalculated. If this is a macro, there is an API that takes care of it:
WaitForIdle - look it up in the API guide.
If you are doing it using Actions, - then I'm not sure you can force a pause to let all the charts recalculation prior to sending the e-mail. Just to verify the theory, try splitting the job into two buttons - first button applies selection, and the second button does the export and the e-mail part.
cheers,
Found my problem. There are two fields that represent the month, one is a number the other is the name of the month. My set analysis was looking the the number, when I changed it to look at the name it worked.
It didn't look like I needed the WaitForIdle API but I did add it after the "selection"part of the code as it does process fast.
Thanks,
Stephen