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

Problem with filter in Report.saveas()

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

    Problem with filter in Report.saveas()

    Can anyone tell me whats wrong with the following
    Filter = "substr(key,1,len(alltrim(session.link)"+"=alltrim(session.link)"

    There is no way to test it as the session variable only exits in WAS and key is in the db.

    If session key contains "1234" I want all the records that start with "1234"

    #2
    Originally posted by robert swanson
    Can anyone tell me whats wrong with the following
    Filter = "substr(key,1,len(alltrim(session.link)"+"=alltrim(session.link)"

    There is no way to test it as the session variable only exits in WAS and key is in the db.

    If session key contains "1234" I want all the records that start with "1234"
    filter = "substr(key,1,len(alltrim("+quote(session.link)+")))=alltrim("+quote(session.link)+")"

    Comment


      #3
      Selwyn Did a direct substitution but still doesn't work. If I remove filter from the Report.SaveAs then the thing functions as it should by printing the whole thing so the problem is with the filter.

      Comment


        #4
        Since you said "If session key contains", it makes me suspicious - Is "key" a field name?

        Comment


          #5
          Originally posted by robert swanson
          Selwyn Did a direct substitution but still doesn't work. If I remove filter from the Report.SaveAs then the thing functions as it should by printing the whole thing so the problem is with the filter.
          The filter expression I gave you is syntactically correct. Don't know why it does not work for you. You can easily verify that the filter is correct as follows.

          Open Alphasports.
          Go to the interactive window

          Type:

          Code:
          session.link = "graham"
          filter = "substr(lastname,1,len(alltrim("+quote(session.link)+")))=alltrim("+quote(session.link)+")"
          report.preview("Customer List",filter)
          You will notice that I changed the field from 'key' to 'lastname' because the customer table does not have a field called 'key'.

          But you could test this against your own report without having to make any changes to the filter expression.

          Comment


            #6
            Selwyn. The code does work but not with session variables. I deleted the session. and defined link as a constant. It works as long as the definition is in the component. I tried to both create link as a constant and = to session.link at the top of the A5w page that uses the component and in both cases link could not be found.

            So it looks like the session variables and page variables are not geting into the After Validate properties of the component which is a dialog That's used to set the print parameters

            Comment


              #7
              I am NOT seeing this.

              I defined a Dialog with this as the AfterValidate event


              Code:
              if eval_valid("session.id") then 
              	echotext = session.id
              else
              	echoText = "session var not found"
              end if
              I then ran the dialog and pressed the Submit button.

              Initially, the echotext at the top of the dialog showed 'session var not found' (which is correct - the session var does not exist)

              Then I changed the URL in the browser to:

              Code:
              http://localhost/LivePreview/MyComponent_LivePreview.a5w?session.id=Robert
              The dialog displayed, and I clicked the Submit button. The browser now showed

              "Robert"

              as the echoText, proving that Session variables are visible in the AfterValidate event on a Dialog.

              Comment


                #8
                Selwyn Does echotext display variables in the browser. I did a search for it in Help but nothing came up. I've been looking for a way to display items in debugging because both html and Xbasic are new to me.

                I know that session.link is valid because I paste A5W_info(.f.) to the bottom of the page I'm working on . I'll try echotext and let you know.

                BTW I did think about using the interactive window after I went to bed.
                The trouble is that because everything I'm doing is in the Editor panel and when its maximized it covers everything up

                Comment


                  #9
                  'echotext' should have been documented. it was an oversight.

                  'echotext' is like a trace window that you can use to write out information while a dialog component's event hadlers are executing.

                  Comment


                    #10
                    First all the above problems went away with the fianal release

                    Now a new problem for the same report The grid contains radio buttons that select PDF HTML RTF TXT for format. And a set to select which report and how to deliver it.

                    Every thing but HTML works both in live preveiw and through WAS.

                    Code:
                    dim filter as c 
                    dim order as c
                    dim link as c
                    link=151
                    if rprt="Family Tree" then
                        report="gene"
                        Order = "Key"
                      else if rprt="Contact List" then
                        report="contact"
                        Order="name"
                     end if
                    filter = "substr(key,1,len(alltrim("+quote(link)+")))=alltrim("+QUOTE(link)+")"
                    echotext= type
                    if send_how ="To Browser" then
                     Dim filename as c 
                     filename = session.session_folder + chr(92) + "tempreport."+type
                     filename = report.saveas(report,type,filter,order,filename,.f.)
                     if file.exists(filename) 
                      currentform.RedirectTarget = session.session_url + "tempreport."+type+"?" +  time("hms3")
                     end if 
                     else if send_how ="Email Attachment" then
                     echotext="Email"
                    end if
                    Echotext show HTML when its chosen so type is correct according to the manual. The other three open up the correct editor/viewer for their type so I would assume that HTML should open a browser.

                    Comment


                      #11
                      Got the email portion working except for the HTML portion. In this case because send email is looking for the report file which is not being generated, I get an error.

                      Comment

                      Working...
                      X