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

conditional hide row, per record

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

    conditional hide row, per record

    I am trying to find a method to conditionally hide a grid row based on individual record data values. For example, the attached graphic shows a grid where some fields have values, some are blank. I want to hide the rows where the value is blank. I cannot use a Custom field, because that does not allow me to hide the whole row. Also can't use a hide=.t. statement in the A5W page, because that would hide the row for ALL records.
    Steve Wood
    See my profile on IADN


    #2
    A couple thoughts, Steve - I haven't tried either of these.

    First, and perhaps easiest, would be to apply a filter at the query level.

    If that doesn't fit /work, I'd look at some override capability on the A5W page.

    Let us all know?
    -Steve
    sigpic

    Comment


      #3
      attached graphic?
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Originally posted by Steve Wood
        I am trying to find a method to conditionally hide a grid row based on individual record data values. For example, the attached graphic shows a grid where some fields have values, some are blank. I want to hide the rows where the value is blank. I cannot use a Custom field, because that does not allow me to hide the whole row. Also can't use a hide=.t. statement in the A5W page, because that would hide the row for ALL records.
        Use a Calculated field that tests for blank/null values for the fields in question with an IIF function, then as Steve suggests, use a filter on the a5w page that filters out that Calculated field.

        Comment


          #5
          I'll try, but may I ask if this is a tested solution? It doen't make sense to me - the IIF is going to return true or false, and the filter is going to simply omit the entire row, but for ALL records.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Steve,

            What if you create a calc field for each real field in the row?

            If(field value = "xyz","","field value")

            You will still get a row, but it will be filled w. blank values.
            Last edited by Peter.Greulich; 06-03-2006, 10:44 PM.
            Peter
            AlphaBase Solutions, LLC

            [email protected]
            https://www.alphabasesolutions.com


            Comment


              #7
              I want to
              hide the rows where the value is blank.
              What I've determined is that it has to happen at the field-record level. Can't be controlled by the A5W filter because that affects all rows.

              I have two ideas: 1) Turn Row Labels off and hide all but the first field. Do everything in the freeform area. Use calculated fields to show both the value and the label if the value is not null, and to return null for both if the value IS null. Then I have to do something to create lines between each "row" that does appear to give some division, 2) xbasic in the freeform area to show/hide portions of the HTML code (I've found this to be difficult).

              Note that this can only apply to stacked and columnar grids. You could not selectively hide a row (column) if the grid was presented in tabular format.
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Originally posted by Steve Wood
                I'll try, but may I ask if this is a tested solution? It doen't make sense to me - the IIF is going to return true or false, and the filter is going to simply omit the entire row, but for ALL records.
                Here is pseudo code:

                Calc field:

                SkipRow = IIF(isnull(field1) or isnull(field2) or isnull(field3), .T.,.F.)

                Now just filter for SkipRow = .F.

                You'll only skip rows that have those blank fields in it that way.

                Comment


                  #9
                  As I've said before in this thread, I can't use a filter because it will filter in/out the RECORD not the particular row. Furthermore, you can't filter on a calculated field.
                  Steve Wood
                  See my profile on IADN

                  Comment


                    #10
                    hi Clint

                    when Steve "said skip a row" he was speaking of a field
                    his record is displayed vertically and each "row" is
                    actually a column in database lingo


                    martin
                    regards

                    martin
                    www.jollygreenthumb.com

                    Comment


                      #11
                      Originally posted by Steve Wood
                      As I've said before in this thread, I can't use a filter because it will filter in/out the RECORD not the particular row. Furthermore, you can't filter on a calculated field.
                      /binks

                      A row is a record from a table in any grid I've ever worked on.

                      I went ahead and tested that I was not misleading you and you *can* filter like a champ with a Calculated field.

                      with tmpl_testGRD
                      componentName = "testGRD"
                      .dbf.filter = "SkipRec = " + s_quote(.F.)
                      end with

                      The code I gave you should do what you want. I can't see how it won't.

                      Comment


                        #12
                        Clint,

                        Sorry, I was assuming a calculated field in the WAS grid environment where you can create calculated fields. You can't filter on those, but of course you can filter on a calc field established at the table level.

                        I've spent so much time over on the WAS side, that I have forgotten about some of the conflicting nomenclature.

                        As Martin said, I am referring to the WAS, and a "row" over there is, from the standpoint of the grid, is the projection of the field value, along with its label. Here, take the following:

                        Name: Steve Wood
                        ZipCode: 94552
                        Hobbies:
                        Married: Yes

                        There, I have no hobbies (which is true). So, the way I would want that to appear on the screen is:

                        Name: Steve Wood
                        ZipCode: 94552
                        Married: Yes

                        It would be equivelent on the desktop side of hiding the label and control if the field value was blank.

                        The graphic I included several posts ago shows how this appears in the WAS grid.

                        In that GRID, one of the options is HIDE ROW, and if you check it, the row is hidden. That is, the entire label and control is omitted, like in my example above.

                        A filter would omit/include the "table row", as in the entire record.

                        BTW, I've never referred to tables in terms of rows and columns. I know those are proper terms when you are thinking about the table as a whole, but I've always used Table, Record, Field.
                        Steve Wood
                        See my profile on IADN

                        Comment


                          #13
                          Originally posted by Steve Wood
                          Clint,

                          Sorry, I was assuming a calculated field in the WAS grid environment where you can create calculated fields. You can't filter on those, but of course you can filter on a calc field established at the table level.

                          I've spent so much time over on the WAS side, that I have forgotten about some of the conflicting nomenclature.

                          As Martin said, I am referring to the WAS, and a "row" over there is, from the standpoint of the grid, is the projection of the field value, along with its label. Here, take the following:

                          Name: Steve Wood
                          ZipCode: 94552
                          Hobbies:
                          Married: Yes

                          There, I have no hobbies (which is true). So, the way I would want that to appear on the screen is:

                          Name: Steve Wood
                          ZipCode: 94552
                          Married: Yes

                          It would be equivelent on the desktop side of hiding the label and control if the field value was blank.

                          The graphic I included several posts ago shows how this appears in the WAS grid.

                          In that GRID, one of the options is HIDE ROW, and if you check it, the row is hidden. That is, the entire label and control is omitted, like in my example above.

                          A filter would omit/include the "table row", as in the entire record.

                          BTW, I've never referred to tables in terms of rows and columns. I know those are proper terms when you are thinking about the table as a whole, but I've always used Table, Record, Field.
                          Hmm...
                          Assuming you're just looking to show the person this abbreviated data with labels.....

                          This would be a tad awkward but you *could* do the following:

                          By evaluating the data to determine if a field had data, hobbies in your example, you could write a record to a temporary table that didn't include a row for hobbies.

                          So in your example you'd write 3 records.
                          Name: Steve Wood
                          ZipCode: 94552
                          Married: Yes

                          This table would have whatever constituted the "key" for you and the grid would therefore only show those three records. When you created the records, you'd add the textual labels into the record itself so when you showed the records in the grid, no *actual* labels would be needed.

                          For example your new table for the grid would be populated like this:
                          tbl_showpainfully.tblkey = tbl_user.key
                          tbl_showpainfully.gridrow = "Name: " + tbl_user.First + " " + tbl_user.Last
                          add rec
                          tbl_showpainfully.tblkey = tbl_user.key
                          tbl_showpainfully.gridrow = "Zip: " + tbl_user.zip
                          add rec
                          tbl_showpainfully.tblkey = tbl_user.key
                          tbl_showpainfully.gridrow = "Married: " + tbl_user.married
                          add rec

                          With all 3 records filled out, your grid would show only the data you wanted.
                          Not the most elegant solution but I believe it would do what you asked for conceptually.

                          Hope that helps

                          Comment


                            #14
                            Standard Function

                            My view, this needs to be a standard function of the grid builder. It's very frustrating not being able to control the field names (Row Label) depending on the content status. A simple IF in Control would do.
                            Insanity: doing the same thing over and over again and expecting different results.
                            Albert Einstein, (attributed)
                            US (German-born) physicist (1879 - 1955)

                            Comment


                              #15
                              As long as the grid is read-only, you can do this with a custom control. See Suppressing Blank Fields in an Address.

                              Comment

                              Working...
                              X