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

Printing - No records in query

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

    Printing - No records in query

    I've inherited a database with its share of troubles, am out of ideas on one point, looking for suggestions. I'll simplify the description:

    A button has this code:

    Code:
    t = table.get("cal_readings")
    dim query.filter as c = ""
    dim query.order as c = ""
    query.filter  = "Cal_id = '" + t.cal_id + "'"
    :Report.Preview("Certificate",query.filter,query.order)
    It works for a while, but a few times a day reports "No records found in query."

    We're sitting right on the record. I'm displaying the Cal_ID below the button and the user confirms it's present and correct.

    If they get everyone out of the db and re-index, the problem is resolved for another few runs. They're having to do this several times a day, and it's really a PITA. Cal_ID is one of two indexes in this table.

    In general, I believe the design of the system is a bit problematic and is producing indexing problems. But I should be able, one way or another, be able to run a report with a query and not be subject to such index issues. So I've tried some modifications to force a query that doesn't use the index, such as:

    Code:
    t = table.get("cal_readings")
    dim query.filter as c = ""
    dim query.order as c = "serial_number"
    query.filter  = "ALLTRIM(Cal_id) = '" + ALLTRIM(t.cal_id) + "'"
    :Report.Preview("Certificate",query.filter,query.order)
    Still no joy.

    Any ideas?
    -Steve
    sigpic

    #2
    Re: Printing - No records in query

    Have you tried to drop the query?
    Sounds like you used all available slots.
    Drop & Detach.
    P.S.
    Allowable slots=16 but, it's more of an arbitrary number. I'd drop it after each run.

    Comment


      #3
      Re: Printing - No records in query

      If you are only wanting to print the record that currently has focus you could just code for the record number instead of the ID.

      Don't quote me on this code, did from memory
      Code:
      query.filter  = "Recno() = " + t.recno()
      Andrew

      Comment


        #4
        Re: Printing - No records in query

        Have you tried...

        Code:
        t = table.get("cal_readings")
        dim query.filter as c = ""
        dim query.order as c = "serial_number"
        query.filter  = "ALLTRIM(Cal_id) = '" + ALLTRIM(t.cal_id) + "'"
        t.query_create("N",query.filter,query.order)
        :Report.Preview("Certificate",query.filter,query.order)

        with the report based on current selection of records?
        There can be only one.

        Comment


          #5
          Re: Printing - No records in query

          I prefer to reduce the number of levels of indirection.

          Here the .Preview method must evaluate "query.filter", only to find that the filter itself requires parsing the table pointer, and then parsing the field name. I suspect a timing issue. The script may not be waiting while this work is going on.

          Suggest you assign the cal_id directly to a variable and then use that term in your filter.

          -- tom

          Later...

          Using the global variables in your filter expression requires even more work, right?

          The preview method looks for a filter.
          The filter references a pointer variable. Locals are search. Shared are searched. Finally globals are searched.
          But wait, the global is a pointer so now it must search through the properties of the pointer var to find the "filter" property.

          All of this work can be eliminated using a local variable called "filter expression".

          (PS. I hope Steve's not working on one of my old apps!)
          Last edited by Tom Cone Jr; 08-25-2011, 05:46 PM.

          Comment


            #6
            Re: Printing - No records in query

            Thanks. 4 ideas, and I'm going to throw all four of 'em at the app at once. So I may not know which is the "solution" but I hadn't tried any of these. I'll follow up when I know -- probably be Monday assuming we have 'lectricity.
            -Steve
            sigpic

            Comment


              #7
              Re: Printing - No records in query

              Originally posted by Steve Workings View Post
              Thanks. 4 ideas, and I'm going to throw all four of 'em at the app at once. So I may not know which is the "solution" but I hadn't tried any of these. I'll follow up when I know -- probably be Monday assuming we have 'lectricity.
              So you guys are getting hit high and low... don't forget to charge your cell phone...
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: Printing - No records in query

                Locusts next week.
                -Steve
                sigpic

                Comment


                  #9
                  Re: Printing - No records in query

                  You probably thought of this but aren't query.filter and query.order globals by definition? When you "dim query.filter as C = "" " isn't there the possibility of confusion in the scope of the variable at some point if not always. At some point one or other ends up with an invalid value and messes up the query. Which is why I stopped using that syntax a long time ago.

                  Wouldn't just a declaration of query.filter = "" and query.order = "" be proper and take care of the issue?
                  Finian

                  Comment


                    #10
                    Re: Printing - No records in query

                    Steve,
                    I will lay odds that adding (or just using) flag "M" will fix that problem. I've experienced what you describe and that worked. Remember that a query doesnt monitor table data change like an index does.
                    post #4 ;
                    Originally posted by Stan Mathews View Post
                    ...
                    t = table.get("cal_readings")
                    dim query.filter as c = ""
                    dim query.order as c = "serial_number"
                    query.filter = "ALLTRIM(Cal_id) = '" + ALLTRIM(t.cal_id) + "'"
                    t.query_create("N",query.filter,query.order)
                    :Report.Preview("Certificate",query.filter,query.order)
                    Last edited by Ray in Capetown; 08-26-2011, 06:22 AM. Reason: added "data" changes

                    Comment


                      #11
                      Re: Printing - No records in query

                      Steve....did you get anything to work?
                      Mike
                      __________________________________________
                      It is only when we forget all our learning that we begin to know.
                      It's not what you look at that matters, it's what you see.
                      Henry David Thoreau
                      __________________________________________



                      Comment


                        #12
                        Re: Printing - No records in query

                        Yeah, all fixed - I should have done the promised followup.

                        The fix was one or the other or both of these:

                        1. Tom's advice to resolve the variable in the string earlier (yes Tom, you'll recognize this app with it's cal_header and cal_readings); and
                        2. Adding query_detach_all() after each print event.

                        Because it works, I'm not going to tear it apart and see which one of these made the final difference.
                        -Steve
                        sigpic

                        Comment

                        Working...
                        X