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



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

Ask Variables on a report

  • Filter
  • Time
  • Show
Clear All
new posts

  • Ask Variables on a report

    Very basic stuff this (I hope!) but can't find any documentation that helps.

    I am using ask variables to filter reports e.g. dates from and to but I can't find a way to get the user input of the date range ask variables to display on the report.

    In alpha 4 I used to use script dialog boxes for user imput and these variables were available when creating a report.

    any quick fixes?

  • #2
    Re: Ask Variables on a report

    Originally posted by gregtcm View Post
    Very basic stuff this (I hope!) but can't find any documentation that helps.

    I am using ask variables to filter reports e.g. dates from and to but I can't find a way to get the user input of the date range ask variables to display on the report.

    In alpha 4 I used to use script dialog boxes for user imput and these variables were available when creating a report.

    any quick fixes?
    The usual way is to put two global variables on a form. Put a button on the form that prints the report. Have the report filter reference the variables.

    You could have the report filter reference the ask variables directly.

    By following a simple naming convention, you can control the order in which the ASK variable prompts appear on the dialog box. Alpha Five uses the portion of the ASK variable after the prefix to form the prompt used in the input dialog box.

    The following expression was placed in the Filter Expression field on the Filter/Order tab of the Customer Information Properties dialog box.

    lastname > var->askC_Lastname .and. Firstname > var->askC_Firstname

    The expression produces the following pop-up dialog box when the Customer Information form is opened. [Picture]

    The dialog box that Alpha Five displays prompts for the firstname field before the lastname field (since that is their alphabetical sort order). However, by renaming the ASK variables as follows, you can ensure that the dialog will prompt for the lastname field before the firstname field.

    lastname > var->askC_1_Lastname .and. Firstname > var->askC_2_Firstname
    thus you could have a report filter

    lastname > var->askC_1_Lastname .and. Firstname > var->askC_2_Firstname
    There can be only one.


    • #3
      Re: Ask Variables on a report

      Thanks Stan,

      I have been trying to do this but to no avail, no the answer must be simple but I need running through the exact way to do this. I can already use Ask Variables but although they filter the report I am printing they will not show on the report editor to place on the form for printing.

      The form and report I am setting up are for site visits to a property we maintain with dates of each visit

      I have created a Global variable called Date_From

      I have set up a form that has a variable field on it called Date_From that uses a calender box to enable a user to enter a date (e.g 01/05/2007) NB UK so that is 1st May 07! then I save the record I am viewing. I have a button on the form that previews a report with site_name as the main Group and all dated visits to that site are the detail. I have set the filter in the report to see the global variable and only child records with that date should show.

      I then placed a calc field on the report Header i.e. month(Var->Date_From) to show the month of the dates filtered. e.g. Sites visited in the month of Month(Var->Date_From) using the expression builder.

      So far no records are being selected for preview??? but ask variables work.

      There must be an easier way to do this? Getting Ask Variables to actaully appear on a printed report would be the easiest for me to work with at the moment. All I want is a way a user can specify a date Oor two) on a form and then print a report that uses that date as a filter and also shows that date (or calc field with expression result using that date) on the printed report.

      I really miss Alpha 4 scripts!


      • #4
        Re: Ask Variables on a report

        Check this thread for the examples from Tom Cone at the end.
        There can be only one.


        • #5
          Re: Ask Variables on a report

          try putting the ask variable into a calc field, then place the calc field onto the report. We do this all the time.

          You can use the calc field as part of the filter instead of the variable.

          Last edited by Tom Henkel; 07-12-2007, 02:37 PM.


          • #6
            Re: Ask Variables on a report

            We also declare, then set variables through an x-basic dialog. Attached is the dialog box, and what follows is the code. We use this to filter the reports. I pass the global date variables into the report where they are also defined, then create calc fields using those global variables. The filter in the report is based on these calc fields. I don't know your experience level with x-basic, so don't take this wrong. The code may seem a bit overwhelming, but it is actually pretty straightforward, and it will accomplish what you need.

            'Date Created: 16-Apr-2007 03:38:47 PM
            'Last Updated: 17-Apr-2007 02:17:38 PM
            'Created By  :
            'Updated By  : 
            'Create an XDialog dialog box to prompt for parameters.
            DIM SHARED report_sel as C
            DIM GLOBAL Start_date as D
            DIM GLOBAL end_date as D
            DIM SHARED Vendor as C
            DIM GLOBAL Vend_no as C
            DIM SHARED varC_result as C
            ok_button_label = "&OK"
            cancel_button_label = "&Cancel"
            varC_result = ui_dlg_box("Post TANF Wrap Around System Reports",<<%dlg%
            {frame=1,1 Reports}
            {region}Please select a report to print:{endregion}{sp}
            {region}(report_sel:Monthly Paid Detail);
            (report_sel:Total Paid Summary);
            (report_sel:Vendor Payment Summary);
            {frame=1,1 Dates}
            Please Enter Begin Date:|   [%DATE;P=popup.calendar(dtoc(Start_date));I=popup.calendar%.20Start_date!Start_date_*];
            Please Enter End Date:|   [%DATE;P=popup.calendar(dtoc(end_date));I=popup.calendar%.20end_date!end_date_*];
            {condition=(report_sel="Vendor Payment Summary")}
            {frame=1,1 Vendor Information}
            {region3}For One Vendor or All Vendors:{endregion}
            {region}(Vendor:All Vendors);
            (Vendor:One Vendor);
            {condition=(Vendor="One Vendor")}
            Enter Vendor Number:| [.10Vend_no]
            <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
            if left(a_dlg_button,11) = "Start_date_" then 
            	if a_dlg_button = "Start_date_killfocus" then 
            		Start_date = ctod(dtoc(Start_date))
            	end if 
            	a_dlg_button = ""
            end if 
            if left(a_dlg_button,9) = "end_date_" then 
            	if a_dlg_button = "end_date_killfocus" then 
            		end_date = ctod(dtoc(end_date))
            	end if 
            	a_dlg_button = ""
            end if
            if varC_result= "CANCEL"
            	ui_msg_box("Post TANF Wrap Around System","Action Cancelled at user request")
            end if
            if start_date = {} .or. end_date = {}
            	ui_msg_box("Post TANF Wrap Around System","Dates cannot be blank"+chr(13)+chr(13)+"Please Enter dates")
            	goto again
            end if
            if end_date < start_date
            	ui_msg_box("Post TANF Wrap Around System","End Date cannot be earlier than Start Date"+chr(13)+chr(13)+"Please Re-enter dates")
            	goto again
            end if
            if vendor = "One Vendor" .and. Vend_no=""
            	ui_msg_box("Post TANF Wrap Around System","Vendor Number is missing"+chr(13)+chr(13)+"Please Enter Vendor Number")
            	goto again
            end if
            if vendor = "One Vendor" .and. Vend_no<>""
            	dim Global Vendor_num as N
            	vendor_num = val(vend_no)
            	if .not.exist(vendor_num,"vendor","Vendor_No")
            		ui_msg_box("Post TANF Wrap Around System","Vendor Number "+vend_no+" is invalid"+chr(13)+chr(13)+"Please Enter a valid Vendor Number")
            		goto again
            	end if
            end if
            'now that we've got everything, let's print the report
            'variables: "rep_select"= selected report
            '			"Start_date"= begin date for report
            '			"End_date" = ending date for report
            '			"Vendor_num" = Vendor Number for Individual Vendor Summary
            if Vendor = "One Vendor"
            	query.filter = replace_parameters("Vendor->vendor_no = [varN->Vendor_num]",local_variables())
              	query.filter = ""
            end if
            query.order = ""
            if level = "A"
            end if
            Last edited by Tom Henkel; 07-12-2007, 02:58 PM. Reason: variable placement for filter