Alpha Video Training
Results 1 to 23 of 23

Thread: Reports printing automatically at a set time

  1. #1
    Lynda Huddleston
    Guest

    Default Reports printing automatically at a set time

    Is there a way to make certain reports print based on a time. So, if there is a report that a company needs to see each day, can it print and be waiting for them in the morning, without activating the report themselves?

    Thanks for the help

  2. #2
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: Reports printing automatically at a set time

    You can use script_schedule() to schedule a script to run at a set time.

    e.g.
    script_schedule("run_report","7:00")
    will run the "run_report" script at 7 a.m.

    and the run_report script is:
    report.print("daily_report")
    xbasic_wait_for_idle()
    script_schedule("run_report","7:00")

    which will run the report,wait for the report to finish, and then reschedule itself for the next morning.

  3. #3
    Lynda Huddleston
    Guest

    Default RE: Reports printing automatically at a set time

    Thank you for the response. You have always been very helpful.
    Lynda

  4. #4
    Lynda Huddleston
    Guest

    Default RE: Reports printing automatically at a set time

    Have a report (Reservations - Week) that I want to print on Sundays, and one (Reservations - Today) I want to print each morning.

    I have looked at the script you sent, but not quite sure how to execute. Are these two scripts or one.
    Where do I place them?

    Thank you for your help

  5. #5
    Lynda Huddleston
    Guest

    Default RE: Reports printing automatically at a set time

    Can anyone help me figure out where to put the script for timed reports. Is it in the report itself, or by creating a script does it automatically run even if not attached anywhere?

    Thanks for the feedback.

  6. #6
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,858

    Default RE: Reports printing automatically at a set time

    Lynda,

    We have a need to run numerous tasks at night and on the weekend. We found a little product called "launchpad" which has the ability to run tasks at a scheduled time. We use it to "launch" alpha and then send "keystrokes" to alpha to depress buttons on a menu form. Launchpad runs minimized and then at a given, set time, executes a scheduled task. We use it extensively on our servers as well as workstations to perform many of the "cleanup" tasks as well as "batch" operations that need to be done at night or on the weekends. We set up an application and point Alpha at the application. On the startup form are buttons which can be pressed using a "ctrl"letter combination. It has worked out very well for us. I don't believe it is very expensive at all.

    It is from Cypress Technologies.

    http://www.cypressnet.com

  7. #7
    Moderator
    Real Name
    James A. Talbott, Jr.
    Join Date
    Apr 2000
    Location
    Versailles, KY
    Posts
    1,436

    Default RE: Reports printing automatically at a set time

    We use Launchpad too, and it is a great product, but we use it for other things.

    We "launch" our Alpha program every morning at 6:00 using Windows task scheduler, then run an autoexec script which starts automatically when Alpha starts.

    Hope this helps.

    Regards,
    Jay Talbott

  8. #8
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: Reports printing automatically at a set time

    Lynda,
    If you create a script called "autoexec", it will run as soon as you start up your database.
    Your autoexec script should include the line
    script_schedule("run_report","7:00")

    (your full autoexec script can be simply something like this:
    Code:
    ' autoexec script
    script_schedule("run_report","7:00")
    form.view("Main_Menu_Form")
    end

    and then your run_report script can be
    Code:
    ' Run_report script
    if dow(date())=1 then
      report.print("Sunday_report")
    else
      report.print("Daily_report")
    end if
    xbasic_wait_for_idle()
    script_schedule("run_report","7:00")
    end

    Is this what you need?
    - Peter

  9. #9
    Member
    Real Name
    RT
    Join Date
    Apr 2000
    Posts
    726

    Default RE: Reports printing automatically at a set time

    Hi Lynda:

    There are a couple of different options when creating scripts, but in this case, it would probaby be easier if you create and save a script in the Alpha Five Control Panel.

    There is a Code Tab on the Control Panel and this is where you want to create a NEW Script using Xbasic. You should cut and paste the script Peter Wayne wrote and then name the script Autoexec.

    Robert T

  10. #10
    Lynda Huddleston
    Guest

    Default RE: Reports printing automatically at a set time

    This is very helpful. Thank you for the response.
    To make sure I understand. If I go to the code and enter the autoexec script and save it. Do i then attach it somewhere. It seems like you're saying, make the script what loads when the system is being loaded, which runs the report script and then opens the main menu? Is this right? What if they don't open Alpha before the "Time" period (7:00) everyday? What if Alpha system is left on over night - would it recognize it at 7:00 and run?

    I guess the only thing I'm not sure of is how to "activate" the script. Or does it run from the script even if not attached somewhere.

    Thanks again for the help. Lynda

    Please also, feel free to call if it would be easier to explain live. (801) 458-1606. THANKS AGAIN!

  11. #11
    Lynda Huddleston
    Guest

    Default RE: Reports printing automatically at a set time

    Thank you for the response. I will look into launchpad, it sounds like a great tool for many things.

    Lynda

  12. #12
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Reports printing automatically at a set time

    Linda,

    If you name a script autoexec it runs whenever you start up the application. (Each application can have its own autoexec script.) Hence, if your users leave your application on overnight the script will not run next day.

    You could deal with this by writing another script to shut down your application after a specified interval of inactivity. This is a good idea in and of itself.

    Bill

  13. #13
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,056

    Default RE: Reports printing automatically at a set time

    Hi Linda,

    Peek at this:

    http://support.alphasoftware.com/alphafivehelp/index.htm

    At the search button, type in "Autoexec"

    Look at the various listings, it will give you an idea of what the "Autoexec" can do for you, and how it works.


    Ed

  14. #14
    "Certified" Alphaholic
    Real Name
    Ed Barley
    Join Date
    Mar 2002
    Location
    Southern California
    Posts
    1,056

    Default RE: Reports printing automatically at a set time

    Sorry Lynda

    Ed

  15. #15
    Lynda Huddleston
    Guest

    Default RE: Reports printing automatically at a set time

    Thank you for your response it helps clarify a few things. but it brings up the following: So if the autoexec runs each time the application is opened, when does the 7:00 come in? If it is opened at 8:00 am, will it not run the report until 7:00 the next morning?

    What if the application is shut down during the day and re-opened, does this mean the report would run again?

    Sorry for all the questions, and thanks in advance for any help.

    Lynda

  16. #16
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Reports printing automatically at a set time

    Lynda (got it right this time),

    Script_schedule runs a script at a designated time. If that time is 8:00 AM and the application is run at 7 then the script runs in one hour. If the application is run at 9:00 the script will run 23 hours later.

    Bill

  17. #17
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: Reports printing automatically at a set time

    Lynda,
    Also, if you shut down Alpha Five, the script will not run at all. Script_schedule() is something that Alpha Five is does. Windows has its own task manager, incidentally, and if you want to run something without keeping A5 open, you could create a second database, add the appropriate tables to it, have an autoexec script comprised of these lines:
    report.print("daily_report")
    xbasic_wait_for_idle() ' to make sure report finishes
    a5.close()

    and then use the Windows task manager to start up this "reporting" database up at 7:00 a.m. Then your users do not have to leave Alpha Five up and you don't have to worry about scheduling under Xbasic -- let the Windows task manager do it for you.

  18. #18
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,561

    Default RE: Reports printing automatically at a set time

    Lynda

    To expand on Peter's idea, you can use the shortcut genie and put the scripting in the advanced tab. Then have windows' task scheduler start Alpha using the shortcut at the appropriate time. You have the advantage of only one database and one place for scripts to be stored.

    It's also a great place to put general maintenance functions to run unattended. - Rebuild indices, backups, pack tables, and reports.....

    See attached image of the shortcut genie.

  19. #19
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Reports printing automatically at a set time

    Hi,

    I have read the contents of this thread and it's very close to what i need to achieve.

    I need to send an automated email containing a filtered report for data between 7pm and 7am from an alpha table. daily.

    Can anyone help me with this please?

    Thanks in advance.

    Denis

  20. #20
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Reports printing automatically at a set time

    Do you need help

    creating the script to send the email
    creating a command to schedule the script
    creating a report
    creating a filter for the report for data between 7pm and 7am

  21. #21
    Member
    Real Name
    Denis Ahmet
    Join Date
    Jul 2005
    Location
    United Kingdom
    Posts
    988

    Default Re: Reports printing automatically at a set time

    Hi Stan,

    I have created an autoexec script

    This is intented to run the main script at 7am every day.

    Code:
    ' autoexec script
    script_schedule("Email_Report","7:00")
    end
    I need help with the actual script 'Email_Report'.

    creating a filter for the report for data between 7pm and 7am

    My date field is 'rdate' and my time field is 'rtime'.

    Thanks

    Denis

  22. #22
    Member
    Real Name
    Ken
    Join Date
    Jun 2010
    Posts
    115

    Default Re: Reports printing automatically at a set time

    How do you go back and change shortcut genie

  23. #23
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Reports printing automatically at a set time

    In the directory of the database being opened by the shortcut you will find a file named

    databasename_shortcutname.startup

    which can be right clicked on and Open With... your favorite text editor. Modify the line(s) that begin with

    -COMMAND=
    There can be only one.

Similar Threads

  1. Problem printing reports
    By Manibal in forum Alpha Five Version 4
    Replies: 10
    Last Post: 03-06-2012, 02:09 PM
  2. Printing Reports
    By Rokrz in forum Alpha Four Versions 7 and 8
    Replies: 0
    Last Post: 11-14-2003, 05:36 AM
  3. Printing Reports
    By JIM HOWELL in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-26-2002, 05:05 AM
  4. printing reports
    By WillieLucas in forum Alpha Five Version 4
    Replies: 2
    Last Post: 06-22-2002, 09:05 AM
  5. printing off screen - 2nd time
    By ed patricelli in forum Alpha Four Version 6 and Prior
    Replies: 3
    Last Post: 07-08-2001, 09:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •