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 invoke Order Builder XDialog in sorting fields in my reports?

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

  • How to invoke Order Builder XDialog in sorting fields in my reports?

    Hi there,

    I am reworking a database and one of the improvements that we have decided upon is to give the users the ability to choose to sort by fields in a generated report.

    I saw the order builder and was wondering if I was able to use it to allow users to choose fields to sort by?

    So the workflow I am intending is when the user clicks on the button to generate a report...is to get a xdialog box (order builder?) to come up---> User chooses what fields to sort by--> sorting settings gets applied to the report --->Report is generated.

    Is this possible and how would that be done?

    Many thanks to any help...I am most grateful to any advice given.

  • #2
    Re: How to invoke Order Builder XDialog in sorting fields in my reports?

    Alpha does not document these functions (so use at your own risk). I have used them for many years.
    vFilter = a5_filter_builder("",table_set_name)
    pointer = a5_order_builder("",table_set_name)

    The order builder returns a couple properties, so use it first in the interactive window to see what you get.

    Then you can pass order criteria to report as a parameter.

    Bill.

    Comment


    • #3
      Re: How to invoke Order Builder XDialog in sorting fields in my reports?

      Thanks Bill for the reply. The window pops up so it works!
      I will do some experimenting to make sure that the choices that the user makes in the order builder are properly moved across.

      Many thanks. This has helped a lot.

      Just of curiosity, the order builder shows the fields within a set or table. Is it possible to change the formatting of them to show something more meaningful to the user?

      For example if we have a field in the table called fld_category, the order builder will present that. Is it possible to apply formatting just like field rules?

      Many thanks.

      Comment


      • #4
        Re: How to invoke Order Builder XDialog in sorting fields in my reports?

        You would need to build your own xdialog from scratch.

        Well, as I think of it, you might try creating a View of the table and use that in Alpha's dialog. The View will let you change the field names.

        Bill.

        Comment


        • #5
          Re: How to invoke Order Builder XDialog in sorting fields in my reports?

          Ok thanks bill. Is there anything extra that I need to do to parse the fields through to the order builder? Is it a matter of creating an action script that will invoke the order builder and then it uses the field from that source? Many thanks. As you can see I am still green with alpha five. I am learning Superfast though!

          Comment


          • #6
            Re: How to invoke Order Builder XDialog in sorting fields in my reports?

            Hi there!

            Did some experimenting and the dialog box does come up. I was wondering however, how do we pass the parameters created to the report?

            Comment


            • #7
              Re: How to invoke Order Builder XDialog in sorting fields in my reports?

              You mean like this?
              http://wiki.alphasoftware.com/PRINT_REPORT+Function

              Bill.

              Comment


              • #8
                Re: How to invoke Order Builder XDialog in sorting fields in my reports?

                Yes something like that..

                I would like the parameters from the order builder passed through to the report.

                So the process goes user clicks on button to produce report--->order builder comes up--->user selects sorting order-->this gets parsed through to the report as order criteria.

                UPDATE: I have come back and revisited this idea and readded this as a single line of code:
                pointer = a5_order_builder("",temptable2)

                and it comes up with an error saying that the Script:TEMPLATE line:1
                Variable "table_set_name" not found

                I suppose I have to define variables but again I am new to this...

                Thanks for any help.
                Last edited by Tanman; 11-06-2010, 04:02 PM.

                Comment


                • #9
                  Re: How to invoke Order Builder XDialog in sorting fields in my reports?

                  Update:

                  I have added in the variable...the order builder appears But what I set in the order builder is not passing through to the report.

                  So say I put in the first section of the order builder, sort by Company. When I click on ok, the report still sorts on Record. Any ideas?

                  >>Then you can pass order criteria to report as a parameter.
                  This part is what I am having problems with
                  TIA

                  Comment


                  • #10
                    Re: How to invoke Order Builder XDialog in sorting fields in my reports?

                    Do something like this in the interactive window to test.
                    Code:
                    ptr = a5_order_builder("","contact")
                    ?ptr
                    = lastbutton = "OK"
                    order_expression = "Id_number"
                    
                    preview_report("Phone List","",ptr.order_expression)
                    Bill.

                    Comment


                    • #11
                      Re: How to invoke Order Builder XDialog in sorting fields in my reports?

                      Thank you Bill I followed as you said and understood what you mean by passing parameters in this manner.

                      After looking at the code that alpha 5 presented me with in the interactive mode. I found out that the parameter it creates is indeed order_expression and I added it in to the report syntax and it bingo it worked! So thank you very much for persisting with me on that.

                      I thought about it and I wanted it to take a step further.

                      After having looked at the code, i can see that if I choose cancel the order expression switches to "cancel"

                      Code:
                      ptr = a5_order_builder("","temptable2")
                      = lastbutton = "cancel"
                      order_expression = ""
                      So I figured that following the same process I would be able to define some events and came up with this code

                      Code:
                      DIM lastbutton as C
                      
                      ptr = a5_order_builder("","temptable2")
                      
                      if lastbutton="OK" then
                          
                      preview_report("General_Report","",ptr.order_expression)
                      
                      elseif lastbutton="cancel"then
                      cancel()
                      end if
                      Basically what I want is "If OK is pressed, it goes ahead with the program, if i click Cancel it stops."
                      I added in a DIM to declare the variable because when I didn't A5 started to complain about a variable not being defined.

                      What actually happens is that if I click cancel. . . it does cancel, but if I click "OK" it does cancel again...is there any way i can debug it properly or find out what I am doing wrong?

                      Once this is done, I think I am happy with this and I am very grateful for your support Bill. I have learnt a lot.

                      Comment


                      • #12
                        Re: How to invoke Order Builder XDialog in sorting fields in my reports?

                        It looks like there must have been some other code, as this would not work. "ptr" is a pointer to properties that are returned by the order builder function. So to reference those properties they must be prefixed by "ptr.". Try this.

                        Code:
                        ptr = a5_order_builder("","temptable2")
                        if ptr.lastbutton="OK" then
                            preview_report("General_Report","",ptr.order_expression)
                        
                        else  'for any other condition that might occur
                            end
                        end if
                        Bill.

                        Comment


                        • #13
                          Re: How to invoke Order Builder XDialog in sorting fields in my reports?

                          Thank you very much Bill. That code worked. I should have realised that i need to prefix it with ptr as thats what we defined!


                          Many thanks Bill for this. I have learnt a tremendous amount from this exercise and am eager to start learning how this works.

                          Comment

                          Working...
                          X