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

Filtered PDFs using a Grid

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

    Filtered PDFs using a Grid

    Hi Guys, I am trying to include an option in my grid to access specific pdf�s stored in an external folder, which are related to the logged in user.
    The first 6 characters of each pdf are the same as the UserID. 123456_abcdef.pdf
    There are more than one pdf for each customer so I need an option to select from a filtered list of pdf�s for the logged in user only.
    A working sample will be great, as I have trawled through lots of threads but still haven�t managed to get this working.

    I have this code on my login.a5w page which filters the user records.
    <%a5
    if eval_valid("submitbutton")
    if eval_valid("userid")
    dim session.__protected__userid as c
    session.__protected__userid = userid
    end if
    end if
    %>

    I am using Version 10.5
    Any help would be much appreciated.
    Thanks

    #2
    Re: Filtered PDF's using a Grid

    dbf or sql?

    Comment


      #3
      Re: Filtered PDF's using a Grid

      DBF

      Comment


        #4
        Re: Filtered PDF's using a Grid

        I'm not as in the know with DBF, and I started a suggestion but realized I misread your question and assumed that you have the filenames or URLs to those files in a table. Is that correct?

        Comment


          #5
          Re: Filtered PDF's using a Grid

          Hi, yes the pdf's are in a seperate folder. C:\PDFS

          Comment


            #6
            Re: Filtered PDF's using a Grid

            Okay, but are the file references in a table of some sort? Ex:

            | ID | FileURL
            | 97 | PDFS/123456_abcdef.pdf
            | 98 | PDFS/129876_ajuem.pdf

            If so, you can do something like filter their access by user in your query, something like substr(FileURL,6) = session.__protected__UserID and make the FileURL a hyperlink in your grid.

            If not but you like the idea, you can use something like filefind.get_recurse() to populate a new table with all the filenames.

            If you're just wanting to allow users directory browsing, I haven't set that up before, but I'm betting you'd at least have to have the files in separate folders to separate access.

            Hope that helps.

            Comment


              #7
              Re: Filtered PDF's using a Grid

              Hi, thanks for the info. We are certainly on the right track here. For example if the logged in user (UserId) is 123456, I want to make available to that user ANY pdf's stored in the external directory called C:\PDFS that are prefixed with 123456 to become available from the grid in a drop down list. ie...123456_100420.pdf, 123456_300504.pdf etc.

              A sample would be great.
              Many thanks.
              Fred

              Comment


                #8
                Re: Filtered PDF's using a Grid

                Hi Fred,

                Found a moment at work to do this.
                -----------------------------------------------
                Regards
                Mark Pearson
                [email protected]
                Youtube channel
                Website

                Comment


                  #9
                  Re: Filtered PDF's using a Grid

                  Helps if I finish what I was saying before I push post.

                  Attached is a txt file. In your code tab right click, select import and import the two scrpts in the file.

                  Run the load doc script. It will ask you for a directory that has pdfs. It will thyen open this directory with a list of PDFs. Select the file you want to view and it will be opened in pdf.

                  If you want to hard code the directory etc, you will see the code for this is between lines 84 to 93 in the code.



                  load - view - 21-05-2012 -1.txt
                  -----------------------------------------------
                  Regards
                  Mark Pearson
                  [email protected]
                  Youtube channel
                  Website

                  Comment


                    #10
                    Re: Filtered PDF's using a Grid

                    Sorry Fred - should have realised this was for the we server. the above is a desktop solution
                    -----------------------------------------------
                    Regards
                    Mark Pearson
                    [email protected]
                    Youtube channel
                    Website

                    Comment


                      #11
                      Re: Filtered PDF's using a Grid

                      Hi Chris, thanks again for your input. Your first suggestion sounds perfect. Can you please give me a little more info on how I can implement this.
                      Cheers
                      Fred

                      Comment


                        #12
                        Re: Filtered PDF's using a Grid

                        Hi Mark, no worries mate.
                        Let me know when you receive those files.

                        Speak later.

                        Fred

                        Comment


                          #13
                          Re: Filtered PDF's using a Grid

                          Fred,

                          See if the attached image helps...

                          grid_filter.gif
                          Peter
                          AlphaBase Solutions, LLC

                          [email protected]
                          https://www.alphabasesolutions.com


                          Comment


                            #14
                            Re: Filtered PDF's using a Grid

                            Thanks Pete.
                            I will try this.
                            I still need to add a button on the grid to bring up a list box to display the pdf's.

                            I am having a look right now.

                            Fred

                            Comment


                              #15
                              Re: Filtered PDF's using a Grid

                              Hi Pete, spent ages trying to get this to work. Still no luck.
                              I have a component called pdfs based on the dbf table pdfs.
                              I have 2 fields, CustomerId and Filename.
                              The actual pdf's are stored here c:\alpha5v10\Client\PDFS\
                              The Filename control type is LINK.
                              Link address type Computed from fields in the Grid.
                              Link address c:/alpha5v10/Client/PDFS/filename
                              The Filter is substr(Filename,6) = "session.__protected__UserID"
                              I have an A5page called pdfs which displays the pdfs Grid.
                              I have tried every possible option regarding turning on or off Page and Component security. Everything currently set to Allow Always.
                              Tried re-publishing then restarting WAS etc...

                              If I remove the above filter, all of the pdf's are displayed, but the 403 Forbidden error comes up when trying to open any of them.

                              Any suggestions ?

                              Fred
                              Last edited by Zradene; 05-22-2012, 11:00 AM.

                              Comment

                              Working...
                              X