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

how to remove entire line if numeric field is 0.00 in a report

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

  • how to remove entire line if numeric field is 0.00 in a report

    I am writing a report that lists 6 possible line items--not all will be used. The field fee1 will always be filled, but fee 2 to 6 may not be. When the fee is not used, it defaults to 0.00

    When this happens, how can I delete the entire line from the report?

    Fee 1 $100.00

    Fee 2 50.00

    Fee 3 0.00

    Fee 4 0.00

    How can I make Fee3 and Fee4 not show on the report? I have them in the detail section of the report

  • #2
    Re: how to remove remove entire line if numeric field is 0.00 in a report

    I read this is as two different questions.

    How do you keep the whole line from printing if one of the fields (fees) is zero?
    How do you keep the field 3 and field 4 from showing zero in the report?

    Perhaps, instead of showing these fields horzontally as they would appear in a browse, you have stacked them vertically?

    If so you need an rtf object such as one would use for address lines. The rtf would display something like

    field1
    if(field2>0,field2,"")
    if(field3>0,field3,"")
    if(field4>0,field4,"")
    if(field5>0,field5,"")
    if(field6>0,field6,"")

    with soft returns after each line and have the rtf set to shrink.
    There can be only one.

    Comment


    • #3
      Re: how to remove remove entire line if numeric field is 0.00 in a report

      Thanks but your expression only holds if the fields are characters, our fields are numeric and cant return a blank value

      Comment


      • #4
        Re: how to remove remove entire line if numeric field is 0.00 in a report

        Set the format to be "blank if zero" and also set allow shrinking to yes.

        Bob
        Bob Whitaker

        Comment


        • #5
          Re: how to remove remove entire line if numeric field is 0.00 in a report

          Originally posted by DR Wexelman View Post
          Thanks but your expression only holds if the fields are characters, our fields are numeric and cant return a blank value
          Perhaps there is some reason you don't want to use an RTF object, but if there is no good reason, then what Stan said is perfectly correct. It does not matter if the field is numeric. Thus if F1 etc. are numeric just create calculated fields in your report:
          c_1 = If(F1=0,"",str(F1,5,2))
          c_2 = If(F2=0,"",str(F2,5,2))
          c_3 = If(F3=0,"",str(F3,5,2))
          c_4 = If(F4=0,"",str(F4,5,2))

          Then put them (just my c_1 and so on, not the expressions) in an RTF object on the report with soft returns (Shift+Enter) after each calculated field (c_1, etc.). That way if the numeric value =0, the line won't print at all. Then as Stan says make sure to set the RTF object's properties to "Allow shrink when printing" (growth too, probably). Other data items can be above and immediately below the RTF object and you won't be able to tell in the report.

          Try it.

          Ray Lyons

          Edit: For these purposes a blank numeric field does = 0, assuming you are using DBF tables. You might also try <1 if zero is a problem.

          Comment


          • #6
            Re: how to remove remove entire line if numeric field is 0.00 in a report

            Set the field format in the report to "Blank if Zero" and check the box to allow the region to shrink.

            Comment


            • #7
              Re: how to remove remove entire line if numeric field is 0.00 in a report

              Could be wrong but what Bob and G suggest would work only if the numeric field was the only field on that line in the report. However, Warren seems to also have a label ("Fee 1:") in front of the numeric value. I think the only way to do that is what Stan suggested with an RTF box in the report. That way the "Fee" labels can be in the calculated fields, for example:
              c_1 = If(F1=0,"","Fee1: "+str(F1,7,2))
              c_2 = If(F2=0,"","Fee2: "+str(F2,7,2))
              c_3 = If(F3=0,"","Fee3: "+str(F3,7,2))
              c_4 = If(F4=0,"","Fee4: "+str(F4,7,2))

              Again, put these (just the C_1, C_2, C_3, C_4 with soft returns after each) in an RTF box set to shrink and I think Warren would be able to get what he wants. Again, a soft return is Shift+Enter.

              Ray Lyons

              Comment


              • #8
                Re: how to remove remove entire line if numeric field is 0.00 in a report

                Not the only way.
                If you have a lablel, put a calc field instead of the lable:
                Label_Text=if(field_value=0,"","Your_label")
                You can certainly use an RTF, or even a sub-report, or a conditional object, or ..

                Comment


                • #9
                  Re: how to remove remove entire line if numeric field is 0.00 in a report

                  Originally posted by G Gabriel View Post
                  Not the only way.
                  If you have a lablel, put a calc field instead of the lable:
                  Label_Text=if(field_value=0,"","Your_label")
                  You can certainly use an RTF, or even a sub-report, or a conditional object, or ..
                  Yes, but such a calc field (or like the ones in my examples) can't be set to be "Blank if Zero" in the detail region for the line to be skipped unless it is in an RTF box, can it? (I'd like to be wrong, and as you surely know, I frequently am.)

                  As for conditional objects, yes, but from my experience in reports that can be a more difficult way to go as far as getting things to look and work just right, etc. Maybe it's just me though--I am pretty much retired from all this kind of stuff now and probably should not be trying to help anymore.

                  Ray Lyons

                  Comment


                  • #10
                    Re: how to remove remove entire line if numeric field is 0.00 in a report

                    No.
                    As I said: if you have a label, let's use Warren's example, "Fee": instead of using a label with the "Fee" text on it, replace that with a calc field:
                    calc_label=if(fee=0,"","Fee")
                    If the field value in question is zero, it will be blank and so will the label.
                    If you check to shrink the region, that entire line will not show in the report.
                    Nothing against RTF, except it might be a bit more involved to line up the labels and the fields.

                    Comment


                    • #11
                      Re: how to remove remove entire line if numeric field is 0.00 in a report

                      Originally posted by G Gabriel View Post
                      No.
                      As I said: if you have a label, let's use Warren's example, "Fee": instead of using a label with the "Fee" text on it, replace that with a calc field:
                      calc_label=if(fee=0,"","Fee")
                      If the field value in question is zero, it will be blank and so will the label.
                      If you check to shrink the region, that entire line will not show in the report.
                      Nothing against RTF, except it might be a bit more involved to line up the labels and the fields.
                      I think you must be talking about a calc filed in a table whereas I was talking about a calc "field" in the report layout. The latter, one could argue, is not really a "field" but Alpha in various places calls them that, so I do too. I have not tested it but I'll assume that as a table calc field your suggestion will work. As to which is the better way to go, I suppose among other things it depends on whether one wants the calcs in a table or in the report layout. I can see reasons to go either way.

                      Ray Lyons

                      Later edit: I must still be missing something because in my testing what I thought you were suggesting (table calc field) still does not work, I guess because your table field has to be a character field. What am I missing?
                      Last edited by Raymond Lyons; 02-15-2012, 08:56 PM.

                      Comment


                      • #12
                        Re: how to remove remove entire line if numeric field is 0.00 in a report

                        I am talking about a calc "field" in a report.
                        Try it.

                        Comment


                        • #13
                          Re: how to remove remove entire line if numeric field is 0.00 in a report

                          Originally posted by G Gabriel View Post
                          I am talking about a calc "field" in a report.
                          Try it.
                          Got it. The problem was you stated above:

                          Post 6: "Set the field format in the report to "Blank if Zero" and check the box to allow the region to shrink."
                          ....
                          Post 10: "If you check to shrink the region, that entire line will not show in the report."

                          However, for a calc field there is no "Blank if Zero" format property as there is for a table numerical field. And the region I thought we were talking about shrinking was the detail region of the report, but that has no effect in my testing.

                          Since it does work, I guess what you were trying to say was to set Allow Shrinking in the calc field properties, not the region, as setting the region to shrink is has no effect on removing the line in the report. Anyway, when I set Allow Shrinking in the calc fields, the line is removed when the numeric field in the character calc field returns 0. I did not know that would work. Good to know.

                          Thanks.

                          Ray Lyons

                          Comment


                          • #14
                            Re: how to remove remove entire line if numeric field is 0.00 in a report

                            Reluctant to add anything more to this, but some might be interested to know that the method talked about here allows real bulleted lines in reports--using more or less real looking bullet characters from the various Winding fonts/characters. Maybe others know some other way to do this, but years ago I tried and failed, so to me this thread has proved valuable for that reason alone. Using the method in this thread, one just has to create and put a calc field (set to a Winding font and character) in front of a related calc field and you have a good looking bulleted line. Of course if a list has lines that need to be skipped, follow what is stated above in this thread. Both the bullet and the related blank field will be skipped with no gap between lines.

                            Raymond Lyons

                            Comment


                            • #15
                              Re: how to remove remove entire line if numeric field is 0.00 in a report

                              Just add if you put your calculated field in a rich text box that CAN be set to shrink.

                              Bob
                              Bob Whitaker

                              Comment

                              Working...
                              X