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

Unable to Stitch Together PDF's on a New Server

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

    Unable to Stitch Together PDF's on a New Server

    We just switched our web app from one ZebraHost Server to a different ZebraHost Server. Now we are unable to stitch together PDF's. We have some documents that we print that are just composed of one report. These print great for all users. But most of our documents are composed of multiple reports that appended together to make the final PDF document. The error we are getting is:

    500 Internal Server Error

    Script Error
    Error:Could not append file. File is in use. 'C:\A5webroot\Yellow_Web\session_folders-81\bb72eba3e4f346a9aa78ef19db8ffa88\tempreport2.pdf'.
    Alpha Five Application Server/11.0 Build/3381-4096 at Yellow Port 81

    We are running multiple instances on the WAS just like we were on the old server. These are setup on ports 81, 82 and 83.

    This worked great on the old ZebraHost server. I think it is a security issue. If anyone has a suggestion please let me know.

    Here is my code for appending the reports. This has worked for two years without issues:

    <%a5

    filename = session.session_folder + "tempreport.pdf"
    filename2 = session.session_folder + "tempreport2.pdf"
    filename3 = session.session_folder + "tempreport3.pdf"
    filename35 = session.session_folder + "tempreport35.pdf"
    filename4 = session.session_folder + "tempreport4.pdf"
    filename5 = session.session_folder + "tempreport5.pdf"
    filename6 = session.session_folder + "tempreport6.pdf"
    filename7 = session.session_folder + "tempreport7.pdf"
    filename8 = session.session_folder + "tempreport8.pdf"
    filename9 = session.session_folder + "tempreport9.pdf"
    filename10 = session.session_folder + "tempreport10.pdf"
    filename11 = session.session_folder + "tempreport11.pdf"
    filename12 = session.session_folder + "tempreport12.pdf"

    cvar_coapp=lookupl("F",pro_id,"Two_Signers","[PathAlias.ADB_Path]\tax_worksheet","pro_Id")
    payment_method=lookupc("F",pro_id,"phase1_method","[PathAlias.ADB_Path]\tax_worksheet","pro_Id")

    filename = report.saveas("Tax_JAW_1@[PathAlias.ADB_Path]\tax_paperwork.set","pdf","pro_id = " + quote(pro_id),"",filename,.f.)
    filename2 = Report.saveas("Tax_JAW_2@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename2,.f.)
    pdf_append(filename,filename2)
    filename2 = Report.saveas("Tax_JAW_3@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename3,.f.)
    pdf_append(filename,filename3)
    'filename2 = Report.saveas("Tax_JAW_4@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename35,.f.)
    'pdf_append(filename,filename35)
    if payment_method="Bank" then
    filename2 = Report.saveas("Tax_ACH_P1@[PathAlias.ADB_Path]\tax_paperwork_phase1.set","PDF","pro_id = " + quote(pro_id),"",filename4,.f.)
    pdf_append(filename,filename4)
    else
    filename2 = Report.saveas("Tax_Credit_Card_P1@[PathAlias.ADB_Path]\tax_paperwork_phase1.set","PDF","pro_id = " + quote(pro_id),"",filename5,.f.)
    pdf_append(filename,filename5)
    end if
    filename2 = Report.saveas("Tax_JAW_2848_1@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename6,.f.)
    pdf_append(filename,filename6)
    filename2 = Report.saveas("Tax_JAW_2848_2@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename7,.f.)
    pdf_append(filename,filename7)
    filename2 = Report.saveas("Tax_JAW_8821@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename8,.f.)
    pdf_append(filename,filename8)
    if cvar_coapp=.t. then
    filename2 = Report.saveas("Tax_JAW_2848_1_2@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename9,.f.)
    pdf_append(filename,filename9)
    filename2 = Report.saveas("Tax_JAW_2848_2_2@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename10,.f.)
    pdf_append(filename,filename10)
    filename2 = Report.saveas("Tax_JAW_8821_2@[PathAlias.ADB_Path]\tax_paperwork.set","PDF","pro_id = " + quote(pro_id),"",filename11,.f.)
    pdf_append(filename,filename11)
    end if

    pdf_append(filename,"c:\yellow\tax\FinancialWorksheet.pdf")

    if file.exists(filename) then
    response.redirect(session.session_url + "tempreport.pdf?" + time("hms3"))
    end if

    %>

    #2
    Re: Unable to Stitch Together PDF's on a New Server

    I still need help with this. Our application is hosted at ZebraHost and they have been unable to figure this issue out. We have been down for three days. Perhaps moderators at Alpha Software would be willing to take a look at this and help us get back on our feet?

    Comment


      #3
      Re: Unable to Stitch Together PDF's on a New Server

      The question has been asked if we have worked with ZebraHost on this. Yes we have worked extensively with ZebraHost on this issue and they have, at this point, thrown in the towel. They do not understand why the application will run on one of their servers and not the new server that we are using at ZebraHost. We went with ZebraHost for hosting because Alpha Software recommends them. At this juncture we need help from people on this board that are willing to share their hard won experience of if a moderator from Alpha Software would lend some assistance to us or ZebraHost that would be greatly appreciated.

      CPGood

      Comment


        #4
        Re: Unable to Stitch Together PDF's on a New Server

        This is still an open support ticket.

        Jerry suggests to check your code

        He should look at pdf_append_list()

        pdf_append_list as l (FileList as c, ResultFile as c)
        Append files in a list in order, creating ResultFile. ResultFile is required and can not be in the FileList.

        A suspicion would be a timing issue as PDF_Append() opens and closes each file, and if that open / close has a slight issue, the next append may fail. The append list is also much faster.

        Comment


          #5
          Re: Unable to Stitch Together PDF's on a New Server

          Lenny suggests

          in addition to the change to pdf_append_list suggested by Jerry, session.session_folder should NEVER be directly written to and ession.session_url should NEVER be used to build a URL. They are both deprecated properties in V11 and are gone in V12. Your customer needs to update their Xbasic to use Request.GetRequestTempFileName(), Request.Session.SaveDataAsFile() and Session.FormatFileDataURL(). Guidance on updating the code is at http://wiki.alphasoftware.com/Storin...+in+Version+11

          Comment


            #6
            Re: Unable to Stitch Together PDF's on a New Server

            I have had some issues with this in the past and I solved it by adding the sleep() command between file saves. I experimented and found that a 1 second delay worked for me. You might try adding sleep(.5) or sleep(1) just before each pdf.append command to see if that helps to solve it.
            mike
            Mike Reed
            Phoenix, AZ

            Comment


              #7
              Re: Unable to Stitch Together PDF's on a New Server

              I use the sleep(x seconds) as Mike suggested where x seconds varies between 2 and 10 seconds depending on the report.

              Also, I use pdf_append_list(vReportNameList,vAppendTo) where vReportNameList is a comma separated list of the reports to append starting with the second report and vAppendTo is the first report which the others append to. According to Jerry, this reads them all into memory first and then appends them. It is fast and reliable.

              Also, I've created a directory named c:\a5v12\a5reports and save all the reports in there. We make print date time part of the name so I don't have to worry about overwriting reports. At the end of the append, I file.copy() the combined report to the project folder. Then, from time to time, I empty the a5reports directory.

              We use this to create hundreds of reports every day.
              Pat Bremkamp
              MindKicks Consulting

              Comment


                #8
                Re: Unable to Stitch Together PDF's on a New Server

                HI Pat,
                Thanks, I spoke to him and he added the sleep function and everything seems to be working now.

                Comment


                  #9
                  Re: Unable to Stitch Together PDF's on a New Server

                  Here is some closure and further explanation on this issue. First of all I used Mike's suggestion and added the sleep function prior to the append operations. This worked. That is the only adjustment that I have made. I have not experimented with an amount of time and have the sleep set set at one second at the moment. As I stated in my original post the only change that was made to all of this was a move from one ZebraHost server to another. Probably for worse I am of the mindset that once a program is properly debugged and running without logging any errors that it should be able to be run on comparable hardware and operating systems. It would be great if people would weigh in and provide some ideas as to why this particular function of this app would not run on this new hardware and OS. This could potentially keep others out of trouble in the future.

                  I also want to commend ZebraHost for getting back into the middle of this. As you can tell from their postings they used contacts at Alpha Software to get some suggestions that could also be implemented to make this process even more reliable. These relationships are very valuable to users and this is another very good reason to work with ZebraHost for your hosting. Their relationship with Alpha Software and their familiarity with the Alpha Software products give them a leg up.

                  Thank you again to everyone that posted and to ZebraHost,

                  CPGood

                  Comment


                    #10
                    Re: Unable to Stitch Together PDF's on a New Server

                    CPgood,
                    Thanks for posting the update. You are correct in the theory that if the process is working on one server it should be working on another if all things are the same. The only difference between the two servers would be the new one is running a mail server as well so maybe this is causing some sort of issue maybe some time when your users can afford the downtime we can run some tests to try to figure out what the difference was.

                    Comment

                    Working...
                    X