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 based on a set has extra rows with no data

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

    Report based on a set has extra rows with no data

    I'm having trouble designing a report based on a set. The problem is extra rows populating the report.

    Set structure has a parent with for children linked on the key, transno.
    The last child is linked on the key, WO_NO.

    All links are one to many.

    Parent
    |===child1
    |===child2
    |===child3
    |===child4
    |
    |===child5


    My intention is to have a report with the totals of the work order summarized and displayed as one line. Following that line will be any and all invoices against that one work order.

    There may be no invoices, one invoice or three or more invoices against that one work order.

    The parent and the first four child tables are summarized and displayed in the work order header. This works fine.

    The Parent child5 relation is in the detail section. This works, however; I have a random number of rows with a zero displayed before I get to valid data.

    I do realize that this is related to the set structure, but I can't figure out my way around this. I've attached a sample of a page from the report. The work order number is the six digit number beginning with 0. The invoices are the six digit numbers preceded with an M. What I would like to do is to eliminate all the blank rows with a 0.00. The zero's are being generated by the calculated field which totals the columns of the Invoice.

    Then again, maybe I can not do it this way. I've been thinking about tmp tables, etc.., but I was hoping that I could do this with existing tables.

    Any suggestions would be welcomed.

    Thank you,

    Ron
    Attached Files
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    #2
    Re: Report based on a set has extra rows with no data

    do you have referential integrity on or off?
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      Re: Report based on a set has extra rows with no data

      no, referential integrity is set to none on all the links of this set.

      I created this set just for this report.
      Alpha 5 Version 11
      AA Build 2999, Build 4269, Current Build
      DBF's and MySql
      Desktop, Web on the Desktop and WEB

      Ron Anusiewicz

      Comment


        #4
        Re: Report based on a set has extra rows with no data

        try putting them all in subreports
        Cole Custom Programming - Terrell, Texas
        972 524 8714
        [email protected]

        ____________________
        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

        Comment


          #5
          Re: Report based on a set has extra rows with no data

          On a lot of my reports, I don't use details, and use all sub reports.

          PS: you can have a subreport in details, along with a regular details, too.
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


            #6
            Re: Report based on a set has extra rows with no data

            Moving the invoicing to a subreport corrected the problem. However; now the summary amounts for the work order do not work.

            I've tried putting the work order fields into a subreport and I end up with a huge amount of rows with 0.00.
            I tried moving the work order fields into the detail section and the amount totals are blank.
            I put the work order totals back into the work order group header and again, no values from the total calculations.
            Attached Files
            Alpha 5 Version 11
            AA Build 2999, Build 4269, Current Build
            DBF's and MySql
            Desktop, Web on the Desktop and WEB

            Ron Anusiewicz

            Comment


              #7
              Re: Report based on a set has extra rows with no data

              I hate it when stuff like that happens!!!

              Are all the child tables linked to the parent - I think they are

              is the set simple? - no filters in the set, all tables linking on only one field, etc?
              Cole Custom Programming - Terrell, Texas
              972 524 8714
              [email protected]

              ____________________
              "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

              Comment


                #8
                Re: Report based on a set has extra rows with no data

                All the child tables are linked to the parent.
                There are no filters.
                Four children are linked to the parent on one field, transno. These children are the source of the summarized data.
                The detail table is linked on a different field, work order number, as that's the only field in common between the two tables.
                All links are one to many.
                Alpha 5 Version 11
                AA Build 2999, Build 4269, Current Build
                DBF's and MySql
                Desktop, Web on the Desktop and WEB

                Ron Anusiewicz

                Comment


                  #9
                  Re: Report based on a set has extra rows with no data

                  Hi Ron,
                  When I have a summary report to do, I start with a detail report first so I can see what data is being included. Have you tried this with the W/O as the parent group and each of the 4 child tables as sub reports with their totals in each sub report's footer? Then you can put the grand totals for all of them in the group footer for the parent. If that is giving you the data you want summarized for the W/O portion, you should be able to add the invoice table fields to the detail section and move the group footer totals to the group header instead and remove your sub reports but keep all the calculations you defined. This however will cause the report to preprocess all those calc fields - which is why a temp table may be a better way to go.

                  Of course I haven't tried this theory... :)
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #10
                    Re: Report based on a set has extra rows with no data

                    Ron,

                    I agreed with Robin
                    which is why a temp table may be a better way to go.

                    Comment


                      #11
                      Re: Report based on a set has extra rows with no data

                      put the parent in the detail, and just below the detail line (still in the detail section) put the 4 subreports below each other
                      so - for each detail row, there will be 4 subreports
                      Cole Custom Programming - Terrell, Texas
                      972 524 8714
                      [email protected]

                      ____________________
                      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                      Comment


                        #12
                        Re: Report based on a set has extra rows with no data

                        Thank you for your suggestions.
                        I was away all day and I now have a more pressing issue that needs my attention right now.
                        As soon as I can, I'll get back to this and I will let you know how I made out.

                        Thanks,

                        Ron
                        Alpha 5 Version 11
                        AA Build 2999, Build 4269, Current Build
                        DBF's and MySql
                        Desktop, Web on the Desktop and WEB

                        Ron Anusiewicz

                        Comment


                          #13
                          Re: Report based on a set has extra rows with no data

                          Well, it was a struggle, but I finally got the report I needed.

                          After looking at the help documentation regarding reporting from a set, I ended up with three tables linked as a set. The work order header as the parent, a temp table that contained the work order labor, parts, shipping, etc.. and the invoice header table which contained the labor, parts, shipping, etc.. billed. The temp table was linked on the transno field while the invoice table is linked on the wo_no field.

                          When I run the script, the temp table gets zapped, then I append open work orders to the temp table with data from the header needed to create the link from the temp table to the header table.

                          Next, I created a while, end while that would go through the temp table populating each column with totals from each table; labor, parts, shipping, etc...

                          Code:
                          	query.description = "WO_WIP"
                          	query.order = "alltrim(Billingname)+N_Number"
                          	query.filter = "remspecial(dtoc(Date_Closed))=''.AND.Paid<>'X'.AND.Wo_No>'003000' "
                          	query.options = "N"
                          	
                          	t = table.open("wo_hdr",FILE_RW_SHARED)
                          	qry = t.query_create()
                          	nrecs = qry.records_get()
                          	qry.drop()
                          	t.close()
                          	
                          	IF nrecs = 0 THEN
                          		ui_msg_box("Notice",\
                          		"There Are No Open Work Orders.",UI_INFORMATION_SYMBOL)
                          		goto startover
                          	END IF
                          	
                          	'empty the "wo_wip_rpt" table
                          	dim tbl as P
                          	tbl = table.open("wo_wip_rpt")
                          	tbl.zap(.t.)
                          	tbl.close()
                          	
                          	'Append all qualified records from the wo_hdr table to the "wo_wip_rpt" table
                          	DIM Append as P
                          	a_tbl = table.open("wo_wip_rpt")
                          	append.t_db = "wo_hdr"
                          	
                          	append.m_key = "WO_NO"
                          	append.t_key = "Wo_No"
                          	append.m_filter = ""
                          	append.t_filter = query.filter
                          	append.type = "Unique only"
                          	append.m_count = 6
                          	append.m_field1 = "Wo_Transno"
                          	append.m_exp1 = "@Wo_Hdr->Transno"
                          	append.m_field2 = "Wo_No"
                          	append.m_exp2 = "@Wo_Hdr->Wo_No"
                          	append.m_field3 = "Wo_D_Open"
                          	append.m_exp3 = "@Wo_Hdr->Date_Opened"
                          	append.m_field4 = "Billingname"
                          	append.m_exp4 = "@Wo_Hdr->Billingname"
                          	append.m_field5 = "N_Number"
                          	append.m_exp5 = "@Wo_Hdr->N_Number"
                          	append.m_field6 = "Paid"
                          	append.m_exp6 = "@Wo_Hdr->Paid"
                          	append.t_count = 0
                          	a_tbl.append()
                          	a_tbl.close()
                          	
                          	dim wTbl as P
                          	dim vcTransno as C
                          	wTbl = table.open("wo_wip_rpt")
                          	wTbl.fetch_first()
                          	while .not. wTbl.fetch_eof()
                          		vcTransno = wTbl.wo_transno
                          		wTbl.change_begin()
                          		wTbl.wo_labor = tablesum("wolabor","Transno="+s_quote(vcTransno),"amt")
                          		wTbl.wo_parts = tablesum("woparts","Transno="+s_quote(vcTransno),"parts_amt")
                          		wTbl.wo_OSW = tablesum("woosw","Transno="+s_quote(vcTransno),"labor+part+ship")
                          		wTbl.wo_shipping = tablesum("woship","Transno="+s_quote(vcTransno),"ship_amt")
                          		wTbl.wo_misc = tablesum("womisc","Transno="+s_quote(vcTransno),"misc_amt")
                          		wTbl.change_end(.t.)
                          		wTbl.fetch_next()
                          	end while
                          	wTbl.close()
                          The report was still a challenge as I had trouble totaling amounts. I ended up with the work order totals in the group header with the multiple invoices being placed into a sub-report in the detail section.

                          Now, life is good.

                          Thanks.
                          Attached Files
                          Alpha 5 Version 11
                          AA Build 2999, Build 4269, Current Build
                          DBF's and MySql
                          Desktop, Web on the Desktop and WEB

                          Ron Anusiewicz

                          Comment

                          Working...
                          X