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

Report - Section OnRecord Event

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

  • Report - Section OnRecord Event

    Hopefully I can explain this clearly.
    Report based on Set One-to-Many based on only records from parents that have children. Have two breaks, the first/top Most is based on a field in parent table. Then next is based on field in child table. Have a variable I want to print for each parent record read/printed. The value of this variable is taken from a record in the parent table using the "lookup" function (It's from a record in the parent table that may or may not print, i.e. end of year value.). The variable is getting assigned correctly at the proper time. (using msgbox and debug.) I have my code in the Top Most break header section OnRecord event. This is the sequence of events as they fire.
    1. Detail OnRecord event fires for each record read.
    2. Then the second break.
    3. Then the first/top most break. Variable has the correct value here, but it gets reset, of course, when it reads the next breaks detail section. How can I save this value so it prints the proper value for that Break Group?

  • #2
    Re: Report - Section OnRecord Event

    Well, hopefully this will help. Don't know if this can be done or not, which I doubt that it can't be done.

    The report is invtotals_by_class based on a Set.
    Table Inventory is parent, invent_details is child linked by invent_id from parent.
    Only parent records that have child records will print from the set.
    Inventory is made up of classes which is the main break.
    Each class has 12 records in inventory making up the 12 months of the year.

    I am cycling thru picking up only detail records to print. However, I need to know/print the end of year count and value for each class that is printed in the report. I have 2 variables, one to hold the end of year count (Endcnt_act) and the other to hold the end of year value (Totval_act). My code to get these values is in the Report->Section Events->Stkclassid although it seems to make no difference where I put my code. Nothing gets saved/put on paper until the whole page is built. Therefore what shows up is the value from the last record read on that page. I've also created a calc field to do the same thing to see if that would work to no avail. I am thinking this should work like a total field where it totals groups then resets to total the next group. This is just reading a value from the current class/group of records and printing that value with the current group, then getting the next, etc.
    Any help would be greatly appreciated.
    Ernie

    Comment


    • #3
      Re: Report - Section OnRecord Event

      I am assuming this can't be done or the answer is so obvious that nobody wants to embarrass me.
      Ernie

      Comment


      • #4
        Re: Report - Section OnRecord Event

        Ernie,
        I haven't checked out the sample you attached..yet--can you give a specific example of what a total would be for what group etc. so that I or someone else will know if what experimenting we do brings up the correct amount(s)?

        Once I have this I will see what I can do--unless someone else comes up with what you want first---just so much easier when I know what should be seen is all.
        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


        • #5
          Re: Report - Section OnRecord Event

          Mike,
          Thanks for your reply. There is a parent table, Inventory, and a child table, Invent_Details. I only want to print detail records by reading using only parent records that have child records. That is the way the set is setup. There will be only 12 Parent records for each stock class representing 12 months of a year. The parent table is queried by Stkclassid and ap_year and ordered by ap_month. In details is where I keep data that affects numbers in the parent record, such as beginning of year count, values, sales, adjustments to inventory, etc. throughout the year. I need to be able to print the end of year value and count for each Stock Class, represented by StkclassId. Therefore, as I read the detail record, which is related to the parent record by the Stkclassid field, then for that Stkclassid, I read the last record in the query, December, and get the end of year value and count for that class of stock. I can get the numbers, but haven't figured out how to save them so they can be printed along with the other records in that group. I created a Shared variable, but it gets reset after every read of the Group Header, Stkclassid, in the OnRecord event. I don't know how alpha5's inner-workings handle calculated total fields that you place in footers, but you're using the same variable for every group and it gets saved somehow so it prints totals for the proper group. Seems the OnRecord events don't allow much leeway, other that changing values in records that are read. Help file is very sparse in this area. Would really like to understand if there is a way to manipulate variables in reports, other than calc fields, to hold data.
          Thanks for any help.
          Ernie

          Comment


          • #6
            Re: Report - Section OnRecord Event

            Ernie,
            I admit I am still confused and perhaps this is why others have not responded...but there may be a way out of this. Take a look at the screenshot of the report from your sample--the only mods I have made are for being able to see a bit more clearly what is what and where on the report--nothing else. From this tell me what I should be seeing and what you want--sounds like you just want the December values...


            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


            • #7
              Re: Report - Section OnRecord Event

              Mike,
              Sorry this is so confusing. You are correct. Am after December count and value for each stock class that is read. My formatting and layout is just thrown together right now, trying to figure out how to retain the values I am getting in the Stkclassid header OnRecord event. You'll notice from the screen shot, the end of year values printed are for the last record read: Bulls. You can go into the Inventory table and look at the Actual Total Value and Actual End Count fields for December to see the values I'm wanting to capture/print for each details record read/printed. It actually only needs to be queried once and printed once somewhere in the group. Haven't completed the design as of yet. Just trying to figure out how I can make it work.
              The Adj_reasons is what I use to group/adjust Inventory: Adjust Count (Up/Down), Sales, Purchases, Births, etc. This is coded into the details form and selected via a drop combo box. Then in posting rules, it updates the Inventory table based on what was selected / entered.
              Thanks again for your help. I've come from a Clarion background where you could load up local variables before or after the detail record was read or before or after the header was printed, then reset it to zero to get values for the next group. In alpha, it seems a whole page of data is gathered and then it prints. So I would need a variable for each stock class. But since the number of stock classes varies depending on the user, am trying to use only one variable for multiple classes. Hope that makes sense.
              Ernie

              Comment


              • #8
                Re: Report - Section OnRecord Event

                Ernie, for what it's worth, I've never had much luck using the OnRecord event in the report writer. Have much better success pre-processing complicated reports and dumping the processed values to a temp table, and then base the report layout on the temp table.

                I suggest you discover whether what you need to do can be done using a much simplified example, before struggling with your final report layout.

                -- tom

                Comment


                • #9
                  Re: Report - Section OnRecord Event

                  Tom,
                  Thanks for your input. Was hoping the report writer would be more flexible, but probably not. I have started to just copy the data I need for a report into a temp table with xBasic. Actually, relatively simple. What I do is create a table with field rules and all, then at the beginning of build, Zap it and cycle thru all the tables I need to collect the data. Is this standard practice?
                  Ernie

                  Comment


                  • #10
                    Re: Report - Section OnRecord Event

                    Ernie, I don't use any field rules at all in my temp tables. They're just shells used for reports. Fill them with preprocessed data, print report, empty them. Otherwise, what you're saying is pretty common.

                    Comment


                    • #11
                      Re: Report - Section OnRecord Event

                      Ernie,
                      As I cannot even get ANY value to show up for the totals, I think what Tom said should be taken to heart--simplify and get one thing working, then add complexity. Also, I don't use the OnRecord events much either--the OnPrintInit I have used a lot as well as the detail filter. On complex filters I usually try to prefilter before calling up the report...or create the complex filter prior to the report and then pass it to the report in the OnPrintInit event.

                      Just some more alternatives really as each report is a bit different and requires different tactics many times.
                      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: Report - Section OnRecord Event

                        [ATTACH]19441[/ATTACH]

                        Comment


                        • #13
                          Re: Report - Section OnRecord Event

                          G, that's very interesting! Care to share the technique? Inquiring minds want to know!

                          Thanks.

                          -- tom

                          Comment


                          • #14
                            Re: Report - Section OnRecord Event

                            I second that!
                            Ernie

                            Comment


                            • #15
                              Re: Report - Section OnRecord Event

                              Originally posted by Tom Cone Jr View Post
                              G, that's very interesting! Care to share the technique? Inquiring minds want to know!

                              Thanks.

                              -- tom
                              Nothing you don't already know or have done probably a hundred times.

                              The OnRecord event has a script that assigns a value to a variable based on a lookup() that uses a filter. The value, obviously, comes from a field in the table. Ernie put that variable in the detail section.

                              Hmmm!

                              First off, there is a major flaw with this concept. I will leave that out for now and most likely if you think about it for a second you will figure it out.

                              But, WHY the OnRecord event to begin with? WHY go look for these values and assign them to a variable?

                              Isn't that what alpha does?

                              In essence, Ernie is trying (unwittingly) to do alpha's work, and needless to say, it didn't work.

                              I did away with the OnRecord event. I simply placed the field itself in the footer and placed the filter as a base filter for the report.
                              Last edited by G Gabriel; 12-13-2008, 08:08 PM.

                              Comment

                              Working...
                              X