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

Grouping a Grid

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

  • Grouping a Grid

    Without building some custom code, I can't think of a way to group a grid. Any suggestions?

    For instance, each record has a category and a name, but I only want the category to show up once:

    Code:
    Apple
      Delicious
      Granny Smith
      Yellow
    Grapefruit
      Orange
      Pink
    -Steve
    sigpic

  • #2
    Re: Grouping a Grid

    Since a grid displays records, and "Apple" & "Delicious" are in the same record, I doubt you can put them on separate lines - unless you had a dummy record w. "Apple" first - etc. etc.

    The only thing I can think of is use xbasic to mark a .L. field called "Cat", which only marks the first instance of "apple", etc. Then put a calc field in the grid:

    If(Cat=.T., Category, Name)

    Same principle as a browse, I think. Unless there is a way to get the previous() function to fire in a grid (but I doubt it).
    Peter
    AlphaBase Solutions, LLC

    Peter@AlphaBaseSolutions.com
    https://www.alphabasesolutions.com


    Comment


    • #3
      Re: Grouping a Grid

      Yeah, I'm thinking about trying to invent a calculated field too. I don't even mind if the first group label is to the side of record entry with the rest of the group name instances hidden. I might even be able to fix that with a bit of html in the calc field...
      -Steve
      sigpic

      Comment


      • #4
        Re: Grouping a Grid

        Maybe it should be something like:

        If(Cat=.T., Category + ": " + Name, space(10)+Name)
        Peter
        AlphaBase Solutions, LLC

        Peter@AlphaBaseSolutions.com
        https://www.alphabasesolutions.com


        Comment


        • #5
          Re: Grouping a Grid

          OK, it can be done with use of an index, calc field in the grid and a couple other touches. Too complicated to spend the time 'splaining here unless someone else needs it. For proof, see attached pic.
          -Steve
          sigpic

          Comment


          • #6
            Re: Grouping a Grid

            THANKS! I was just in need of this for a list of Events by Category.
            Steve Wood
            Join the ALPHA DEVELOPERS NETWORK
            There is no Cloud. It's just someone else's computer.
            Web - Mobile - Hosting - Products - Frameworks - Developer Resources
            AlphaToGo | IADN (100% Alpha Anywhere Websites)

            Comment


            • #7
              Re: Grouping a Grid

              I presume this means you want an explanation....?
              -Steve
              sigpic

              Comment


              • #8
                Re: Grouping a Grid

                You know I couldn't live with myself if you did!
                Steve Wood
                Join the ALPHA DEVELOPERS NETWORK
                There is no Cloud. It's just someone else's computer.
                Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                AlphaToGo | IADN (100% Alpha Anywhere Websites)

                Comment


                • #9
                  Re: Grouping a Grid

                  Allright, let me try to be as clear and precise as possible. I'm going to use my example so I don't have to interpret -- I'll leave that to you. And, it might be a good idea to review my uploaded picture below to keep in mind the desired result.

                  My key fields here are:

                  vendor->category
                  vendor->name_full

                  I want to group vendor names by category.

                  First, an index named "Category" with this expression:

                  Code:
                  UT(FOOD_CATEGORY) + UT(NAME_FULL)
                  Next, a calc field in the grid, which is based on the vendor.dbf:

                  Code:
                  vCategory = if(ut(Name_Full)=lookupc("c",ut(Food_Category),"ut(name_full)","[pathalias.adb_path]\vendor.dbf","category"),ut(food_category),"")
                  The lookupc() function is used here, using the "c" for "closest" as the first parameter of the function. Because the key is incomplete, e.g. I'm just using the record's Food_Category field rather than the complete expression in the index, it finds just the closest match, which -- this is important: -- also happens to be the first match. Using Lookupc("f", ....) won't work. That means that, since each category is indexed alphabetically by Name_Full, the only time that the vCategory expression is true and returning the ut(food_category) is when it's the first Name_Full with that category. Reread this part until you understand it because it's the key to making this happen.

                  Now, put vCategory into your Selected grid fields as a Label, and hide the column. Make the Name_Full field a Freeform layout with something along these lines:

                  Code:
                  <table>
                  <tr valign="top"><td width="190" align="center" valign="top">{Vcategory}{name_full}</td>
                  </tr>
                  </table>
                  I made the cell width too narrow to hold both controls in order to force a wrap. I still have a bit of a vertical spacing problem between rows to handle, but overall I'm satisified with the result.

                  Lemme know if I failed to make anything clear enough here. And show us your results!
                  -Steve
                  sigpic

                  Comment

                  Working...
                  X