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

Report Layout for Monthly Schedule

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

    #16
    Re: Report Layout for Monthly Schedule

    Yeah sometimes I surprise myself. LOL
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

    Comment


      #17
      Re: Report Layout for Monthly Schedule

      Originally posted by Rich Hartnett View Post
      Thanks Steve. I never knew you could put html code into a report, but I learn something new every day.

      It looks tricky, but I will certainly give it a try and see what happens.
      Don't think of it particularly as HTML code. Think of it as creating a variable, and just inserting it where you need it. The variable, in this case, happens to be HTML which means you need to treat it as such, but it offers great formatting and organizational possibilities. The first one you do will be a little tricky, but keep it simple as I've suggested. Pretty soon it'll be second nature -- just Xbasic code to generate the text string you need.
      -Steve
      sigpic

      Comment


        #18
        Re: Report Layout for Monthly Schedule

        Well as it turns out, my elation was a bit premature.

        Although the idea of using the sub-reports works great, apparently there is a limit of 30, and of course there are 31 days in most months. As such, my report looks perfect if the month only has 30 or less days in it, but as soon as I add the 31st sub-report, I get an error message that says there are too many sub-reports in this report.

        One sub-report away from the finish line. That sux.

        If I could just figure out an easy way to filter that last group of fields to just the 31st, without using a sub-report, I would be golden.
        Attached Files
        Sergeant Richard Hartnett
        Hyattsville City Police Department
        Maryland

        Comment


          #19
          Re: Report Layout for Monthly Schedule

          Suggestion wouldn't work as I thought. Should have looked at the table first.

          Required a little manipulation. Some work to be done on the report to dress it up and narrow the columns.
          Attached Files
          Last edited by Stan Mathews; 10-30-2014, 11:20 AM.
          There can be only one.

          Comment


            #20
            Re: Report Layout for Monthly Schedule

            Originally posted by Stan Mathews View Post
            Suggestion wouldn't work as I thought. Should have looked at the table first.

            Required a little manipulation. Some work to be done on the report to dress it up and narrow the columns.
            Stan

            Nice. I think it needs to allow for a day not having data and therefore not having a column in the crosstab table.

            Although since the police don't get a day off it may not be needed for Rich's system. Maybe just for others. But that would make it more generic.

            It's the crosstab improvement that Alpha knows should be done but isn't high on the priority list.

            I'm thinking the append needs to look at the crosstab fieldnames and get the day of the month and then append to the wk_date table instead of crossrefing by the field_Count.
            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


              #21
              Re: Report Layout for Monthly Schedule

              I was thinking the report column headings would be calculated fields based on the dates selected in the variables. Might need to change the variables to global for them to be seen in the report.

              The report could also be ordered as per the original screenshot with a case() function like

              case(Wkgroup = "Squad 1",1,Wkgroup = "Squad 2",2,Wkgroup = "Squad 3",3)

              One could actually have a base table with just the wkgroup field and then add fields based on the count of fields in the crosstab, removing them after the report is run.

              Not sure how to handle a report based on a varying number of fields though. Maybe have a version for 28, 29, 30, and 31 day months selecting the appropriate version as needed?
              There can be only one.

              Comment


                #22
                Re: Report Layout for Monthly Schedule

                Originally posted by Stan Mathews View Post
                I was thinking the report column headings would be calculated fields based on the dates selected in the variables. Might need to change the variables to global for them to be seen in the report.

                The report could also be ordered as per the original screenshot with a case() function like

                case(Wkgroup = "Squad 1",1,Wkgroup = "Squad 2",2,Wkgroup = "Squad 3",3)

                One could actually have a base table with just the wkgroup field and then add fields based on the count of fields in the crosstab, removing them after the report is run.

                Not sure how to handle a report based on a varying number of fields though. Maybe have a version for 28, 29, 30, and 31 day months selecting the appropriate version as needed?
                I think the base table needs to be stable since the objects on the report need to be there or an error occurs.

                I'm working on a script to read the table names and build the append on the fieldnames rather than the count of fieldnames.. (I need it for another project of mine.) ;)
                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


                  #23
                  Re: Report Layout for Monthly Schedule

                  Thanks to both of you guys for assisting me with this.

                  I don't know anything about crosstab tables, but I can certainly learn. I'm confused though as to how the data gets from my original table (i.e. "The Master Schedule") to the other tables?

                  And if I use this format, will it allow multiple months to be displayed at once?

                  They way they do it now is on an Excel spreadsheet, which makes it easy to print, but I want to change it all to web based, with an option to print.
                  Attached Files
                  Sergeant Richard Hartnett
                  Hyattsville City Police Department
                  Maryland

                  Comment


                    #24
                    Re: Report Layout for Monthly Schedule

                    Not sure I understand entirely because you still have to have the count to supply to the append.m_count variable but maybe

                    Code:
                    tbl_src = table.open("wk_cross")
                    fld_names = tbl_src.field_name_get()
                    fld_count = line_count(fld_names)
                    tbl_src.close()
                    
                    DIM Append as P
                    a_tbl = table.open("wk_dates")
                    dest_names = a_tbl.field_name_get()
                    a_tbl.zap(.T.)
                    append.t_db = "wk_cross"
                    ON ERROR GOTO ERROR30102014095038166
                    append.m_key = ""
                    append.t_key = ""
                    append.m_filter = ""
                    append.t_filter = ""
                    append.type = "All"
                    append.m_count = fld_count
                    for qx = 1 to fld_count
                    eval("append.m_field"+alltrim(str(qx))) = word(dest_names,qx,crlf())
                    eval("append.m_exp"+alltrim(str(qx))) = "@WK_CROSS->"+word(fld_names,qx,crlf())
                    next
                    append.t_count = 0
                    
                    a_tbl.append()
                    
                    
                    GOTO CONTINUE30102014095038166
                    ERROR30102014095038166:
                    ON ERROR GOTO 0
                    ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
                    END
                    CONTINUE30102014095038166:
                    a_tbl.close()
                    There can be only one.

                    Comment


                      #25
                      Re: Report Layout for Monthly Schedule

                      More like this...

                      To test with less fields, remove some of the fields from the crosstab - but not the first field.

                      Code:
                      'Date Created: 30-Oct-2014 09:59:16 AM
                      'Last Updated: 30-Oct-2014 11:38:38 AM
                      'Created By  : SMathews
                      'Updated By  : al
                      tbl_src = table.open("wk_cross")
                      use_fld_ct = tbl_src.fields_get()-1
                      fld_names = tbl_src.field_name_get()
                      'get rid of the first field
                      fld_names=*word_remove(fld_names, 1, crlf())
                      
                      tbl_src.close()
                      
                      DIM Append as P
                      a_tbl = table.open("wk_dates")
                      a_tbl.zap(.T.)
                      append.t_db = "wk_cross"
                      ON ERROR GOTO ERROR30102014095038166
                      append.m_key = ""
                      append.t_key = ""
                      append.m_filter = ""
                      append.t_filter = ""
                      append.type = "All"
                      append.m_count = use_fld_ct
                      append.m_field1 = "WKGROUP"
                      append.m_exp1 = "@WK_CROSS->WKGROUP"
                      'for qx = 2 to use_fld_ct
                      'debug(1)
                      	ctr=0
                      for each fn in fld_names
                      	ctr=ctr+1
                      	qx=substr(fn,8,2)
                      eval("append.m_field"+alltrim(str(ctr))) = "D"+padl(alltrim(qx),2,"0")
                      eval("append.m_exp"+alltrim(str(ctr))) = "@WK_CROSS->"+fn
                      next
                      append.t_count = 0
                      
                      a_tbl.append()
                      
                      
                      GOTO CONTINUE30102014095038166
                      ERROR30102014095038166:
                      ON ERROR GOTO 0
                      ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
                      END
                      CONTINUE30102014095038166:
                      a_tbl.close()
                      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


                        #26
                        Re: Report Layout for Monthly Schedule

                        Originally posted by Rich Hartnett View Post
                        Thanks to both of you guys for assisting me with this.

                        I don't know anything about crosstab tables, but I can certainly learn. I'm confused though as to how the data gets from my original table (i.e. "The Master Schedule") to the other tables?

                        And if I use this format, will it allow multiple months to be displayed at once?

                        They way they do it now is on an Excel spreadsheet, which makes it easy to print, but I want to change it all to web based, with an option to print.
                        At present it is based on a fixed end result table with 31 date related fields. As Al and I were noting the end result table could be recreated each time with the appropriate number of fields based on the source table. (edit by Al: except Al is saying the report base table is constant and the append operation has variable fields in it. But Stan and I will work that out.)

                        Don't know anything about how you are presently displaying it. The exercise I went through involved how to derive a table upon which you could base a report in the format you described. I can't see how having more than 32 fields on a report would be readable.

                        If you're confused about how the data gets from your table to the result table, study the events for each of the buttons on the form.
                        Last edited by Al Buchholz; 10-30-2014, 01:03 PM.
                        There can be only one.

                        Comment


                          #27
                          Re: Report Layout for Monthly Schedule

                          Originally posted by Rich Hartnett View Post
                          Thanks to both of you guys for assisting me with this.

                          I don't know anything about crosstab tables, but I can certainly learn. I'm confused though as to how the data gets from my original table (i.e. "The Master Schedule") to the other tables?

                          And if I use this format, will it allow multiple months to be displayed at once?

                          They way they do it now is on an Excel spreadsheet, which makes it easy to print, but I want to change it all to web based, with an option to print.
                          Rich

                          We'd need to add the month field to the crosstab process to get a row for each month and each wkgroup.

                          It's the crosstab operation that reads the data from the master schedule and produces rows and columns in an intermediate table that is appended to the report base table.
                          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


                            #28
                            Re: Report Layout for Monthly Schedule

                            Originally posted by Al Buchholz View Post
                            More like this...
                            Not bad at all. I think you need ctr=1 instead of ctr = 0 though.
                            There can be only one.

                            Comment


                              #29
                              Re: Report Layout for Monthly Schedule

                              Originally posted by Stan Mathews View Post
                              Not bad at all. I think you need ctr=1 instead of ctr = 0 though.
                              Oops - right... because the first field is the wkgroup.

                              and...

                              use_fld_ct = tbl_src.fields_get()

                              gotta take the minus 1 off this expression so

                              append.m_count = use_fld_ct

                              is correct.

                              Thanks for the push Stan and Rich.. Now I have the process I need for another project.
                              Last edited by Al Buchholz; 10-30-2014, 01:13 PM.
                              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

                              Working...
                              X