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 Grid Summary Variables be accessed programatically?

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

    Can Grid Summary Variables be accessed programatically?

    If a grid has a summary on a field that shows the total at the bottom part of the grid (bottom by default), can that data be accessed?

    For example, use the grid total to populate session variables by some xbasic?

    Thanks


    #2
    Re: Can Grid Summary Variables be accessed programatically?

    Originally posted by [email protected] View Post
    If a grid has a summary on a field that shows the total at the bottom part of the grid (bottom by default), can that data be accessed?

    For example, use the grid total to populate session variables by some xbasic?

    Thanks

    [ATTACH]12178[/ATTACH]
    I'm wondering if any Alpha Employees could look at this as it seems like it would be a good thing to know. It would save re-reading records and a return trip to the server.

    Does anyone know?

    Comment


      #3
      Re: Can Grid Summary Variables be accessed programatically?

      Originally posted by [email protected] View Post
      I'm wondering if any Alpha Employees could look at this as it seems like it would be a good thing to know. It would save re-reading records and a return trip to the server.

      Does anyone know?
      I'm bumping myself.

      I can't see my using an incident to get an answer to this seemingly straightforward easy-to-answer question.

      Any Alpha Software Devs out there know the answer and wouldn't mind sharing?

      Pretty Please ?

      Comment


        #4
        Re: Can Grid Summary Variables be accessed programatically?

        I just poked around, and don't see a way to grab the value Clint. It's not assigned to any object name either in Xbasic or the resulting html.

        Guess what I'd do is run a seperate calculation and put that into the session variable unless someone finds something I don't see.
        -Steve
        sigpic

        Comment


          #5
          Re: Can Grid Summary Variables be accessed programatically?

          Originally posted by Steve Workings View Post
          I just poked around, and don't see a way to grab the value Clint. It's not assigned to any object name either in Xbasic or the resulting html.

          Guess what I'd do is run a seperate calculation and put that into the session variable unless someone finds something I don't see.
          Hey Steve,

          Thanks for responding. I couldn't find anything either. I can certainly do a number of things (xbasic statistics function for example) to get the total.

          But the thing is.....it's ....right.....there....so Alpha must have *some* way to hold the value as they calculate the summary feature.

          Getting that total that's *right there* at the bottom will save me re-reading a possibly HUGE number of records......what a waste re-reading all those records.....

          Assuming the other gurus here aren't holding back. I'll assume no user knows.
          But....the Alpha Devs probably *do* know.

          I'm starting a poll. Who would *LIKE* to be able to access the summary functions that are built into the grid.

          Would it be a time saver/performance saver to not have re-code a re-reading of your data? I think so....

          Am I alone?....please don't let me be alone....

          Comment


            #6
            Re: Can Grid Summary Variables be accessed programatically?

            As far as I know, these values are not available to you.

            You could try parsing your Output.Body.Grid_HTML to extract them if you really don't want to calculate them.

            Lenny Forziati
            Vice President, Internet Products and Technical Services
            Alpha Software Corporation

            Comment


              #7
              Re: Can Grid Summary Variables be accessed programatically?

              Clint - here's some code I just tried out that works at least for this example. This, or something very close to this should work for any of your pages.

              I used AlphaSports to create a grid of Invoice Items with a total, per your example. Placed the grid on an A5W page, of course, then added this code to the page to obtain and display the session variable and it's value:

              Code:
              <%A5
              start = "Total&nbsp;</td><td"
              end = "</td>"
              less_text = extract_string(x_Grid_Items.Output.Body.Grid_HTML, start, end)
              session.ShowTotal = substr(less_text, at(">$", less_text)+1, 15)
              ?"Session.ShowTotal = " + session.ShowTotal
              %>
              I'm sure this could be cleaned up and made a bit more efficient, but it's a good start. Hope this helps.
              -Steve
              sigpic

              Comment


                #8
                Re: Can Grid Summary Variables be accessed programatically?

                Originally posted by Lenny Forziati View Post
                As far as I know, these values are not available to you.

                You could try parsing your Output.Body.Grid_HTML to extract them if you really don't want to calculate them.
                Thank you for responding. I really don't want to re-do what is already done.

                Comment


                  #9
                  Re: Can Grid Summary Variables be accessed programatically?

                  Originally posted by Steve Workings View Post
                  Clint - here's some code I just tried out that works at least for this example. This, or something very close to this should work for any of your pages.

                  I used AlphaSports to create a grid of Invoice Items with a total, per your example. Placed the grid on an A5W page, of course, then added this code to the page to obtain and display the session variable and it's value:

                  Code:
                  <%A5
                  start = "Total&nbsp;</td><td"
                  end = "</td>"
                  less_text = extract_string(x_Grid_Items.Output.Body.Grid_HTML, start, end)
                  session.ShowTotal = substr(less_text, at(">$", less_text)+1, 15)
                  ?"Session.ShowTotal = " + session.ShowTotal
                  %>
                  I'm sure this could be cleaned up and made a bit more efficient, but it's a good start. Hope this helps.
                  Thank you for responding Steve,

                  I almost cramped my fingers speed-typing (mostly copy and pasting but you get the idea) your example to test it and it ***WORKS***. I salute you .

                  I can't be the only one that sees an advantage of not re-reading untold thousands of records when the answer was *right there* in the grid.

                  Now thanks to you, I don't have to. Woot! :D

                  /waves to Lenny Forziati and other Alpha employees.
                  Could someone add Steve's code as an example to the help file (and give Steve credit)?
                  Last edited by [email protected]; 09-20-2006, 11:40 AM.

                  Comment


                    #10
                    Re: Can Grid Summary Variables be accessed programatically?

                    Mr. Workings, nice solution. What a nice grasp of the connection between the server functions and the page. I'd appreciate help on a very similar problem wherein I calculate a total value and put it into the freeform area above a grid component. I'm dealing with a very small table so processing time isn't an issue as it is here.
                    One problem that I've run into is that if I reference a variable that is developed in the page <head> section, the grid component piece (I consider the freeform area above the grid to be a 'piece') doesn't see it and so I get a script error. I suppose I'll have to move the logic currently in the <head> area into the piece. I did that but it still does not see the variable.
                    I suspect that I'm abusing the tools or not using them as intended.
                    A suggestion would be that if alpha code is placed into a piece of a component (which is what I'm doing) that the logic in the publisher pull out the stuff that is in the component piece <head> section and put it into the page <head> section (Hmmm. I suspect it does this but ONLY when I initially insert it into the page). And the body of the component piece to the body of the page. And the script editor which runs on the component pieces at 'save' time would only have to validate within the context of the piece. The source view for it shows both a head and body section.). I think I'm beginning to see some of the dynamics of the insert process or perhaps where my confusion is.
                    Any help clarifying this would be greatly appreciated.
                    I moved all of the logic into the piece and it worked. So, alpha code must be contained within the same <%a5 .. %> brackets within a freeform area.
                    Last edited by SteveHanson; 01-30-2007, 02:26 PM.

                    Comment


                      #11
                      Re: Can Grid Summary Variables be accessed programatically?

                      In the example I did for Clint, you'll see that I extracted stuff from x_Grid_Items.Output.Body.Grid_HTML. If you look at your .a5w page, you'll see all the output html is calculated before it's displayed on the page. It is, therefore, readily available -- I think maybe you're worrying too much about "what comes first."

                      The x_Grid_Items.Output.Body.Grid_HTML is just a string of html characters, so all I did below is apply a bit of string-handling with some html tags to get what I wanted.

                      Your description of what you want is a little vague -- if you need more help, please try to be as precise as possible about what you want.
                      -Steve
                      sigpic

                      Comment


                        #12
                        Re: Can Grid Summary Variables be accessed programatically?

                        Originally posted by Steve Workings View Post
                        In the example I did for Clint, you'll see that I extracted stuff from x_Grid_Items.Output.Body.Grid_HTML. If you look at your .a5w page, you'll see all the output html is calculated before it's displayed on the page. It is, therefore, readily available -- I think maybe you're worrying too much about "what comes first."

                        The x_Grid_Items.Output.Body.Grid_HTML is just a string of html characters, so all I did below is apply a bit of string-handling with some html tags to get what I wanted.

                        Your description of what you want is a little vague -- if you need more help, please try to be as precise as possible about what you want.
                        Yeah, you're probably right. But the reason your stuff worked is that the reference to x_Grid_Items... is already defined in the grid.
                        I was attempting to add something to the freeform area above the grid that didn't exist in the grid. It worked when I added all of the logic there, including the process that opened a set, read the set, looked at a session variable, added up a number and then printed that number at the end of the set reads. Nothing stops me from doing that. And it worked, just like I wanted it to. Unfortunately, the grid doesn't know what a session variable is so I get a warning message in the preview window. It still lets me publish it however and when it runs on the page, it has access to the session variables.
                        A lot of times, Steve, us newbies don't know enough to describe our problems. That's part of the process and value of posting this stuff.

                        Comment


                          #13
                          Re: Can Grid Summary Variables be accessed programatically?

                          Maybe all you need to do is DIM your session variable in your code?

                          Code:
                          dim session.myvariablename as c
                          for instance.

                          General programming practice should check to see if a variable exists and has a value before you proceed. Functions like eval_valid()are used frequently in WAS development.

                          Does that help?
                          -Steve
                          sigpic

                          Comment


                            #14
                            Re: Can Grid Summary Variables be accessed programatically?

                            Originally posted by Steve Workings View Post
                            Maybe all you need to do is DIM your session variable in your code?

                            Code:
                            dim session.myvariablename as c
                            for instance.

                            General programming practice should check to see if a variable exists and has a value before you proceed. Functions like eval_valid()are used frequently in WAS development.

                            Does that help?
                            Most definitely. As long as the code doesn't get confused with two sessionid variables; the one in the code and the one on the server.

                            Comment


                              #15
                              Re: Can Grid Summary Variables be accessed programatically?

                              This won't cause any confusion. It just makes sure that the session variable at least exists for your code if it hasn't been created somewhere else.
                              -Steve
                              sigpic

                              Comment

                              Working...
                              X