4 Replies Latest reply on Jun 20, 2013 10:23 AM by willrollo

    export pdf ot desktop with field name


      export pdf ot desktop with field name



           Have now decided, as it wasn't really working (there were no spaces in script) plus the auto named folders may have created problems in the future if the related field was altered thus rendering the folder useless..
           So I have decided on a simpler idea which is just to export file (pdf) to desktop - the name of the file is to be sourced from existing data in a field. However, it doesnt seem to work - in other words when i run the script, nothing happens. If I use a normal name for the file, "test" & ".pdf" it works. However, if I replace "test' with my field name, it doesnt. Any ideas?

           Get ( DesktopPath ) &
           INVOICE DETAILS::Reference & ".PDF"


           I have copied this script into dataviewer and the result is fine...so unsure why the pdf is not being created...

        • 1. Re: export pdf ot desktop with field name

               I have updated my variable to be cross platform and also allow me to see if it works on a pc. A pdf is created on the pc, but it has no name..

               On the table that I execute the script from, I can see my field with the correct data in  - it is this field (INVOICE DETAILS::Reference) that shoud be the name of the pdf file..

               Choose ( Abs ( Get ( SystemPlatform ) ) -1 ; Get ( DesktopPath ) & INVOICE DETAILS::Reference & ".pdf" ; "filewin:"& Get ( DesktopPath ) & INVOICE DETAILS::Reference & ".pdf" )



               Any ideas?

               Thank you

          • 2. Re: export pdf ot desktop with field name

                 You might consider something like this:

                 Allow User Abort [Off] 

                 Set Variable [ $filepath; Case ( Abs ( Get ( SystemPlatform )) = 1; "filemac:"; "filewin:" ) & Get ( TemporaryPath ) & "fm_file.pdf" ]

                 Export Field Contents [ container field; $filepath; Automatically open ]


                 check out this post: 


            • 3. Re: export pdf ot desktop with field name

                   The "filemac/filewin" tag is not needed so you don't have to test for system platforms.

                   Set Variable [ "file:" & Get ( DesktopPath ) & INVOICE DETAILS::Reference & ".PDF" ]

                   Should be all that you need. Make sure that your "Table occurrence context" is correct for referencing INvoice Details at the point in time where this script step executes.

              • 4. Re: export pdf ot desktop with field name

                     Hi Phil

                     You were right - it was a T.O. Issue. I thought the variable should contain fields from the table that I launcehd the script from and not the table that is used on the report that I am exporting...