Announcement

Collapse
No announcement yet.

pdf_report as attachment

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

  • pdf_report as attachment

    Hi!
    I'm totally stucked.

    I have a form, and I want on Update, to create a pdf and send it as attachment.

    1.- I try with sc_set_pdf_name but this macro works on Grids only.
    2.- I have a PDF_Report application, but i can't be able to locate the file on the _lib folder.

    I really need help on this.

  • #2
    okay, i am no expert but i found something in the code says send email with attachment, and i guess you already know the sc_set_pdf_name known!?

    just thought
    Last edited by MikeDE; 06-11-2014, 01:39 AM.

    Comment


    • #3
      Thanks for the response.

      Maybe I'm missing something, but the macro sc_set_pdf_name works on Grid only. So, in a Form the macro does not work. When the macro sc_set_pdf_name = "sc_my_new_file.pdf"; is included OnScriptInit, the form crashes.

      Some help will very appreciated.
      Last edited by hikiboy; 06-11-2014, 12:44 PM.

      Comment


      • #4
        sorry, not that expert really, i know form is less that grid supported in macros, guys over here (aducom, jsb, giu and other other) helped me a lot with these limiation by creating workarounds and java solutions... but still scriptcase form support is not much as grid.... there is version 8 coming soon, i am optimistic somehow, lets see.

        Comment


        • #5
          Hi!
          After several attempts, I found a solution, maybe isn't the best way but definitely works.

          This is a two step procedure:
          1.- In PDFreport app, In LayoutPDF>code add sc_pdf_output("test.pdf","F"); on very bottom. This will store a pdf file on the app folder.
          2.- In Events>OnScriptInit add Send an email with attachment script from Scriptcase example libraries. setting 'test.pdf' on mail attachment array.

          Thats it. when the PDFreport app is loaded, the file is created and the mail is shooted.

          Hope this works for you.
          Cheers.

          Comment


          • #6
            thank you for sharing this, i am sure it will help many others as well

            Cheers.

            Comment


            • #7
              Originally posted by itsme3 View Post
              thank you for sharing this, i am sure it will help many others as well

              Cheers.
              I missed this one obviously. For a lot of reasons I sometimes need to create a pdf from html. That goes horrible with FPDF, but well with TCPDF. Then you have a physical pdf file in hand. Above solution apply but you can also put it on the form etc. You can upload TCPDF somewhere in your root and create an include for that.
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment


              • #8
                Thanks aducom
                Can you explain a little more how integrate the TCPDF?
                Any input is well received.

                Comment


                • #9
                  Hi Albert, could u provide an example? We all hunger for the solution

                  Comment

                  Working...
                  X