When I start the new report and link to the 2 DPs and I click the refresh button I get the usual BO prompt window. But after I put in the Macro code and did a refresh from VBA, the BO prompt stops showing. Ofcourse that is what should happen.
But my problem is, even if I comment the code and click the refresh button, The BO report refreshes with out the prompts. The same happens in the Datamanager Refresh button - No prompts even after purging also. I am using the following code for the refresh
Private Sub Document_BeforeRefresh(Cancel As Boolean)
Cancel = True
frmInput.Show
End Sub
Is it the default behaviour? Or am I missing something…Please Help
Can you please eloborate. I dont understand. You mean to say that by adding conditions and / or adding the .IsRefreshable = true / false will solve the problem.
Hi Mukund,
I am a bit confused about your problem.
Once BO executes the code Application.Interactive = False then you will not get any prompts till you close and restart BO or till Application.Interactive = True is executed. Is this what your problem is?
Please elaborate.
Thanks for the help. The problem in my report is a bit weird. I am using a stored procedure for getting my data. But I am calling the stored procedure through freehand sql as
As you see there are no objects linked to the Prompts. I am using a VBA form to capure the user input which may include multiple values (list). I then build the input strings with the required single quotes etc and pass it to the respective variables. The report works well except that after one refresh through the Macro, BO stops prompting in the Data manager. But still I could use my Macro to refresh the report and the values are reported correctly. In this situation is it possible to use conditions? Please suggest if there is any other way to do this
I’m a little confused myself. Do you or do you not want the prompts to show? If you want them to show and they don’t automatically appear each time, I would try using the .hide = False in your vb coding portion of your macro. I could probably come up with the code, but vb coding is not my expertise (as noted in the thread I sent you). The .hide maybe .show or .hidden, it’s been a while since I used it.
If you are unable to get it working like you want let me know. By the way, is the whole report in free-hand sql or just the procedure call for the variables?
Sorry for my late reply. First to your question. I dont want the default BO prompt to show. I am luanching a user Form to collect the user input parameters and assign these values to the BO variables.
Now the problem. After refreshing the Report through the macro for the first time the report refreshed properly from the next refresh onwards BO stopped prompting even when when I am refreshing thro data manager.
The cause. The document.variable created by the macro is not deleted after the refresh. The variable is retained by the report along with the value supplied. So the report doesnt need any new values for the refresh so no prompt
And the solution. After adding the values and supplying the user selected parameters and refreshing, I looped through the doc.variables and deleted those variables that I added. So no variable and no parameter values for the next reresh. So BO started promting the usual way.