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

Can you "get at" the SQL Statement in a Report?

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

    Can you "get at" the SQL Statement in a Report?

    I have need of building/dynamically modifying the SQL statement used in one of my reports, to customize the filter. Now if this were a grid filter then I could access the statement as a property in an event and modify it on the fly. I can't find a way to do that from within a report (the report is launched from a button in a Tabbed UI).

    The reason I need to do this is, for example, I have a report that asks the user if they want to include ALL bills or ONLY those bills that were invoiced. The field that indicates whether a bill has been invoiced is the bit (logical) field "LINVOICED" in my SQL Server table. The checkbox on the screen is labeled "Only Invoiced?" so that if a user checks it the filter should include something like "AND LINVOICED = true" while if it is not checked then the clause shouldn't be present at all. Now I realize there are a multitude of clauses that would work but I can't figure out a way, without getting at the SQL statement (or at least its filter clause) directly to have the filter built appropriately.

    I looked at the video about dynamic filtering with reports embedded in a UX component but this is too restrictive to be useful (i.e. still can't get at the SQL statement or filter clause directly).

    Thanks for any ideas.

    #2
    Re: Can you "get at" the SQL Statement in a Report?

    I don't know if it possible to do that but I think you can pass a parameter :IsInvoiced to the sql query. In this way you can customize the report as you like.

    Comment


      #3
      Re: Can you "get at" the SQL Statement in a Report?

      Passing the argument is not the problem. The problem is that if the user wants to see only invoiced bills I pass "true" and the WHERE clause reads LInvoiced = true, it works, but if the user wants to see ALL bills and I pass "false" and then the WHERE clause reads LInvoiced = false and I see only those bills that are not invoiced, not all bills.

      Alpha apparently doesn't let you get at the SQL statement directly, at least for reports, but I DID find a thread here: http://msgboard.alphasoftware.com/al...t=Local+Filter that might let me do what I want.

      Thanks regardless for posting and trying to help me out.

      Comment


        #4
        Re: Can you "get at" the SQL Statement in a Report?

        Yes you can pass arguments to the report
        I print my reports for dates or ids
        You need to design straight report, the on the button when you call the report you set the filter.
        I can show what I have or I may be able to work out a sample little later.
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


          #5
          Re: Can you "get at" the SQL Statement in a Report?

          Originally posted by GGandhi View Post
          Yes you can pass arguments to the report
          I print my reports for dates or ids
          You need to design straight report, the on the button when you call the report you set the filter.
          I can show what I have or I may be able to work out a sample little later.
          OK, so you're saying that in the OnClick event of the button in the TabbedUI that calls my report I can set the filter for the SQL Statement in Javascript? I guess I could see this except I can't find the "hook"; i.e. the pointer to the SQL Statement (or its filter clause). It might be in one of those Javascript code tabs, I'll look, but I'm reviewing the thread I pointed to and also a video it referenced.

          Obviously, an example would be great but even if that isn't forthcoming, I appreciate you chiming in and confirming something like this can be done (whether it's from a TabbedUI or a UX Dialog).

          Comment


            #6
            Re: Can you "get at" the SQL Statement in a Report?

            Norman you ca use 2 parameters:

            select * from bills where LINVOICED = :param1 or LINVOICED = :param2

            1) param1 = true param2 = true - only invoiced
            2) param1 = true param2 = false - all bills
            3) param1 = false param2 = false - only not invoiced

            Comment


              #7
              Re: Can you "get at" the SQL Statement in a Report?

              Originally posted by Catalin View Post
              Norman you ca use 2 parameters:

              select * from bills where LINVOICED = :param1 or LINVOICED = :param2

              1) param1 = true param2 = true - only invoiced
              2) param1 = true param2 = false - all bills
              3) param1 = false param2 = false - only not invoiced
              Catalin:

              Ahh, yes, I guess my Boolean Algebra skills have become a bit rusty. However, this still begs the question: How do I set this up, say in the Tabbed UI? I can display a dropdown to the user with the choices "All", "Only Invoiced" and "Only Not Invoiced", but then how do I intercept the execution of the report to set the arguments appropriately? Javascript? XBasic function on the server? THAT'S the issue. One of the things I more or less like about Alpha5 (and why I'm investing some funds to evaluate it) is the surplus of "hooks". Now there may be one here and it might be obvious to many experienced developers but I'm still finding my way.

              Appreciate the "lesson". :)

              Comment


                #8
                Re: Can you "get at" the SQL Statement in a Report?

                You could have a dropdown or radio group buttons and 2 hidden controls. When you select a value in dropdown through javascript set the selected value to this hidden control.

                dropdown values
                1. all
                2. only invoiced
                3. only not invoiced

                var selected = {dialog.object}.getValue('MYDROPDOWN')

                if (selected==1)
                {
                {dialog.object}.setValue('PARAM1', 1, false) (See the syntax for this functions)
                {dialog.object}.setValue('PARAM2', 0, false)
                }
                else if (selected==2)
                {
                {dialog.object}.setValue('PARAM1', 1, false) (See the syntax for this functions)
                {dialog.object}.setValue('PARAM2', 1, false)
                }
                else if (selected==2)
                {
                {dialog.object}.setValue('PARAM1', 0, false) (See the syntax for this functions)
                {dialog.object}.setValue('PARAM2', 0, false)
                }

                When you click the button to open the report you should link the parameters in "Argument bindings" with

                param1 = {param1}
                param2 = {param2}

                1.png
                Attached Files

                Comment


                  #9
                  Re: Can you "get at" the SQL Statement in a Report?

                  I don't think you can use the tabbed_ui to set up complex dynamic report filtering. However, what I do is create a UX with radio button choices or whatever and pass that into the report.
                  Peter
                  AlphaBase Solutions, LLC

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


                  Comment


                    #10
                    Re: Can you "get at" the SQL Statement in a Report?

                    I see Catalin gave you a nice example. Remember you will still have to set the filter.
                    Peter
                    AlphaBase Solutions, LLC

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


                    Comment


                      #11
                      Re: Can you "get at" the SQL Statement in a Report?

                      Peter:

                      Yea, that's what I'm thinking, thanks to the video pointed to in the above-mentioned thread. In a UX with controls I've been able to modify the sql.filter in the text version of the javascript. That may be the way to go.

                      Catalin:

                      The hidden controls idea is clever, I can see how that would be doable with javascript. The devil is in details of your last statement, I think: "When you click the button to open the report you should link the parameters in "Argument bindings" with ...". I'm not sure I have that ability from within the OnClick event of the TabbedUI. But I WILL investigate.

                      Thanks to both of you.


                      Norman

                      Comment


                        #12
                        Re: Can you "get at" the SQL Statement in a Report?

                        Originally posted by Peter.Greulich View Post
                        I see Catalin gave you a nice example. Remember you will still have to set the filter.
                        Well, from my perspective, it's not clear that I can have hidden controls when I'm activating a report from a TabbedUI, although I suppose something can be set via HTML in the header. Then there's the setting of the arguments, I need to investigate the options offered by the arguments dialog.

                        Thanks.

                        Comment


                          #13
                          Re: Can you "get at" the SQL Statement in a Report?

                          No, not from a tabbed_ui. Use a UX. Call the UX from the tabbed_ui.
                          Peter
                          AlphaBase Solutions, LLC

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


                          Comment


                            #14
                            Re: Can you "get at" the SQL Statement in a Report?

                            http://screencast.com/t/ZxPJQEnO

                            while I am recording interesting stuff going on, I agree with peter. you design a dialog (ux) then call the report
                            thanks for reading

                            gandhi

                            version 11 3381 - 4096
                            mysql backend
                            http://www.alphawebprogramming.blogspot.com
                            [email protected]
                            Skype:[email protected]
                            1 914 924 5171

                            Comment


                              #15
                              Re: Can you "get at" the SQL Statement in a Report?

                              Wow, that's what I call service, thanks much.

                              Yes, your approach in the Screencast is the approach used in the video I mentioned: Set up multiple actions, one for each possible filter, then call them in an OnClick event depending on the desired report. Selwyn used a dropdown to choose his grid, you simply click different buttons. Nicely done, but I'm going to have too many possible filters to do it this way. You DID answer my original question, which was a simplification.

                              Again, appreciate you trying to help me out here.

                              Comment

                              Working...
                              X