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

CurrentGridFilter() Not Working with Multiple Tables

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

    CurrentGridFilter() Not Working with Multiple Tables

    I have a grid/view made up of two tables. I have a report based on a set which contains the same two tables.

    When I open the grid/view and perform a search based on any of the fields in either table or both, the grid display is correct.

    But when I try to print a report from the grid/view, it will only work if the search was based on fields from the parent table. The minute I add fields from the child table, although the grid shows the correct records, I get an error when trying to print the report.

    The filter for my print/action button is "CurrentGridFilter(), which I though would cause the report to print any records that appear in the grid, but that's not happening.

    The attached screen shot is typical of the error message I get when I try to mix my search with fields from both tables. (The "agency" is from the parent table, and the "year" is from the child table.)

    Does the "CurrentGridFilter()" filter only work with a grid based on a single table??
    Attached Files
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

    #2
    Re: CurrentGridFilter() Not Working with Multiple Tables

    I have been facing a similar problem with the CurrentGridFilter(). My report and the grid are based on a view that has joins for two tables.

    Any solution to this please?

    Comment


      #3
      Re: CurrentGridFilter() Not Working with Multiple Tables

      Is this a 'Table' grid or a 'View' grid?
      TYVM :) kenn

      Knowing what you can achieve will not become reality until you imagine and explore.

      Comment


        #4
        Re: CurrentGridFilter() Not Working with Multiple Tables

        Mine is a "view" based on two tables, and it looks like Osamaj's is too.
        Sergeant Richard Hartnett
        Hyattsville City Police Department
        Maryland

        Comment


          #5
          Re: CurrentGridFilter() Not Working with Multiple Tables

          Originally posted by Rich Hartnett View Post
          Mine is a "view" based on two tables, and it looks like Osamaj's is too.
          Hi Rich,

          I have tried several times to use the View grid. Like you, tasks for the parent grid work well but beyond that, the tasks I want to perform on the child grids do not work. I would really like to use the View grid but......
          TYVM :) kenn

          Knowing what you can achieve will not become reality until you imagine and explore.

          Comment


            #6
            Re: CurrentGridFilter() Not Working with Multiple Tables

            Hi guys,

            Thanks for the replies.

            Managed to solve it. The trick was to not just use the same query for both the report and the grid but also include all the fields in the grid as well. So I just hid the columns I did't want to show in the grid and the CurrentGridFilter() now works fine for the report.

            Cheers,

            Comment


              #7
              Re: CurrentGridFilter() Not Working with Multiple Tables

              Are you saying to include all of the fields from all of the tables in both the grid and the printed report, and just hide the fields on the grid? If so, what about the fields on the report? Hiding all of the non-used ones would be a pain.

              Can you elaborate?
              Sergeant Richard Hartnett
              Hyattsville City Police Department
              Maryland

              Comment


                #8
                Re: CurrentGridFilter() Not Working with Multiple Tables

                Hi Rich,

                No no need to hide the fields on the report, But all the fields included in the SQL query in the report should be included in your grid. You can hide the fields in the grid that you don't want to show.

                To elaborate further, as not sure if my case is exactly as yours, My report uses a SQL join query that's getting its fields from three tables. To use the grid as a report filter, I used the exact same query for the grid, and then included all the fields in the query to the grid but hid the ones I didn't what to show on the grid as the only purpose of the grid for me was to allow the user to filter the records and print the report for those records only.

                Hope this helps.

                Cheers,

                Comment


                  #9
                  Re: CurrentGridFilter() Not Working with Multiple Tables

                  Oh okay I see. Unfortunately it doesn't work for me, and that may be due to the fact that I am using DBF tables instead of SQL.

                  I did in fact add all the fields from all three of my view into the grid and hid the ones I didn't want to show, but it didn't help.

                  Running a query with mixed table fields works just fine, but still no luck when printing a report if any of the search options came from a child table.
                  Sergeant Richard Hartnett
                  Hyattsville City Police Department
                  Maryland

                  Comment


                    #10
                    Re: CurrentGridFilter() Not Working with Multiple Tables

                    In case anyone else is still struggling with this, I have it working now thanks to Selwyn.

                    He explained that the results I was getting from trying to print from a search based on multiple tables (grid/view) will always produce an error, due to the way the printed report interprets the fields. (In other words, it doesn't understand that some fields are from one table and some are from another.) But he explained how to make it work by using a "mapped table."

                    I had never used mapped tables before, but creating one is very easy and very similar to creating a set. The difference is that all of the data from both tables (or more if that's what you have in your set) ends up being displayed in one table like a flat file. Then you create your report based on that table rather than the set, and since the report only has one place to look for fields, it has no problems with grid searches based on a view.

                    In my case I just copied my report over to the new mapped table, tweaked it a bit here and there, and it now it works perfect.
                    Sergeant Richard Hartnett
                    Hyattsville City Police Department
                    Maryland

                    Comment


                      #11
                      Re: CurrentGridFilter() Not Working with Multiple Tables

                      Hi Rich

                      Thanks for the update. Would a sql view created in SQL Server (or MySQL) have worked as well?
                      Glen Schild



                      My Blog

                      Comment


                        #12
                        Re: CurrentGridFilter() Not Working with Multiple Tables

                        Hi Glen.

                        Don't know for sure since I am still using DBF tables. I haven't graduated up to SQL yet. LOL
                        Sergeant Richard Hartnett
                        Hyattsville City Police Department
                        Maryland

                        Comment


                          #13
                          Re: CurrentGridFilter() Not Working with Multiple Tables

                          Hi Rich,
                          Thank you VERY much for the update. I too had not used the mapped tables until reading this. WOW! What a whole new world this opened. Just starting to explore it. In some ways, it'll make things much easier, especially when dealing with grids used for reporting purposes and perhaps new data entry where portions of more than one table are needed.

                          Thanks again for your contribution.

                          Ken
                          Last edited by forskare; 04-07-2015, 04:24 PM.
                          TYVM :) kenn

                          Knowing what you can achieve will not become reality until you imagine and explore.

                          Comment


                            #14
                            Re: CurrentGridFilter() Not Working with Multiple Tables

                            Originally posted by Rich Hartnett View Post
                            Hi Glen.

                            Don't know for sure since I am still using DBF tables. I haven't graduated up to SQL yet. LOL
                            Oops should have read the thread more thoroughly :-) Good to know re: mapped tables though.
                            Glen Schild



                            My Blog

                            Comment


                              #15
                              Re: CurrentGridFilter() Not Working with Multiple Tables

                              No problem. Maybe one of these days I'll sit myself down and learn SQL.

                              But in the meantime, yes, the mapped tables certainly have their uses!
                              Sergeant Richard Hartnett
                              Hyattsville City Police Department
                              Maryland

                              Comment

                              Working...
                              X