Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

OnPrintExit Event

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OnPrintExit Event

    Is there any way to get this event to fire when exiting a "Print Preview" without printing the report? I need to run a script that opens an xdialog box when a particular report is closed after Preview, whether report is printed or not. When I print the report, the xdialog box opens. When I close the report by using "Exit Preview" or clicking the "X", the report closes, but the xdialog box does not appear.

    In AlphaFive V5, this works:


    'Prompt user whether to print, or preview the layout. Set default to Preview
    prompt_result = ui_get_print_or_preview("Preview ")
    IF prompt_result = "Print" THEN

    :Report.Print("TestReport",query.filter,query.order)

    ELSE IF prompt_result = "Preview" THEN

    :Report.Preview("TestReport",query.filter,query.order)

    END IF
    script_play_local("NewScript")


    The last script "script_play_local("NewScript")" doesn't run until the report is either printed or closed. But it runs immediately as the report is previewed in V8. So, Now I have this Xdialog open in front of my report. Not good.

    If anyone has any suggestions on how to accomplish this, I sure would appreciate it.

    Thanks
    Jim

    #2
    Re: OnPrintExit Event

    Jim:
    I haven't tried this but it's worth a try:

    IF prompt_result = "Print" THEN
    :Report.Print("TestReport",query.filter,query.order)
    ELSE IF prompt_result = "Preview" THEN
    :Report.Preview("TestReport",query.filter,query.order)
    END IF
    retry:
    while is_object("testReport")
    sleep(1) 'change time as you wish
    goto retry
    end while
    script_play_local("NewScript")

    Comment


      #3
      Re: OnPrintExit Event

      Thanks Al:
      I did try this and it appeared that Alpha locked up in a loop and I could not close the report.

      Jim

      Comment


        #4
        Re: OnPrintExit Event

        I just put the following code in a report's OnPrintExit event and the ui pops up after the preview is closed.

        Code:
        vTitle1 = "Mark Records" 
        vMsg1 =  "This will mark all the records for exporting."
        ui_msg_box(vTitle1, vMsg1,UI_INFORMATION_SYMBOL)
        Peter
        AlphaBase Solutions, LLC

        [email protected]
        https://www.alphabasesolutions.com


        Comment


          #5
          Re: OnPrintExit Event

          Peter:

          I also tried this. If you have the report open in Design Mode and click on the Preview icon to preview the report then exit the preview, this will work. With the report closed, if you double-click the report or call the report from a script to open it in Preview, then exit, this will not work. Tried it on an AlphaSports report just to make sure.

          Jim

          Comment


            #6
            Re: OnPrintExit Event

            Peter:
            I think the discrepancy is because James is running a script from the code tab (running a global script locally).
            I guess the answer would be:
            IF prompt_result = "Print" THEN
            :Report.Print("TestReport",query.filter,query.order)
            ELSE IF prompt_result = "Preview" THEN
            :Report.Preview("TestReport",query.filter,query.order)
            END IF
            'instead of script_play_local("NewScript") put the script itself here.

            Comment


              #7
              Re: OnPrintExit Event

              Jim,

              My report ran from a button on a form.
              Peter
              AlphaBase Solutions, LLC

              [email protected]
              https://www.alphabasesolutions.com


              Comment


                #8
                Re: OnPrintExit Event

                Gabe,

                My code is in the OnPrint Exit event. The "if-then-else code that you & Jim are using is not. Right?
                Peter
                AlphaBase Solutions, LLC

                [email protected]
                https://www.alphabasesolutions.com


                Comment


                  #9
                  Re: OnPrintExit Event

                  My code is in the OnPrint Exit event. The "if-then-else code that you & Jim are using is not. Right?
                  No, that part is in the OnPrint Exit (that's my understanding from what James is saying), but the next part of the script calls a global script to be run locally. I think that's the part that is causing this problem and I am suggesting that he puts the actual script (the one in the code tab) in the OnPrint Exit event of the report.
                  Last edited by G Gabriel; 07-29-2007, 02:00 PM.

                  Comment


                    #10
                    Re: OnPrintExit Event

                    Translating to English:
                    script_play_local("NewScript") is in the OnPrint Exit but it fires before exiting.

                    Suggestion:
                    Take the contents of "NewScript" and put it in place of this line of code.

                    Implied herein is a bug in either:
                    OnPrint Exit and/or
                    script_play_local

                    Comment


                      #11
                      Re: OnPrintExit Event

                      I think you may be right about the script_play_local. But if the "if-then-else" code is in the OnPrintExit, he is then telling the report to preview or print again. Seems like that would be an endless loop.
                      Peter
                      AlphaBase Solutions, LLC

                      [email protected]
                      https://www.alphabasesolutions.com


                      Comment


                        #12
                        Re: OnPrintExit Event

                        The code I want to run is simply a script to open an Xdialog Box and it is in the OnPrint Exit event of the Report. If I do as Peter did...put a button on a form to open the report, the script will run properly. The problem is this:
                        Ultimately this report will be run from QReportBuilder and forms are excluded on this stripped down version of Alpha, so I have to call the report from an xdialog box, instead of a form.
                        Jim

                        Comment


                          #13
                          Re: OnPrintExit Event

                          I mis-spoke:
                          The first part brings up a dialog box: preview/print.
                          I don't know where that part is, could be from anywhere and now I am not even sure which part James has in the OnPrint Exit? if any?

                          Comment


                            #14
                            Re: OnPrintExit Event

                            Originally posted by jas View Post
                            I have to call the report from an xdialog box, instead of a form.
                            So you are saying that when you run the report from xdialog, the OnPrintExit fires immediately on preview, even IF you put the xdialog code there w/o using script_play_local(). Correct?
                            Peter
                            AlphaBase Solutions, LLC

                            [email protected]
                            https://www.alphabasesolutions.com


                            Comment


                              #15
                              Re: OnPrintExit Event

                              James:
                              Read you last reply after posting mine.

                              1-You bring up an xdl that asks if you want to print or preview
                              2-If print is chosen, you print the report and then the "NewScript" runs as expected. In reality both run at the same time but since printing goes to your printer there nothing on the screen but the xdlg brought up by NewScript
                              3-On the other hand, when you preview, you see the preview window as well as the xdlg.

                              Again, there is a bug in either the OnPrint Exit or script_play_local. To find out which, I would try first to put the actual script in the OnPrint exit, if it works, the bug is in script_play_local, if it does not, who knows. In either case, I'd submit a bug report.

                              Comment

                              Working...
                              X