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

Limit number of records to print on report

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

    #76
    Re: Limit number of records to print on report

    Originally posted by jdoyle View Post
    Tim,
    I tested you suggestion in the zip you sent an earlier post in a different sample of my app. I didn't want to ruin my app that will be the finished product in cace I did someting wrong.
    Or in case I did something wrong. :D
    I entered some more data and ran a new report.
    See attached example:

    The weight is ok in that the last current "wtdate" is at the top (02/01/2050 1200)

    You have injections and wormer sorting by "date" given. It should sort by "due" for injections and "wormer_due for wormer. Then the injection "due" for 01/01/2050 would be at the top and the "wormer Due" for 01/10/2050 would be moved to the top. Thats what I thought you wanted from your description. But I guess I got confused about what the PDF represented, I thought it showed how you wanted the order but I think I see now it was what you were getting with your test that was not what you wanted. (Everyone confused now. I tried changing these as you stated in your reply, but could not get it to work. Kept getting Invalid expression. I think we'll need some more exact details on the steps you took to diagnose what went wrong there. In the select records dialog I just pressed the xy button in the order field bringing up the expression buillder. Then using F2 chose a field. Pressed OK to close the builder and then chose descending just below the Order field.

    I agree that this solution is the best.
    Not sure if it is the best. It definately has its limitations. Namely the record selection is limited to the last six physical records as opposed to being able to use some other filter.(But I guess if that is allyou need it will do.) I kind a like Gabe and Tom's solution using table.external_record_content_get()

    It is now 2 AM here--going to bed!
    Thank you -Thank you
    For your help Pleasure.
    Jim
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

    Comment


      #77
      Re: Limit number of records to print on report

      Jim,

      When you say to Tim:

      You have injections and wormer sorting by "date" given. It should sort by "due" for injections and "wormer_due for wormer. Then the injection "due" for 01/01/2050 would be at the top and the "wormer Due" for 01/10/2050 would be moved to the top.
      You are mistaken. When Alpha Five sorts records based on a date field it puts the lowest (earliest) record at top, and the highest (latest) record at BOTTOM. Just like a..z, it's January 1 to December 31.

      Your Injections "due" field is a date field. Sorting the records by this field will put the earliest "due" date at the top, not the bottom as you say.

      To reverse (invert) the sort sequence you use the Invert() function Alpha supplies.

      Here's an updated example that sorts records as follows for each llama:

      a) Weight table: top 7, sorted by invert(WTDATE)

      b) Injections table: top 7, sorted by invert(DUE)

      c) Wormer table: top 7, sorted by invert(WORMER_DUE)

      If you plan to use this report layout and the included functions and calc fields in the app you deliver to your customer I recommend you study them line by line. Use the help file to learn about functions you're not familiar with. Otherwise you won't be able to maintain this code by yourself, and my volunteer time for you has run out. <grin>

      Good luck with your project.

      Comment


        #78
        Re: Limit number of records to print on report

        Tim, Tom, Gabriel
        Don't mean to offend anyone but here is what I found.

        Gabriel: on the last zip you posted the "Print all records" doesn't not print the
        current last 6 records for an individual llama for me.

        Tom : on the last zip 010511 you posted the report will only show 6 records for weight and wormer no matter have many records or in the table. The 6 records that print are not sorted with the most current "wtdate" at top of list or the wormer "due" -one that is in the future at the top of the list. I tried changing you code but no go. Brute force is above my head.

        Tim: Your last zip worked after I change injection "date" to "due" and the wormer "date to "due. It keeps the most current dropping the rest and sorting with the correct records at the top just like it says in your code. The only item that I could not find to change was the number of records to print on the report. It now prints 6. How do I change it to 7 if I want 7 records to print?

        Yes, I am new to Alpha 5 and I am a slow learner, but with this message board, help files and the individuals that have replied to my questions, I feel that I am expanding my understanding of Alpha 5.

        I'am also assured that many others have learned something from this post as the number of views for this thread is one of the highest on the message board.

        Best of regards to You
        Gabriel, Tom and Tim
        Thanks
        Jim

        Comment


          #79
          Re: Limit number of records to print on report

          May be wrong, but don't think so!

          Most of the people on here will not just write your whole code for you, but will get you close enough that you can finish it yourself. That helps you learn. Some where in there is a place you can change it to 7. Finding will help you learn. Am I not right?

          Some would have done the report completely different and got the same result. It may have been too confusing had they jumped in. Learn one way and the other may be a flash of light one day.

          Good Luck to you.

          Dave
          Dave Mason
          [email protected]
          Skype is dave.mason46

          Comment


            #80
            Re: Limit number of records to print on report

            Jim,

            Tim found a typo in two of my custom functions. I've corrected it and the buttons now seem to produce the correct results.

            -- tom

            Comment


              #81
              Re: Limit number of records to print on report

              Hi Jim,

              I have attached a zip of your initial database with a modified version of your report named medical. I believe I have achieved what you wanted in the report. I have set it to show the top 5 records, if you want to show more, just change the conditional object properties in the subreport.

              Comment


                #82
                Re: Limit number of records to print on report

                Elke,
                Yes I had that version working also. but did not like the format of the report.
                Did't look to good becaused the records were stair step down the page.

                Looks for you input
                Jim

                Comment


                  #83
                  Re: Limit number of records to print on report

                  Tim,
                  Your code would work as long as you did not mess with the records.
                  If you delete one the the report does odd things. I tried starting with empty tables, tables in set, packing and updating index then added new data. Every thing worked fine until you modifyed a record. The code looked simple enough and the reports printed fast.

                  Thanks for you past help
                  Jim

                  Comment


                    #84
                    Re: Limit number of records to print on report

                    Tom,
                    I have studied your code and I understand what you mean by brute force. BUT IT WORKS! I have apply the code to my main app. and have done some testing and everything seems to work fine. I don't understand the 1 to 2 sec delay when rendering the report. My machine is 3.4 gig with 2 gig memory.
                    No big problem, but was just curious.

                    Now this may really be a dumb question, but you don't learn unless you ask.
                    In your code below for injections and wormer:
                    'Date Created: 10-May-2007 09:37:44 AM
                    'Last Updated: 13-May-2007 10:18:36 AM
                    'Created By : Test1
                    'Updated By : Jim

                    FUNCTION NextInjections AS C (vn_llamaid AS N )
                    '-------------------------------------------------------------------------
                    'Returns crlf delimited string containing next 7 injections, sorted by
                    'inverted DUE field. [ earliest date at bottom, latest date at top ]
                    '
                    'Use: pass the numeric id for a llama to the function.
                    ' NextInjections(0)
                    '
                    ' or put the llamaid in a variable and pass it instead
                    ' NextInjections(vn_curr_llamaid)
                    '--------------------------------------------------------------------------
                    dim x as c=""

                    x=TABLE.EXTERNAL_RECORD_CONTENT_GET("injections","dtoc(date)+' '+injection+' '+\
                    dtoc(due)"+crlf(),"invert(due)","llamaid = "+ vn_llamaid)
                    NextInjections = ""
                    if line_count(x) > 7 then
                    x = *line_remove(x,8,line_count(x)-7) 'keep top 7, discard others
                    end if
                    for each foo in x
                    NextInjections = NextInjections + foo + crlf()
                    next
                    'trace.writeln(NextInjections)
                    END FUNCTION


                    The code starting with "dtoc(dat) and code " = vn_llamaid are in red.
                    What is the reason. I though when the code was a good expression that the variables were in green

                    I do like what you suggested and have applied to my app and so far have had no problems.
                    I guess we might call this thread closed.
                    Thank so much for your time.
                    Jim

                    Comment


                      #85
                      Re: Limit number of records to print on report

                      Jim,

                      the delay in rendering pages in the report is because the data must be extracted from each child table and processed before each page can be produced. This is a fair amount of work since it involves three separate child tables each of which is being opened, queried, and then closed for each and every parent table record in your report. If your report covers 25 animals, each child table is being opened, queried, and closed 25 times.

                      I can't explain the colors you're seeing in the editor. Perhaps the line continuation character at the end of the previous line is the culprit. You might try removing it so that the entire expression is on one long line.

                      I'm glad you have it working acceptably. Good luck with your project.

                      -- tom

                      Comment


                        #86
                        Re: Limit number of records to print on report

                        Originally posted by jdoyle View Post
                        Did't look to good becaused the records were stair step down the page.
                        I'm sorry Jim, I don't get the same results. This is your report modified to filter the info you wanted.

                        Comment


                          #87
                          Re: Limit number of records to print on report

                          Elke,
                          Sorry i was looking at then wrong report. Will check it out more.
                          Jim

                          Comment

                          Working...
                          X