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

Function/Set Problem

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

    Function/Set Problem

    Hello All,

    I've run into a problem with my development. I've attached a cleaned up database. I removed private information.

    The problem occurs when I open the form (“WO Data Entry Main”) and print. “Print Traveler” is the only button on the form that is active. This is a work in progress – I'm the only one that has access to the database. The problem I observe is that on the report under specifications I sometimes get the actual description of the process (which is correct), and at other times I get the name of the field ProcessName. I think it is a combination of the way my set is set up and the function I've written. But I don't understand why it works sometimes and at other times not

    Is it a function of the size of the set? How objects are called?

    To duplicate the problem

    1.Open the form (there's only one)
    2.Go to the end of the file
    3.Click “Print Traveler” - Preview – and read under 'Specifications'. This should return some process callout string; Not “ProcessName”. You may have to “Exit Preview” and click “Print Traveler” again.
    4.Move through the file until you select, say, “BANO” or “CANO” as the process. Change something on the form and save it. Select “Print Traveler” - Preview as above. You may have to do this several times.

    I've even observed that when I first boot Alpha in the morning and open this table and go to print, there is an error immediately and if I keep closing and opening the report to print (from the form) it seems as if Alpha appears to be parsing information because if I continue to “Exit Preview” and “Print Traveler” Preview – more and more information appears on the report and it is eventually correct and then subsequently it fails and prints “ProcessName” under specifications, if that makes any sense whatsoever.

    Any help would be appreciated. I know it's Friday afternoon and won't be checking this board until Monday after I leave in several hours.

    Thanks,
    Guy :)

    #2
    Re: Function/Set Problem

    Guy,
    I cannot reproduce any problem...be more specific in not only your steps to elicit the issue, but also what should be seen in say a specific record and what are you getting.

    I looked at your function and the option strict you have most likely is not necessary and if memory serves, it makes it so you HAVE to dimension your variables which you are not....could be the issue but unknown until I can reproduce the problem.

    Also,
    I know it's Friday afternoon and won't be checking this board until Monday after I leave in several hours.
    Does this mean you don't get to play until Monday...what a drag!!! :)
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


      #3
      Re: Function/Set Problem

      I followed the steps outlined and got the problem reported. I opened the database, went to the last record and did a print preview. Closed the preview and then naviagated to another record... print preview, closed, another record etc about 5 times, then back to the last record and the attached is what I get on a print preview. Going to have a look now.

      Comment


        #4
        Re: Function/Set Problem

        The function is just not firing each time the report is opened... and it should. I see no reason why it wouldn't fire. I'd say this was a bug. With the ui_msg_box in place inside the function, the message is not displaying.

        Having said that... I would probably change things a bit anyway. When the function does fire it seems to be firing multiple times which I don't like.

        I changed the database a bit to put the basic Process Description into the processlookup table. Then, on the form, from the Process field I do a lookup on the Processlookup table to get the main description and then add the Class and type to it. In my change, I added a field to the form called ProcDesc which will hold the full process description. It's bascially moving the select case statement from a function to the OnChange event of the Process field. I assign the ProcDesc to a global variable and pick up that variable in the report. It works every time now.

        I might even add a field to the main table to keep the ProcDesc with the Process - not sure if that's the best idea. I see why you want to figure out the Process Description on the fly in the report but until the bug gets fixed you'll have to do it a different way.

        Going to look at moving the fuction call to the Detail section of the report now.

        Comment


          #5
          Re: Function/Set Problem

          Move the function fProcess() into the Detail OnRecord event of the report. Have the function set a global variable to the description and change the report ProcessName to that variable. Add the field "Process" to your report and hide it. Doing this it all seems to work ok.

          One problem I had was with your Process names - there are blanks at the end of the names at time, so when you call fProcess(Process)... trim it... or make sure they're going into the database clean.

          varProcDesc = fprocess(trim(:Traveler_Report_1:process.value))

          Attached is a copy of the database with changes.

          Comment


            #6
            Re: Function/Set Problem

            Gus, I think the basic problem here is that calc value in your report is not being evaluated "on time"... i.e. before the report engine begins to render the report. The calc value depends upon a udf. It seems the udf is not returning a value fast enough.

            In addition to David's approach another idea would be to offload the udf processing from the report. Create a calc display value in the form. Define it to return the string from the fProcess() udf. You need not display it on the form. Then define a global variable in the form layout. Set data type to character. Then modify your PrintTraveler button to assign the calc display value to the new global variable before calling the report. Last step is to modify the report layout: (a) define the global variable there; and (b) drop it into the layout where your Process calc field is currently living. The effect of these changes is to compute the desired process string before the report begins. Then pass it to the layout in a global variable. This works well here because you are limiting the report to a single parent table record.

            Comment


              #7
              Re: Function/Set Problem

              Tom... I would go so far as to even display the computed value of the Process and display it for the user to see on the form... I like seeing that stuff and it's good comfirmation for the user. Saving to a field in a table is a little redundant, but I would probably do that too... then getting at it in a report is even easier.

              Comment


                #8
                Re: Function/Set Problem

                David, I think that's a good idea in many cases, too.

                Did you notice that his subreport is based on the same set as the report itself? I think subreports work better when based on the linked child table, instead... but didn't have time to investigate whether that might make a difference here.

                Regards,

                -- tom

                Comment


                  #9
                  Re: Function/Set Problem

                  Thank you, David, Mike, and Tom for your suggestions and actually duplicating the problem I was having.

                  I, too, noticed that the function either fired too many times or was not firing correctly.

                  And... I did play this weekend.

                  Thanks for your help,
                  Guy :)

                  Comment


                    #10
                    Re: Function/Set Problem

                    FYI: I reported this as a bug.

                    Comment

                    Working...
                    X