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

Xdialog list box help

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

    Xdialog list box help

    Hi Everyone

    I'm trying to make a listbox from a crosstab operation.

    The result table is the summary of hours over a range of dates.

    Of course the field names (dates) change as each user selects different ranges.

    I've successfully changed the field names in the result table to reflect the date ranges but I'm stumped on how to change the fields in the list box to reflect the new fields each time the crosstab is run.

    Any help is much appreciated.

    Thank you

    Keith

    #2
    Re: Xdialog list box help

    Something like choosing Choices set to Computed Automatically and Source set to Field List?
    There can be only one.

    Comment


      #3
      Re: Xdialog list box help

      Hi Stan

      Thank you for your reply

      I'm not sure I understand your question. Sorry if I'm not explaining myself

      I used the xdialog genie to create the list box code but I'm trying to change the fields in the list box automatically to reflect the fields in the crosstab (which change) when the crosstab is run with a different date range.

      Hope this clarifies what I'm attempting.

      Thank you

      Keith

      Comment


        #4
        Re: Xdialog list box help

        Can you upload a sample database with the parts necessary to execute the basic xdialog? I think I know what you want but it will require converting the xdialog to xbasic. Does the crosstab result always have the same number of dates?
        There can be only one.

        Comment


          #5
          Re: Xdialog list box help

          Hi Stan

          Here are the related tables

          I haven't included the 2 tables used to create the sample2 table as it's rather complicated but suffice to say I'd like to know how to get the listbox fields to change when the sample2 table's date fields change.

          I used the genie to create it then converted it to xbasic but I'm lost on how to get those fields to change with the result table.


          Thank you for your help

          Regards,

          Keith
          Attached Files

          Comment


            #6
            Re: Xdialog list box help

            Hi Stan,

            The date fields will constantly change and no guarantee they will always be the same number of date fields.

            Regards,

            Keith

            Comment


              #7
              Re: Xdialog list box help

              This works here. I manually changed date field names in sample2 and they appear in the xdialog when it is rerun. The static example has the last field set to 30 wide where the others are all 25. I didn't try to incorporate that. 7:30[Sat_April_28th]

              Code:
              'get the current fields in the sample2.dbf to feed to the xdialog
              flds_list = table.external_field_name_get("sample2","n")
              'define the list of flds not used in the xdialog
              not_use = <<%nono%
              sales_no
              empl_id
              type
              %nono%
              'subtract not used from all fields for xdialog
              for_bld = word_subtract(flds_list,not_use,crlf())
              'construct the 1:25[Project],2:25[Mon_April_23th],.... section
              fixed = *for_each(fld,alltrim(str(*counter(),15,0))+":25["+fld+"]",for_bld)
              fixed = crlf_to_comma(fixed)
              'construct the left(''+project,25),left(''+mon_april_23th,25),....section
              vals = *for_each(fld,"left(''+"+fld+",25)",for_bld)
              vals = crlf_to_comma(vals)
              'Create an XDialog dialog box to prompt for parameters.
              DIM SHARED Qempy as C
              DIM SHARED fff as C
              DIM SHARED varC_result as C
              ok_button_label = "&OK"
              cancel_button_label = "&Cancel"
              DIM Qempy_rl_def as C 
              Qempy_rl_def = "k=emptable,{keylist_build(\"H=.05,1:25[Fname],2:25[Empl_Id]\",''+empl_id,left(''+fname,25),left(''+empl_id,25))}{}"
              DIM fff_rl_def_orig as C 
              'original keylist
              'fff_rl_def_orig = "kl=sample2,{keylist_build(\"H=.05,1:25[Project],2:25[Mon_April_23th],3:25[Tue_April_24th],4:25[Wed_April_25th],5:25[Thu_April_26th],6:25[Fri_April_27th],7:30[Sat_April_28th]\",''+project,left(''+project,25),left(''+mon_april_23th,25),left(''+tue_april_24th,25),left(''+wed_april_25th,25),left(''+thu_april_26th,25),left(''+fri_april_27th,25),left(''+sat_april_28th,30))}{empl_id =convert_type( [varC->Qempy],\"n\")}"
              'modified keylist feeding in variables
              fff_rl_def_orig = "kl=sample2,{keylist_build(\"H=.05,"+var->fixed+"\",''+project,"+var->vals+")}{empl_id =convert_type( [varC->Qempy],\"n\")}"
              DIM fff_rl_def as C 
              fff_rl_def = replace_parameters(fff_rl_def_orig,local_variables())
              varC_result = ui_dlg_box("Timesheet",<<%dlg%
              {region}
              | [%@Qempy_rl_def%.40Qempy!Qempy_changed];
              Type prompt here:| [%@fff_rl_def%.150,25fff];
              {endregion};
              {line=1,0};
              {region}
              <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
              {endregion};
              %dlg%,<<%code%
              If a_dlg_button = "Qempy_changed" then 
              	fff_rl_def = replace_parameters(fff_rl_def_orig,local_variables())
              	a_dlg_button = ""
              end if
              %code%)
              There can be only one.

              Comment


                #8
                Re: Xdialog list box help

                Hi Stan

                That works great

                Now to go through your code to learn how it works.

                Much appreciated.

                Thank you

                Keith

                Comment


                  #9
                  Re: Xdialog list box help

                  Glad to help.

                  Required reading - https://www.alphasoftware.com/docume...%20Strings.xml

                  Since we are dealing with something constructed from strings the only issue in making it dynamic is to work out how to substitute a variable containing what we need into the static framework.

                  Code:
                  fff_rl_def_orig = "kl=sample2,{keylist_build(\"H=.05,"+[COLOR="#FF0000"]var->fixed[/COLOR]+"\",''+project,"+[COLOR="#FF0000"]var->vals[/COLOR]+")}{empl_id =convert_type( [varC->Qempy],\"n\")}"
                  There can be only one.

                  Comment

                  Working...
                  X