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

Inconsistant Calc Fields in Report

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

    Inconsistant Calc Fields in Report

    This is one of those that works perfectly in V8, every time. In V9 it doesn't. I'm using the latest build, new browse.

    I have two calculated fields on a report that do not evaluate the first time the report is run from a button on a form. They do evaluate correctly if the button is pushed a second time to re-run the report. The report works correctly every time it is run from the control panel by dbl clicking it. The report works correctly every time it is run by dbl clicking the script to run it in the control panel. It does not work the first time, everytime it is run from a button on form that is only calling the script to run the report. I've attached a stripped down version of the app with one form. To test, open the "Pay_on_Account" form and click on the "TEST REPORT PREVIEW" button. The first time it is pushed, select preview or print it doesn't matter, the report opens with "Inv_total" and "Inv_balance" shown where the calculated fields by the same name should be shown. Pushing the button a second time and the report shows the correct information. Does anyone else see the same behaviour? I've tried on two different machines here with the same results.
    Jim Coltz
    Alpha Custom Database Solutions, LLC
    A5CustomSolutions.com
    [email protected]

    #2
    Re: Inconsistant Calc Fields in Report

    Hi Jim,

    I can confirm this strange behavior. The report prints first time in V8 but needs to be run a second time from the button in V9 to get the calc fields to display correctly.

    I will try and see what is happening in the morning as it late here now.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: Inconsistant Calc Fields in Report

      The calculated field gives an error of "Operator can't be used with this data" and the first calculation is the culprit apparently using the minus sign

      calc->Inv_Total-

      But even curing this by placing the actual calculation does not resolve your issue---certainly does look like a v9 problem.
      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


        #4
        Re: Inconsistant Calc Fields in Report

        Jim, subject to Keith's findings in the morning, I think you're facing a timing issue resulting from your use of nested calculated fields that require lots of disk and network activity.

        For example:

        The Inv_balance calc field sums three other calc fields:

        a) One of them, Pd_onServdt uses dbsum() to compute the total of a field in the Cash_register table.

        b) The second, Pat_pay_recvd, uses dbsum() three times, against the Payments table each time, to compute sums on three fields and then add them together.
        c) The third, Ins_pay_recvd, uses dbsum() three times, against the Payments table each time, to compute sums on three fields and then add them together.

        Each time you use dbsum() in a calc expression Alpha has to go to the server open the table, set the desired index, fetch the first matching record, and then loop through them until no further matches are found, then close that table. A fair amount of work done once. In your design the payments table is actually opened, searched, and closed 6 separate times. And the Cash_register table is opened, searched, and closed also.

        I suspect that while all this work is going on the report engine continues to build the report layout. You get the calc field names because the computations aren't finished by the time the fields are to be displayed in the report layout.

        Why this used to work and doesn't now is not for me to say, but there are some things you should be doing, in my opinion, to speed up the computation of these aggregating field values to reduce the load on the server, the network and the accompanying time delays. In this case it seems the report will be run against a single client/patient. I'd offload the computations from the report layout and move the processing to the button script that calls the report, passing the computed totals to the layout using globals. In the button's script the payments table would only have to be opened once, because you could aggregate all six fields on each record fetch.

        -- tom

        Comment


          #5
          Re: Inconsistant Calc Fields in Report

          Hi Jim,

          Thanks to Tom pointing me to look at the DBSUM() you were using, I questioned why you needed to get a total of a field in the parent table when it was always going to be the value from a single record.

          Having removed the second dbsum() from the calc of Inv_Total, and just left the field Tax_Coll, it works first time, every time.
          Code:
          inv_total = dbsum("invoice_items","Invnox",Invoice_Head->Inv_Number,"extension")+Tax_coll
          Why this worked in V8, I guess you were just lucky. (Or the bug was there and not in V9)
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


            #6
            Re: Inconsistant Calc Fields in Report

            Also, when aggregating total charges and total receipts for records in the payments table the number of separate dbsum() calls could be reduced by storing the net received or charged for each line item in the line item record itself. The "net" for a record is computed when the item record is saved. All the report has to do is aggregate the "nets", so to speak. In effect some of the computation work is offloaded to the data entry sequence so that the results are pre-computed when the report is run.

            Comment


              #7
              Re: Inconsistant Calc Fields in Report

              Thanks guys. Changed some things around a bit per your suggestions and all is working now.
              Jim Coltz
              Alpha Custom Database Solutions, LLC
              A5CustomSolutions.com
              [email protected]

              Comment

              Working...
              X