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

Printing PDF from Grid

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

    #16
    Steve I'm not having any luck. I figured I'd better leave well enough alone, so I started over with a new dialog and went back to the calendar for the date field. I made the changes you mentioned in the last post, but I'm still getting the same 404 error message. Once again, here is my updated code. I must be still putting something in the wrong place!

    DIM Cfilter as c
    cfilter = "date >={" + date + "} .and. update <= {" + date + "} .and. Idno = " + Idno
    report.saveas("dailylog@<adb_path>\dailylogsheet.set","pdf",Cfilter,"",session.session_folder + "\foo.pdf",.f.)

    response.redirect(session.session_url + "foo.pdf" + time("hms03"))
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

    Comment


      #17
      Oh, here's the message I'm getting:

      404 Not Found

      The requested URL /session_folders/b4b2c2ca98294fe8ab39b85f75fe4e6d/foo.pdf192518829 was not found on this server.
      Sergeant Richard Hartnett
      Hyattsville City Police Department
      Maryland

      Comment


        #18
        Whoops, I found one problem already. I forgot to change the second field you had named "update" to "date." I corrected that, but I'm still getting an error message. Here's the updated code:

        DIM Cfilter as c
        cfilter = "date >={" + date + "} .and. date <= {" + date + "} .and. Idno = " + Idno
        report.saveas("dailylog@<adb_path>\dailylogsheet.set","pdf",Cfilter,"",session.session_folder + "\foo.pdf",.f.)

        response.redirect(session.session_url + "foo.pdf" + time("hms03"))
        Sergeant Richard Hartnett
        Hyattsville City Police Department
        Maryland

        Comment


          #19
          Also, your error message seems to indicate that the pdf file is not being created. Have you created a pdf file as of yet? You can have Alpha create a pdf file by right clicking on the report name and saving as a pdf file. If that does not work we have to make sure everything is installed correcly.

          Steve

          Comment


            #20
            Originally posted by Steve Bovino
            Also, your error message seems to indicate that the pdf file is not being created. Have you created a pdf file as of yet? You can have Alpha create a pdf file by right clicking on the report name and saving as a pdf file. If that does not work we have to make sure everything is installed correcly.

            Steve
            Steve I wasn't quite sure what you meant by "have I created a pdf file yet?"

            I can print to pdf using the Adobe Acrobat Publisher software we have installed on the server, and just now I did the right click on the report and told it to save as "pdf." After a few seconds the Adobe program opened up and the pdf was created, but this was being done by the Adobe v5.0 that was installed two years ago on the server. Does the pdf report have to be created by Adobe software located within the A5 program? Also, was I supposed to save the pdf version of the form someplace?

            (Sorry this is turning out to be so complicated.)
            Sergeant Richard Hartnett
            Hyattsville City Police Department
            Maryland

            Comment


              #21
              That's good Rich. It means Alpha is printing the pdf file. Are you still receiving an error message when you try to run the report?

              Steve

              Comment


                #22
                Your response.redirect has a minor problem, which causes the browser to try to load a non-existent file instead of the PDF you've just created.

                change
                Code:
                response.redirect(session.session_url + "foo.pdf" + time("hms03"))
                to

                Code:
                response.redirect(session.session_url + "foo.pdf[B]?[/B]" + time("hms03"))

                Lenny Forziati
                Vice President, Internet Products and Technical Services
                Alpha Software Corporation

                Comment


                  #23
                  Lenny I'm still getting the same error message, even after changing that last line of code.

                  404 Not Found
                  The requested URL /session_folders/e6c3618e8dd94374965494eb58543f21/foo.pdf was not found on this server.


                  Here's my code as it is stands now:

                  PHP Code:
                  DIM Cfilter as c
                  cfilter 
                  "date >={" date "} .and. date <= {" date "} .and. Idno = " Idno
                  report
                  .saveas("dailylog@<adb_path>\dailylogsheet.adb","pdf",Cfilter,"",session.session_folder "\foo.pdf",.f.)

                  response.redirect(session.session_url "foo.pdf?" time("hms03")) 
                  Sergeant Richard Hartnett
                  Hyattsville City Police Department
                  Maryland

                  Comment


                    #24
                    [QUOTE=Rich Hartnett]Lenny I'm still getting the same error message, even after changing that last line of code.

                    404 Not Found
                    The requested URL /session_folders/e6c3618e8dd94374965494eb58543f21/foo.pdf was not found on this server.


                    Here's my code as it is stands now:

                    Code:
                    DIM Cfilter as c
                    cfilter = "date >={" + date + "} .and. date <= {" + date + "} .and. Idno = " + Idno
                    report.saveas("dailylog@<adb_path>\dailylogsheet.adb","pdf",Cfilter,"",session.session_folder + "\foo.pdf",.f.)
                    
                    response.redirect(session.session_url + "foo.pdf?" + time("hms03"))
                    Sergeant Richard Hartnett
                    Hyattsville City Police Department
                    Maryland

                    Comment


                      #25
                      Rich:

                      I note in your code that you reference an adb file in the report.saveas command. I believe it should be either a .dbf or.set file. It should reference the table or set that the report is built on.

                      Code:
                      report.saveas("dailylog@<adb_path>\[B]dailylogsheet.adb[/B]","pdf",Cfilter,"",session.session_folder + "\foo.pdf",.f.)

                      Steve

                      Comment


                        #26
                        Yes I see that Steve. I think that happened when I was experimenting around trying different things to find out why I can't get this thing to work, and forgot to change it back to ".set"

                        Anyway, I've corrected it, but I'm still getting the same error message. Here's the latest screen shot of my code:

                        Code:
                        DIM Cfilter as c
                        cfilter = "date >={" + date + "} .and. date <= {" + date + "} .and. Idno = " + Idno
                        report.saveas("dailylog@<adb_path>\dailylogsheet.set","pdf",Cfilter,"",session.session_folder + "\foo.pdf",.f.)
                        
                        response.redirect(session.session_url + "foo.pdf?" + time("hms03"))
                        Also, remember that in the original code you gave me, this section was listed as:
                        Code:
                        >={" + start_date + "} .and. date <= {" + end_date + "}
                        but I kept getting a message on the screen saying that "end_date" was not found, so I changed them both to "+ date +" Could this be one of the problems? What it the correct syntax for these two variables?
                        Sergeant Richard Hartnett
                        Hyattsville City Police Department
                        Maryland

                        Comment


                          #27
                          RicH:

                          Try this.

                          cfilter= "date= {" + date + "} .and. Idno = " + idno


                          Steve

                          Comment


                            #28
                            Nope, same thing. I can't win. I must have something wrong in the code somewhere.....

                            Code:
                            404 Not Found
                            The requested URL /session_folders/e6c3618e8dd94374965494eb58543f21/foo.pdf was not found on this server. 
                            
                            
                            --------------------------------------------------------------------------------
                            
                            Alpha Five/7.0 Build/3906-3009 at SERVER Port 80
                            Code:
                            DIM Cfilter as c
                            cfilter= "date= {" + date + "} .and. Idno = " + idno
                            report.saveas("dailylog@<adb_path>\dailylogsheet.set","pdf",Cfilter,"",session.session_folder + "\foo.pdf",.f.)
                            
                            response.redirect(session.session_url + "foo.pdf?" + time("hms03"))
                            Sergeant Richard Hartnett
                            Hyattsville City Police Department
                            Maryland

                            Comment


                              #29
                              Try a simplified version to try to narrow down the problem:

                              Code:
                              dim pdf_file as c
                              pdf_file = report.saveas("dailylog@<adb_path>\dailylogsheet.set","pdf","","",session.session_folder + "\foo.pdf",.f.)
                              if file.exists(pdf_file)
                                  ? "The PDF was created. <a href=\"" + session.session_url + "foo.pdf?" + time("hms03") + "\">click here to view it</a>."
                              else
                                  ? "The PDF file was not created."
                              end if
                              If the above works, try adding in your filter.

                              If the above does not work, confirm that PDF generation in general works on this system.

                              Originally posted by Rich Hartnett
                              Nope, same thing. I can't win. I must have something wrong in the code somewhere.....

                              Lenny Forziati
                              Vice President, Internet Products and Technical Services
                              Alpha Software Corporation

                              Comment


                                #30
                                [QUOTE=Lenny Forziati]Try a simplified version to try to narrow down the problem:

                                Code:
                                dim pdf_file as c
                                pdf_file = report.saveas("dailylog@<adb_path>\dailylogsheet.set","pdf","","",session.session_folder + "\foo.pdf",.f.)
                                if file.exists(pdf_file)
                                    ? "The PDF was created. <a href=\"" + session.session_url + "foo.pdf?" + time("hms03") + "\">click here to view it</a>."
                                else
                                    ? "The PDF file was not created."
                                end if
                                Lenny I tried that, and when I hit the submit button, the scale at the bottom of the screen went about half way over and then stopped. (Which was different from what I have been getting.) But I never got the pdf form. Keep in mind that this particular set has over 20,000 records in it, so asking for a report without filters would probably mean the report was trying to return a pdf with thousands of records, would it not? Anyway I think it timed out. Then later when I tried it again, I got this response:

                                Code:
                                Errors in: event.Form Level Validate code:
                                File 'P:\BHPDa5w\session_folders\b4b2c2ca98294fe8ab39b85f75fe4e6d\\foo.pdf' is in use. Cannot overwrite.
                                This is driving my crazy. What in the world am I doing wrong?
                                Sergeant Richard Hartnett
                                Hyattsville City Police Department
                                Maryland

                                Comment

                                Working...
                                X