Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code needed to exit a report from a window inside that report 1

Status
Not open for further replies.

rleiman

Programmer
May 3, 2006
258
0
0
US
Hi Everyone,

In a report is a procedure that calls a parameter window which takes values that the report will use. After the user enters the values, the report runs. Here's the problem. If I click the Cancel button from this window, it closes the window but the report still runs.

Can you tell me what code I need to place in the Cancel button to stop the report from running?

Thanks in advance.

Emad-ud-deen Richard Leiman
 
Hi Emad,

Why do you need to call a seperate Parmeter Procedure to enter Report Selections? Just drop the Pause template on the Report setting it to Start Paused and put all the Selection parameters on the Progress Window itself. This will allow the Report to be executed many times with different selections without exiting the procedure.

To answer your question :

Where are you calling your code? Is it in the WM/RM.Init procedure. If yes, make sure your Parameter procedure returns a value depending on whether the OK or Cancel was pressed. So let's assume it returns True (1) or False (0).
The the Call can be :

IF NOT GetParameters() THEN RETURN LEVEL:Fatal.

Regards


 
Hi ShankarJ,

Thanks for such a quick reply!

Tonight I will look up how the pause template works in the help files as well as experiment with your suggestion on having the procedure return a value.

I need to check on the embed I used since it is on my home machine. I think it was the one for "after report starts" or something like that.

Truly,

Emad
 
Hi Emad,

Post your code and location and maybe I can help.

Regards
 
Hi ShankarJ,

I looked up the pause template in the help file and used that instead of the parameter form window. Since the only field on it was a numeric one, I just copied it to the progress window like you suggested and everything works well.

I hid the progress bar and un-hid it using a method I learned from you in a previous post when the user clicks the pause button to start the report.

By the way, the old code used a control template to call the parameter window procedure from the "open report" embed. No code was used.

Thanks.

Emad


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top