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

"Invalid Report Filter Expression"

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

    "Invalid Report Filter Expression"

    Hi,

    I am trying to preview a report based on a query done in xbasic, the query filter I have set up is: "query.filter=Content<"+quote(var->Num)", Num is a character variable and is entered by user, Content (Character) is a field from the table in question, I have set up print preview as follows: "report.preview("Inventory Status", query.filter), but then I get the error:"Invalid Report Filter Expression:'Content<"2"'."
    I tried not using the "query.filter" in print preview expression but it kept giving me the same records everytime I ran this. I also tried putting the filter expression again in the "Select Records" of Report "Inventory Status" but it gives me "Invalid expression". I am trying to get the records with contents less than the number entered by the user, is there something wrong with this expression? I appreciate anyone's feedback.

    #2
    Re: &quot;Invalid Report Filter Expression&quot;

    Is content a number or a character? If it is a Number code should be
    query.filter= "Content < " + quote(val(var->Num))

    Comment


      #3
      Re: &quot;Invalid Report Filter Expression&quot;

      Content is of type character.

      Comment


        #4
        Re: &quot;Invalid Report Filter Expression&quot;

        Ali,

        Try writing the expression without using variables.

        preview_report("Inventory_status","trim(Content) < '2' ")

        Then convert the expression that works with constants to one that works with variables.

        By the way, I'm curious what typical field values might be for Content? It's very rare that the less than operator is used with character type data.

        -- tom

        Comment


          #5
          Re: &quot;Invalid Report Filter Expression&quot;

          Tom,

          Thanks for your reply.
          Initially, I put Content as a Numerical but I was getting error from my xbasic code, so I changed it to character field and it worked fine. I have written codes where I used "less than" operator or other operators with character types and there was no problem... Please note that the variable Num is a numerical entered by the user ("Num=ui_get_num("... and that is also of character type, I am not sure how I can do this by setting it up as you mentioned with print.preview expression.

          Comment


            #6
            Re: &quot;Invalid Report Filter Expression&quot;

            You're trying to run. I want you to walk.

            Get the report to work using a constant instead of a variable.

            Then post the working expression here. We can adapt it for use with the variable once it's working correctly with a constant.

            -- tom

            Comment


              #7
              Re: &quot;Invalid Report Filter Expression&quot;

              Num is a character variable and is entered by user
              Please note that the variable Num is a numerical entered by the user ("Num=ui_get_num("... and that is also of character type
              This is an exercise in confusion!

              num is numeric, not a character.
              Your script could be easily fixed as you have it, but there is no sense of fixing a twisted construct like this:

              You had content as numeric
              You got an error message
              You changed to character
              It worked fine at first
              Then you got an error
              Now you are trying to fix the latest error.

              Let's go back to the first error: Change content back to numeric, as it should be, and tell us what error you get. There is no sense in having content as C and the variable as N

              Comment


                #8
                Re: &quot;Invalid Report Filter Expression&quot;

                Originally posted by G Gabriel View Post
                num is numeric, not a character.
                No. The result of ui_get_number() is a character type. The function merely aids in controlling the result by means of the optional format string parameter.
                There can be only one.

                Comment


                  #9
                  Re: &quot;Invalid Report Filter Expression&quot;

                  Tom,

                  I tried with constants but keep getting same error with trim expression or query.filter in the report.preview expression. When I tried "query.filter="Content<'2'", I got the error "Incorrect argument data type" but with "Content<2", it was treating it like it found no records even when I changed the number!
                  I even changed Content type from character to numerical to see if that would help but no success!

                  Gabriel

                  Num is a character, what I meant was that user enters only numerical but in the code it is described as a character.

                  Comment


                    #10
                    Re: &quot;Invalid Report Filter Expression&quot;

                    Stan:
                    Ok..
                    I fail to see the logic.
                    The help file does say it's a character contrary to what reasonable humans would expect. If it's going to get a character, why not then just use any character input field?! One would expect, get_number means what it says! and it is there to be distinguished from a character input field.

                    I guess Ali is not confused, somebody at alpha needs to get their logic and terminology straight. Instead of expecting the user to follow up with val(), alpha should do that internally.

                    Ali:
                    You still need to make content numeric, why?
                    because:
                    If both are character, then
                    if content is 1 and num is 2, the expression:
                    content<num will be true
                    but if content is 3 and num is 12,
                    the expression:
                    content<num will be false, when you expect it to be true.
                    I suppose, you could keep it the way it is and use val() for both.
                    Last edited by G Gabriel; 04-17-2007, 02:39 PM.

                    Comment


                      #11
                      Re: &quot;Invalid Report Filter Expression&quot;

                      Ali, is there some reason you didn't try the expression I suggested?

                      Can you zip your table and its dictionaries and post it here?

                      --t

                      Comment


                        #12
                        Re: &quot;Invalid Report Filter Expression&quot;

                        Originally posted by Tom Cone Jr View Post
                        Ali, is there some reason you didn't try the expression I suggested?

                        Can you zip your table and its dictionaries and post it here?

                        --t
                        I think there is no way to see what is happening until we see a sample. The content field may hold any combination of leading or trailing spaces to make the comparison fail. Tom suggested trim() but for example

                        Code:
                        content = "   2"
                        ? content< "2"
                        = .T.
                        There can be only one.

                        Comment


                          #13
                          Re: &quot;Invalid Report Filter Expression&quot;

                          Gabriel,

                          I tried with val() expressions you mentioned but I kept getting the error "Invalid Report Filter Expression"... Even when I changed Content's type from character to Numerical, it didn't help!

                          Tom,

                          I tried your expression and was getting the error "Invalid Report Filter Expression" or the other one I mentioned in my previous post. Attached is the set with all its dictionaries. Note: Clicking on "Reports", then "Inventory" would leas you to where I am referring to. The table that it's retrieving data from is "inventory_nms". Good Luck.

                          Comment


                            #14
                            Re: &quot;Invalid Report Filter Expression&quot;

                            Fixed.
                            [ATTACH]14058[/ATTACH]
                            Last edited by G Gabriel; 05-11-2007, 05:16 AM.

                            Comment


                              #15
                              Re: &quot;Invalid Report Filter Expression&quot;

                              Gabriel,

                              Can you please tell me what you found wrong? I looked at your attachment, in "Inventory" under "Reports" but I didn't see anything different. Thanks.

                              Comment

                              Working...
                              X