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

Error printing Letters

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

    Error printing Letters

    Hello

    I have created some reports and letters. When in the design view of the report or a letter if I do a print preview I see how it will look, if I then go to the ribbon and try to save as PDF (or any other format) I get an error: Script:a5_PdfDirectPrint() Line:12 Property not found. This happens for both Report and Letter.

    Letter_Error1.jpg

    If I create a button on my grid to print the Report then it is okay. If I create a button to print a Letter I get this message:
    LetterError2.jpg

    Anybody know what/why this is happening?

    Thanks in advance.

    -John
    Attached Files

    #2
    Hello again,

    This is becoming a bit more urgent as I need to be able to print these. The Reports seems to be working now, why it decided to work I don't know but I'll take it. If it is a letter it still will not print and it still continues to give me:

    Report did not print. Error reported was:
    The system cannot find the file specified. C:\Users\John\AppData\Local\Temp\tmpB8DB.pdf

    I have tried it on a different PC and I get the same results. So, do I need to do anything different to print Letters? Does anybody elses have the same issue with Letters?

    Thanks

    -John

    Comment


      #3
      Would somebody be willing to try to print a letter on their system and see if it works?

      Thanks

      Comment


        #4
        Hi John,
        Based on the information I have, it looks like Alpha is trying to find a file in your local user directory on the app server.
        My guess is if the server is not running under the username John then it will never find that file.
        You will need to find a way to save it to a location the server can find.
        Gregg
        https://paiza.io is a great site to test and share sql code

        Comment


          #5
          Thanks for helping me. I don't know how to do that and I've been working on this for so long I've given up. I didn't think this would be so difficult to print letters, anyway, here then is another (related) question. I am starting to redo all these letters to reports. The reason I had them as letters is because they are documents that are more like letters, ie:
          Dear Mr. Whoever....

          and some of them stretched to 2 or 3 pages. Using the letter I could put "Page 1 of 3" in the page footer and it would always be in the correct place, using reports the "Page 1 of 3" is all over the place. Is there some rule or some piece of advice from someone who does a lot of reports in how I get the page footer to always be at the bottom of the page (in the report footer section) and not sometimes be half way up the page?

          Thanks again in advance.

          -John

          Comment


            #6
            John,
            You should solve the other problem first, otherwise you'll just end up with the same problem but a different file.
            I think the way to solve this has something to do with context save (something I still haven't figured out).
            Hopefully someone will provide the way to use it/accomplish this.
            With that said, there is a possible Option B, witch would be to use a javascript action to Open (or email) a Report, Label, or Letter layout.
            Capture.PNG
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


              #7
              For the text in the footer to remain at the bottom of the page, make sure that you have the "Justify to bottom of page" checkbox checked in your report. To access that checkbox, right click on Report Footer and choose Properties.

              Hope this helps.
              Jay ReportFooter1.pngReportFooter2.png
              Jay Talbott
              Lexington, KY

              Comment


                #8
                Hi Madtowng, thanks for sticking with me. I did try that from my grid, created several buttons to test different things but still no joy. It just will not print letters no matter what I try. I also changed the print option to PDFDirect and that didn't help. Do letters print to PDF okay for you? In the meantime because of a time crunch, I'm having to redo all the letters as reports. I do appreciate your thoughts and would still love to know if Letters work for you.

                Hi Jay, thanks for chipping in. That worked, Thanks, that will save me quite some time as I redo these.

                -John

                Comment


                  #9
                  I would affirm your decision to go to reports instead of letters. I cannot think of one thing that you will lose using reports. I haven't used letters since Nixon was president.
                  Jay
                  Jay Talbott
                  Lexington, KY

                  Comment


                    #10
                    Originally posted by Jay Talbott View Post
                    I would affirm your decision to go to reports instead of letters. I cannot think of one thing that you will lose using reports. I haven't used letters since Nixon was president.
                    Jay

                    Jay,
                    I can appreciate the preference of Report over Letter, but that does nothing to solve the problem of the server not being able to find the file.
                    I'm guessing you have knowledge of how to save a file so that it can be displayed by the app server, which as far as I can tell is the help that is really needed.

                    Gregg
                    Gregg
                    https://paiza.io is a great site to test and share sql code

                    Comment


                      #11
                      Yes, I do. I would try something like this in an Xbasic ajax callback:

                      A5W_REPORT_SAVEAS(a5_removeTrailingBackslash(context.request.applicationRoot) + CHR(92) + 'MyReportName+ ".a5rpt","PDF","","",PDFreportFileName,GLOBAL_VARIABLES(),printOptions,args)
                      (change the text in red appropriately, also, the above two lines are meant to be one line, the forum separated them)

                      I know this is a bit of an oblique answer, but what it does is put it in the A5Webroot as a pdf with MyReportName.pdf. The global variables are used as needed in my case; in yours they may not be necessary.
                      Then you can open that file like any other pdf.
                      I would start with as simple an example as possible, and then build on that.

                      I hope this helps.
                      Jay
                      Jay Talbott
                      Lexington, KY

                      Comment


                        #12
                        Jay, I believe this is a step in the right direction.
                        Version 11 allowed saving files to a session folder, which was important for reports related to logged in users.
                        I know I'm pushing for a lot, and I really do appreciate your patience with me, but does putting the file in webroot offer that same
                        privacy, and if not, do you know the way to save the file to what used to be the session folder ?
                        Gregg
                        https://paiza.io is a great site to test and share sql code

                        Comment


                          #13
                          Wow, thanks both of you and I'm glad this sparked some discussion. Because of my time crunch I will have to use reports but once I get over that first hurdle I will go back and try Jay's suggestion A5W_REPORT_SAVEAS.

                          On another note, I also tried doing this with absolute positioning (I was in the IADN meeting last Friday) but some of our fields can be quite lengthy, think of a first string football team's player names all on one line for instance. That didn't work out because although the field wrapped and printed it also printed on top of the field below it. That's when I tried letters and reports because if it wraps then it also moves the text below down.

                          If I may ask another question though, the forms we were given are fillable PDF forms. I saw a function, I'm not sure what is was called, something like, PDF_FILL_FIELDS but I wasn't sure how to get the data from the database, convert it to JSON (I think), and then merge it into the PDF. I don't want to push my luck but if you have a simple example that'd be great.

                          Thank you.

                          Comment


                            #14
                            Hi John,

                            Just in case I'm assuming too much, let's make sure everyone is working on the same problem.
                            What I understood is that you have an app (web or mobile) that needs to deliver a pdf to the user.
                            I am assuming the pdf contains information specific to the user instead of information that would be the same for everyone ( A bill for last month's services vs a menu for a restaurant).
                            You are able to create this pdf on your development computer, but once you open the app (served by your app server) you get an error that contains the words "The system cannot find the file specified. C:\Users\John\Appdata\Local\Temp\tmp1AFF.pdf"

                            Please let me know if I understand the problem.
                            If it helps, feel free to call me at (608) 345-2697. It is sometimes easier to get to the root of a problem through discussion than typing back and forth.

                            Gregg
                            Gregg
                            https://paiza.io is a great site to test and share sql code

                            Comment


                              #15
                              You should be able to store a report anywhere on the server, even outside the A5Webroot. Just make sure that the folder exists first:

                              ReportTargetFolder = "C:\MyFolder\"
                              IF FILE.EXISTS(A5_RemoveTrailingBackslash(ReportTargetFolder)) = .F. THEN
                              FILE.DIR_CREATE(ReportTargetFolder)
                              END IF

                              PDFreportFileName = ReportTargetFolder + "PDFReport_"+ ALLTRIM(STR(JDATE(DATE()))) + ALLTRIM(STR(TOSECONDS(TIME()))) + ".pdf"

                              Then use the PDFreportFileName in the A5W_REPORT_SAVEAS function

                              You can then use that file for downloading and later delete it with Alpha's file methods.

                              Regarding the fillable pdf, that should be started on another thread.

                              Regards,
                              Jay
                              Jay Talbott
                              Lexington, KY

                              Comment

                              Working...
                              X