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

Reports: Active Tables, Pasive Tables, SQL Joins

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

    Reports: Active Tables, Pasive Tables, SQL Joins

    I have move my v9 web app to v10 with SQL as the backend. I am trying to stay SQL "pure" as possible by avoiding using passive or active link tables for reports. But I am finding this difficult to create reports where I need to use more than one sub-reports of linked tables with one-many relationships.

    When using dbf, Sets were so easy to work with and define. Lookups and calculations using other tables were a breeze. However I am not having much luck using various SQL Views and/or joins to achieve the same functionality. I am sure it is due to my inexperience with SQL and using SQL with Alpha.

    My question is this: I have a report that needs to displays data from several linked child tables but it seems like no matter what type of SQL join I use in a report with more than one sub-report it always displays repeating child data.

    What is the best SQL way to achieve this?

    If I have to use link tables, how much of a performance hit does linked tables cause in a large application?

    Lastly, it seems like passive link tables give a lot of flexibility for reports but how would you refresh these from a web page prior to each time a report is called?

    Any help would be appreciated! Thanks.

    #2
    Re: Reports: Active Tables, Pasive Tables, SQL Joins

    I need to know more about what you're trying to achieve to help, but, as far as your repeating rows, look up the DISTINCT keyword of the SELECT statement.
    Frank R

    Comment


      #3
      Re: Reports: Active Tables, Pasive Tables, SQL Joins

      Frank, thank you for responding.

      So for example,I have a patient table {patient}. Each patient "can" have multiple and different tests done { such as, test A, test B, test C} with a series of results for each test. All test data need to be either active linked or updated just prior to running a report.

      In my report, I need to generate a sub report of any test and a table of results for each.

      With Alpha in the past, I would just create a set and it would be no problem. I can create a passive link of the patient table and each test, then create a set which works fine but I have not been able to figure out how to update all the tables prior to each printing from a web.

      If I create a SQL view then I am basically creating a big flat file of all this data and trying to create sub reports on a flat file which I believe is giving me repeating rows in my sub reports.

      If I create an active link of each table and create a set, it is very slow.

      So, that is my initial problem. What is the best way to get the SQL data to the Alpha report generator without costing too much performance loss?

      Comment


        #4
        Re: Reports: Active Tables, Pasive Tables, SQL Joins

        What database are you using?
        Frank R

        Comment


          #5
          Re: Reports: Active Tables, Pasive Tables, SQL Joins

          I am using MS SQL Server 2008 express with Management Studio as my interface.

          Comment


            #6
            Very slow report performance using (active link) sets

            I too am experiencing very slow performance when using a set of active link tables from my backend SQL database for my reporting (as noted above by a previous user). Can anyone offer a solution to this problem?

            Please note, I am limited to using active links (instead of using SQL tables directly) because of multiple subreports and child tables.

            Any help would be greatly appreciated!
            Joe

            Comment


              #7
              Re: Reports: Active Tables, Pasive Tables, SQL Joins

              Joe

              If you are reporting only for this data, use passive linked tables and then use a set in Alpha, or use a more complex select statement with a join in it.

              My guess is that the passive linked tables would be the fastest.

              Do as much work as you can in the SQL select statement. Bring across only the columns and rows that are needed.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment


                #8
                Re: Reports: Active Tables, Pasive Tables, SQL Joins

                I am working on a web application. If I use passive links for report data, is there a way to add a function that would automatically refresh the data for my users prior to generating output?
                Thanks again,
                Joe

                Comment


                  #9
                  Re: Reports: Active Tables, Pasive Tables, SQL Joins

                  Originally posted by pja67 View Post
                  I am working on a web application. If I use passive links for report data, is there a way to add a function that would automatically refresh the data for my users prior to generating output?
                  Thanks again,
                  Joe
                  Not that I know of, but I'm working on finding out.

                  Maybe you can find out faster than I can. I'll let you know what I find.
                  Al Buchholz
                  Bookwood Systems, LTD
                  Weekly QReportBuilder Webinars Thursday 1 pm CST

                  Occam's Razor - KISS
                  Normalize till it hurts - De-normalize till it works.
                  Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                  When we triage a problem it is much easier to read sample systems than to read a mind.
                  "Make it as simple as possible, but not simpler."
                  Albert Einstein

                  http://www.iadn.com/images/media/iadn_member.png

                  Comment


                    #10
                    Re: Reports: Active Tables, Pasive Tables, SQL Joins

                    Joe,

                    If you call your print report from an a5w page, you can use the desktop a5_RefreshPassiveLinkTable(table_i,.f.,.f.) to update your passive link via a web site. For example, here is the code I use for one of my reports. I place this before the print code.
                    Code:
                    <%a5 
                    ' ****** This following code will update the passive link tables - must have full path to work ***
                    dim tableList as C 
                    dim count as N
                    
                    dim i as N
                    dim pr as P
                    dim table_i as C
                    
                    tableList = <<%txt% 
                    C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_iom_tests
                    C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_pedicle
                    C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_to4
                    C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_patient
                    C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_client
                    %txt% 
                    
                    count = line_count(tableList)
                    for i = 1 to (count)
                        table_i = word(tableList,i,crlf())
                        pr =a5_RefreshPassiveLinkTable(table_i,.f.,.f.)
                    next i
                    ' ============== END Passive Update ===========================================
                    %>
                    If your reports require a lot of subsets then this is the only reliable way (that I have found) to create dbf sets with passive links that can then be used in your reports. Performance wise, it takes about 2-3 seconds to open a report now with SQL tables, where before it took about 1 second when I was using V9 and DBF tables. So not too bad. I have not released my V10/SQL version to the real world yet but so far in the testing stage, it all seems to work.

                    Comment


                      #11
                      Re: Reports: Active Tables, Pasive Tables, SQL Joins

                      Originally posted by Scholin View Post
                      I am using MS SQL Server 2008 express with Management Studio as my interface.
                      You can get a single large flat file result from SQL, but then you can create groups in the report to display only the tests and the test results. That works the same as subreports and it's actually faster.
                      For example, if your table shows:
                      Date Test Result
                      3/1/2010 Glucose 124
                      3/2/2010 Glucose 89
                      3/3/2010 Glucose 96
                      3/1/2010 Na 140
                      3/2/2010 Na 138
                      3/3/2010 Na 140

                      You can run your report, ordered by Test, then by Date, with a group break by Test. The report would look like this:

                      Glucose <- in group header
                      3/1/2010 124
                      3/2/2010 89
                      3/3/2010 96
                      Na
                      3/1/2010 140

                      etc.

                      Comment


                        #12
                        Re: Reports: Active Tables, Pasive Tables, SQL Joins

                        Michael - the code worked great, thanks!

                        Comment


                          #13
                          Re: Reports: Active Tables, Pasive Tables, SQL Joins

                          Glad to hear that.

                          I have not had the time to play around with this but in the newest beta Alpha version 10.5 just released, it "looks" like we may be able to do this with the new optimization of using active links for better performance.

                          I don't have any idea if it would be faster or better for reports - but it would seem like they are heading down that path. I believe it is good news for sure.

                          Comment


                            #14
                            Re: Reports: Active Tables, Pasive Tables, SQL Joins

                            tableList = <<%txt%
                            C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_iom_tests
                            C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_pedicle
                            C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_to4
                            C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_patient
                            C:\USMONSQL\USMON_SQL\Passive Link Tables\pas_client
                            %txt%
                            Would these need to exist on the desktop or are they on the server?
                            Win 10 64 Development, Win 7 64 WAS 11-1, 2, Win 10 64 AA-1,2, MySql, dbForge Studio The Best MySQL GUI Tool IMHO. http://www.devart.com/dbforge/mysql/studio/

                            Comment


                              #15
                              Re: Reports: Active Tables, Pasive Tables, SQL Joins

                              Frank,

                              It is on the remote server itself. However, I do have the full development software running on that server as well (don't know if that makes a difference or not). But this for a web site only.

                              Comment

                              Working...
                              X