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 # of records in a subreport

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

    #16
    Re: Limit # of records in a subreport

    Again..That's what I meant. To summarize that child table to limit it only to a max of 5 records/customer, most recent 5 by date.

    Comment


      #17
      Re: Limit # of records in a subreport

      and how do I do that because that is the answer to what I need

      Comment


        #18
        Re: Limit # of records in a subreport

        I will see if I have few minutes today to write an UDF to do that. basically you upload the records in an array..delete the excess records then save the array to a table. That table, not the original child table, would be the one used in the set for the report purpose. This could be a separate set just for that purpose.

        Comment


          #19
          Re: Limit # of records in a subreport

          I too have bookmarked this thread to try to create a solution if I can free up the time....I know what G is proposing will work, but am wondering if just limiting the records by the Top_Records() function (as G indicated previously as well) after setting the sort order or even TOP_RECORDS_LIST() function would also work much simpler...that is the method I would be trying first if I were.
          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


            #20
            Re: Limit # of records in a subreport

            Thank you Gabriel what I want to know will that continue to update as invoices are added and delete old ones or will that have to be seperate item? Mike I tried the TOP_RECORDS_LIST() it did give me one work order with the top 5 invoices but no more work orders and we have over a 100 work orders a month so either I used it wrong or it doesn't work in this case. Again thank you for all your help!!!

            Comment


              #21
              Re: Limit # of records in a subreport

              Yes it will work.. you simply run it before you print the report.

              Comment


                #22
                Re: Limit # of records in a subreport

                Okay well I will wait till you have a chance to show me or explain how to put that in place. Thank you again for all the time you have spent on this with me.

                Comment


                  #23
                  Re: Limit # of records in a subreport

                  The documentation indicates that the top..... functions operate on a table. Experimentation on a set leads me to believe that used on a set these functions operate solely on the parent table.

                  Removed suggestion dealing with browse, was reading sub-form for subreport. Nevermind.
                  Last edited by Stan Mathews; 09-08-2011, 02:58 PM.
                  There can be only one.

                  Comment


                    #24
                    Re: Limit # of records in a subreport

                    Got your UDF done and ready, tested works just fine. I could post it as is, but wanted to get a little fancy and make a function that anyone can use on any table for any number of records but that's gonna have to wait for the Saints game. If you are in a rush, I could just post what I did so far.

                    Comment


                      #25
                      Re: Limit # of records in a subreport

                      I can wait enjoy your game. Thank you

                      Comment


                        #26
                        Re: Limit # of records in a subreport

                        Sorry for the delay..
                        I did this in maybe 4, 5 or more different ways and didn't like any of them simply because it takes a good minute or so for any of them to to run.. Finally, I designed a different scheme and got it down to 3 seconds to process your 8000+ records which is great but now the report won't print any!
                        I am pretty sure there is some filter or index interfering with the process but you db is a bit large and it might take a little while to figure that out..
                        Stay tuned..

                        Comment


                          #27
                          Re: Limit # of records in a subreport

                          From the menu form there is a button that takes you to another form with buttons that allow you to choose the month due for each report and those buttons have filters on them, that may be what is causing your problem but we need those filters on the report. Thank you for all your extra effort on these. Hope your team won.

                          Comment


                            #28
                            Re: Limit # of records in a subreport

                            Rather than waiting on me, here is the script that works the fastest. You have to do few modifications as noted:
                            1-You need to create a new table: "pmt_sum". Simply duplicate the structure (only structure) of the table "number_days_paid". This new table will accept the summarized records.
                            2-Create & save an import operation to import an ASCI file (the text file saved by the script, see below).
                            3-Now your "pmt_sum" table is populated with the summarized records (max 5 records form the child table for each parent, most recent ones by date)
                            4-Create a new, exactly similar set with the pmt_sum table being the child instead of "number_days_paid"
                            5-Copy the report to it.

                            Assuming you clear up the interfering filter, it should print only those records. If you scroll through the pmt_sum table you will see that there are no more than 5 records/parent.
                            Code:
                            dim x as n=1
                            dim run_tot as n=0
                            t=table.open("number_days_paid")
                            cnt=t.records_get()
                            t.close()
                            dim a_lst[cnt] as p
                            a_lst.initialize_from_table("number_days_paid",".t.","custid+invert(cdate(date))")
                            t1=table.open("pmt_sum")
                            t1.zap(.t.)
                            t1.close()
                            while cnt>x
                            	if a_lst[x].custid=a_lst[x+1].custid
                            					run_tot=run_tot+1
                            		if run_tot>=5
                            			a_list=a_lst.delete(x+1)
                            
                            					cnt=cnt-1
                            			else
                            			x=x+1
                            			end if
                            		else
                            		run_tot=0
                            		x=x+1
                            		end if
                            	end while	
                            		new_file=a_lst.dump_properties("date,invoice,sertech,total,days,invoice")
                            save_to_file(new_file,"....put here the full path to a text table.txt",.f.) 'just use any name for a text table. It has to take the extension ".txt" at the end.
                            import.run_silent("Import_Sum")

                            Comment


                              #29
                              Re: Limit # of records in a subreport

                              Thank you so much for the help. Some of this is over my head but I am going to follow your instructions to the letter. If I have a problem I will let you know.

                              Again much thanks
                              Ramona

                              Comment


                                #30
                                Re: Limit # of records in a subreport

                                Okay so I got the new table named "pmt_sum" and I get the creating the operation what I don't understand is the line in the code about the "new_file,"....put here the full path to a text table.txt",.f.) 'just use any name for a text table. It has to take the extension ".txt" at the end." Am I making another file somewhere or is this the pmt_sum table and just adding the txt to it. Sorry I am new to all of this so alot of this code is confusing for me.

                                Thank you
                                Ramona

                                Comment

                                Working...
                                X