HELP: RunInBackground does not work!

Posted by: gbetsos on 4 August 2017, 2:59 pm EST

  • Posted 4 August 2017, 2:59 pm EST

    Hi!



    I want to be able to print a progress report while my report is being generated. I also want to place a Cancel button on my progress report form. Thus, I have to execute my report by calling: rpt.Run True.



    The problem is that in this case nothing happens. No report is generated. When I call rpt.Run False my report is generated without any problem, my progress bar is updated, BUT the user cannot click on the Cancel button to cancel the report. Please HELP!
  • Replied 4 August 2017, 2:59 pm EST

    Hi,
    When you click "Run Report" in the attached sample the report runs in the background and
    right away a progress dialog is displayed to give a progress message to the user
    that the report is being generated and give him a chance to cancel. The report
    will be displayed when it is completed unless the user clicks the cancel
    button. If he does, the report is stopped and the dialog is
    removed.

    I use two timers with
    different intervals, one with a one second interval to update the message in the
    dialog box and one with a 1 millisecond interval to check if the user cancelled the
    report.


    Other users may post the way they do a progress dialog which may be better
    than this method.


    I suggest that you compare
    your method with this one to find out what is causing the report not to get
    generated when it is run in the background. If you still need help, please post a sample on how you are creating
    the progress dialog and run the report.


    2006/11/RunProgress.zip
  • Replied 4 August 2017, 2:59 pm EST

    Your code helped me find out the bug in my code. I was declaring the DDActiveReport variable locally, whereas the declaration should be global!
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels