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

Print current runs query

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

    Print current runs query

    I have a form PO with a button, Print. The on push is to print the current record. The current index is PO number. When I press the button to print current I would think A5 would use the index for PO number to find the current. It always wants to run a query which takes time. Does anyone know how to print current and make it locate the current record immediately?

    Thanks
    Russ

    #2
    RE: Print current runs query

    Russ,

    Need more details.

    Are you trying to print the form, filtered to the current record?


    or


    Are you trying to print a report, filtered to the current record?


    -- tom

    Comment


      #3
      RE: Print current runs query

      Russ,

      I experimented with the action scripts to print the current record using the form layout.

      The 'print current record' action script runs a query on the table to filter out all records but those which match the current record number. You can see this if you 'view' the xbasic 'behind' the action statement.

      You might get faster results if you choose the option to select records at print time based on the value in a control on your form, after first verifying that you have an index in place based on that same field. This should permit LQO to kick in, alleviating the necessity of running a query.

      -- tom

      Comment


        #4
        RE: Print current runs query

        Thanks Tom,
        That's what I was trying to do when I got the anomaly shown in my other post. Perhaps I am misunderstanding what this choice does when used in the context of a button on a form. Maybe this will only work when used with record selection from the report. If thats the case it would explain why A5 shows the wrong set to select a field from as it has no way of knowing what set I would want so it just shows something probably the first set in some order A5 has. I will try to do this as you recommend from the report record selection.

        Russ

        Comment


          #5
          RE: Print current runs query

          What I am trying to do is print a report consisting of the current record only. In Alpha 4 I can set an index, select an index key and the report prints instantly. In Alpha 5v5 it seems to want to run a query, without LQO no matter how I set it up.
          For example the attached screenshot and the next on show a query and how the report is set up to use it. Since there is an index on PO number the report should be able to use LQO but it does not. If I run the query standalone (from the control panel), it does use LQO.
          So, the problem appears to be that the query will run "fast" (with LQO) from the control panel, but the same query run from a button, will not use LQO.
          I certainly would not go back to A4, but it does do some things faster or simpler.
          I would assume I could use xbasic to do this and get it to run with LQO, but the point is that this should be the same with Action Scripting.

          Thanks for the reply,
          Russ

          Comment


            #6
            RE: Print current runs query

            and the query

            Comment


              #7
              RE: Print current runs query

              Russ,

              It's difficult to troubleshoot someone else's app on my best day. Working with screen shots it's virtually impossible. If you furnish a test kit maybe we could explore the issue together more effectively.

              The screen shot suggests you telling Alpha Five to run a saved query, and your message says you don't want the query to run. Color me confused.

              -- tom

              Comment


                #8
                RE: Print current runs query

                Sorry about that Tom,
                I've tried it so many ways I think my messages are reflecting different parts of what I have tried.
                Let me try to make it simpler (or at least coherent)
                1. When I run a query from the control panel it runs with LQO.
                When I run the same query from a button on a form it is not optimized with LQO.

                2. It appears that using a query to find (for a report etc) 1 record is not efficient. It works but in A4 it is much quicker using an index and specifying a key value. When I use action scripting and select print current record it takes too much time to "find" the one record with a query. It would appear that using a range would work faster but is a LOT more cumbersome and time consuming. Maybe I'm off base here but I suspect that when the action scripting for this was designed, it was done with a small data set so this lag was not evident. I am using a sample data set of about 70K records, which is only part of the real data. This really slows it down. What I would like to do is set the index and specify a key in A5, but it appears that you can only specify a real key value, not a variable representing a key value. If it is there, then I'm not seeing it and apologize for my stupidity.

                I could put together a data set to show this and post it but it is proprietary data and to show it I would need to post a rather large data set.

                Thanks again
                Russ

                Comment


                  #9
                  RE: Print current runs query

                  Russ,

                  Do this to verify that LQO works or does not work.

                  Build simple form based on single (large) table.

                  Arrange to have the table indexed on a key field, which you display on your form.

                  Build a simple report based on the same table, and arrange for it to use 'currently selected records'.

                  Drop a button on the form, and program it's OnPush event with an Action Script which:

                  Uses the Print a Layout action statement, modified as follows:

                  a) Selects records to print, by specifying:
                  'Records that match value in a control on the current form'

                  b) tells Alpha Five to use the object on the form which displays the key field to compare with the key fields in all the records in the table.

                  Doing this will cause Alpha Five to run a query against the table. In my testing here, using a small data set, it happens so fast I can't tell if it's using LQO or not.

                  If you find that it does not, then I would venture to say that the query filter expression developed by the action script differs slightly from the expression we're using in our index. If the delay is bothersome, you will probably have to tweak the code generated by the action script.

                  -- tom

                  Comment


                    #10
                    RE: Print current runs query

                    Now this is getting weirder.
                    I installed my current build on the network and optimized. The client machine in this case is an AMD 450 with 256 meg ram (I think).
                    A5 runs really slowly on this machine. I was showing a user how to do some things on this machine and I ran the report that requires the query. I told her this will take a while but I am working on it. To my amazement the report (and the query) appeared to run very fast. It appeared to me that LQO was being used. Well, I figured I must be mistaken, and that it was actually using LQO after all. When I got home I tried it on my development maching. Running it from the button caused the records processed to be shown on the status bar which to me indicates that LQO is not being used. Then I tried running this from the control panel. From there it ran very fast with a blue bar to indicate progress, to me indicating use of LQO. I can't explain this. I will have to look further at it on the network to see if I can figure this out but probably not until after the conference as real work intrudes.
                    I will try your procedure when I can, and I appreciate the time you have put into this. A5 does do some strange things at times.

                    Thanks
                    Russ

                    Comment


                      #11
                      RE: Print current runs query

                      Russ,

                      I didn't read this whole thread in detail but in the past I have found this method to speed up certain reports by factors of as much as 20:1. (I must admit, this was in v4 and I haven't tested yet in v5.)

                      - Before printing, LOAD (don't Open) a form which uses the same set as the report.
                      - Run a query on the form. This query should only filter based on the parent table and preferably on indexed fields.
                      - Print the report... Report settings must be "based on existing records" and you should pass any additional filtering via the report 'print' command. In XBasic for this would be: Report.preview("RptName",FilterStr,OrderStr)
                      - Set the form loaded previously to "Show_all" and close it. (The form should have been Loaded but never shown. Setting it to Show_all makes sure the next user doesn't open a form with a strange query showing.)

                      Comment


                        #12
                        RE: Print current runs query

                        Thanks Cal,
                        I'll try your suggestions, but probably not until after the conference. See you there.Seems like A5 has made some things from A4 harder and slower. Oh well, there are always tradeoffs!

                        Russ

                        Comment


                          #13
                          RE: Print current runs query

                          I also wonder why it would be so hard to print a report JUST for the current record. A4 had a button genie that took care of that. Can't find it in A5.

                          Any code that needs to be written?

                          Comment


                            #14
                            RE: Print current runs query

                            Amir,

                            One approach is to drop a button on a form that's based on the same table or set as the report. Make it a custom button, using action scripting. You'll find the Action of printing current record in the Category for Reports.

                            You'll find this gives you more options with the current record than were available before. If you only need to print or preview the report and you always want the range of records limited to the current record, I think it can be done with a single line of xbasic code, or a simple action statement or two. Let me know if you need example.

                            -- tom

                            Comment


                              #15
                              RE: Print current runs query

                              Thanks Tom. I managed to set up the button using your suggestion, modifying the code, somewhat. I'm not very Xbasic savvy, but I can manage by plagiarazing existing code.

                              Amir

                              Comment

                              Working...
                              X