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

Global variables in Reports problem

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

    Global variables in Reports problem

    Don't you hate it when Alpha tries to make things easier and just ends up making them harder or impossible?

    I used to be able to define global variables in a web dialog that prints a report, then define the same global variables in the report and have the values print on the report. Typical use was to create a date range filter and print that range on the report.

    Now global variables for reports have been changed, and I can't do that anymore (or else it is much better hidden!)

    So, for example, I'd put two date fields on a dialog: startdate and enddate, and in the aftervalidate event I'd do the following:
    dim global vStartdate as c = currentform.controls.startdate.value
    dim global vEnddate as c = currentform.controls.enddate.value

    Then, on the report, I'd define
    dim global vgStartdate as c
    dim global vgEnddate as c

    and I'd print them on the report:
    "Start date:" vgStartdate
    "End date: " vgEnddate

    It worked great. Now, however, you can't define global variables in a report without assigning a value to them, so this no longer works! Now you go to a global variables tab (which is just a blank area .... whoever thought that was better???) and you assign values. For example, if you want a character global variable, you assign, for example,
    vgStartdate = "start"
    vgEnddate = "end"

    But, when the report prints, it prints the words "start" and "end" instead of the values from the dialog!

    Does anyone know a way around this "improvement"?

    Pat
    Pat Bremkamp
    MindKicks Consulting

    #2
    Re: Global variables in Reports problem

    I just ran some tests Pat, and find everything to be in order, working as before. So, lemme ask:

    I see on your report, you've dimmed vgStartdate, but in the dialog, you named it vStartdate. Typo in your post here, or error in coding?

    And, I'm unsure how you established the variables in the report design. You don't enter an XBasic DIM statement as you seem to have suggested here. Instead, you simply enter something like:

    vStartDate = {}
    -Steve
    sigpic

    Comment


      #3
      Re: Global variables in Reports problem

      Steve,

      Thanks for checking into this.

      The v vs vg was just a typo. Sorry for the confusion.

      Since all I want to do is print the values on the report, I defined the values as character. I put the following in the Global tab of the Report Builder under the V button on the menu.
      vgStartdate = "start"
      vgEnddate = "end"
      and dragged those fields onto the report.

      According to the instructions, that's supposed to create the global variables as type c, and it seems to also define them with those default values.

      Then, in the dialog component, I put
      dim global vgStartdate as c
      dim global vgEnddate as c
      and assigned them the character representation of the two dates from fields on the dialog form.

      My expectation was that vgStartdate and vgEnddate on the report would be replaced by the values assigned in the dialog component. But, instead, they printed "start" and "end", the default values.

      This is all working for you?

      I'll keep trying.

      Pat
      Pat Bremkamp
      MindKicks Consulting

      Comment


        #4
        Re: Global variables in Reports problem

        I'm done for tonight, but lemme suggest that mayhaps you're overriding the variable values by assigning them a value in the report.

        Instead, set 'em up as:

        vgStartdate = ""
        vgEnddate = ""

        I'd have to test it, but gotta get up early enuf tomorrow to put the snowplow on my tractor so I can go out & play later....
        -Steve
        sigpic

        Comment


          #5
          Re: Global variables in Reports problem

          Steve,

          That's a good suggestion, but when I do that, the fields display as blank.

          I'm looking out at snow this morning, too, but it's supposed to melt by noon...no playing in the snow here.

          Pat
          Pat Bremkamp
          MindKicks Consulting

          Comment


            #6
            Re: Global variables in Reports problem

            FWIW I've had this happen to me before too, but I don't remember the solution.

            I think at this point, I'd test a new report or new dialog.

            Start with a new report - very simple - just something to display the variables. See if you can pass the variable values to it rather than your old one. Then (re)build from there.

            If that's not the case, do the same with the dialog. Build a very basic, simple one, see if you can pass the value to a report. And, of course, (re)build as necessary.

            At least you have the confirmation (well, from me at least) that this still works as advertised. I don't see the cause of your problem though.
            -Steve
            sigpic

            Comment


              #7
              Re: Global variables in Reports problem

              Pat,

              I have not gone back to test this in a web app, but this has caused me fits previously. Since your issue is new it may be something entirely different than mine. My problem was not with the report, but with the AfterValidate code in the dialog.

              I could never use the global variable in any statement after defining it. So your statement of
              dim global vStartdate as c = currentform.controls.startdate.value
              would match what I had to do. Then I never referenced "vStartdate", if needed, until after the report ran.

              I did not see others complaining about this, so maybe it was just me.

              As Steve says, the definition in the report is just
              vStartdate = ""

              Bill.

              Comment


                #8
                Re: Global variables in Reports problem

                Success!

                Thanks to all of you for your patience and suggestions.

                I moved the global definition to the first line of my script, and I changed to a single global variable (I'm now using a calculated field in the report to get the 'one week earlier' date) and it started working...

                Doesn't seem like that should have mattered, but it doesn't have to make sense...it only has to work!

                Pat
                Pat Bremkamp
                MindKicks Consulting

                Comment


                  #9
                  Re: Global variables in Reports problem

                  I know this is an old thread, but I need to revive it for the "new style" dialogs.

                  As Steve says, the definition in the report is just
                  vStartdate = ""
                  That works fine for me in the report, but I'm lost as to where to put the following statements:
                  dim global vStartdate as c = currentform.controls.startdate.value
                  dim global vEnddate as c = currentform.controls.enddate.value
                  in the new dialogs.

                  I tried Dialog Valiate and After Dialog Validate, with negative results, unless I am entering them in there the wrong way.
                  Attached Files
                  Sergeant Richard Hartnett
                  Hyattsville City Police Department
                  Maryland

                  Comment

                  Working...
                  X