8 Replies Latest reply on Nov 5, 2010 4:00 AM by Mastema

    Exporting to Excel - Server 11, Windows XP

    DanielScott

      Title

      Exporting to Excel - Server 11, Windows XP

      Your post

      I'm trying to export the fields in a layout to Excel.  It exports just fine from a client (to a local specified directory) but I cannot get it to export on the server as a Schedule.

      So far, I've tried a script:

      1- Go to Layout

      2- Show All Records

      3- Set Variable: [$varpath;  Value: "filewin:" & Get(DocumentsPath) & "testfile.xls"]

      4- Export Records[No dialog; "$varpath.xls"]   (with filetype specified as Excel in the dialog box)

      Then, on the server, I set up a Schedule to run the FileMaker Script, using the account to access the database that I normally use.  When I run that script, I get a status of "FileMaker script error."

      I also tried it without setting a variable, instead going from step 2 above to step 4, this time hard-coding the file name as "filewin:/C:/Program Files/FileMaker/FileMaker Server/Data/Documents/testfile.xls" (without the quotes.)  With that method, I run it and get a status of "OK" on the Schedules, but the file never shows up. I even did a search on the file name, thinking it may be in another directory, but it's not there at all.I checked, and that's the valid path to the Documents folder off the FileMaker root.

      Any ideas?  Thank you!

        • 1. Re: Exporting to Excel - Server 11, Windows XP
          philmodjunk

          I'd check the log to see what kind of error occurred.

          Your steps appear to exactly match what's specified in the Knowledge Base article on this process so I'm not sure why it didn't work. I'm wondering if you have the appropriate write permissions on the documents directory.

          • 2. Re: Exporting to Excel - Server 11, Windows XP
            DanielScott

            The logs look fine, I think. On the job that completes with an OK, I get this in the log -- it all makes sense from my end:

            2010-10-27 11:45:03.050 -0600 Information 146 SPECED01 Schedule "Daniel ProComp Export" run now by "fmadmin [164.92.12.87]".


            2010-10-27 11:45:03.050 -0600 Information 689 SPECED01 Schedule "Daniel ProComp Export" has started FileMaker script "Daniel Export ProComp Data".


            2010-10-27 11:45:03.300 -0600 Information 150 SPECED01 Schedule "Daniel ProComp Export" completed.

            Thanks for your help, though. I'm really puzzled by this one.

            • 3. Re: Exporting to Excel - Server 11, Windows XP
              philmodjunk

              That is odd. If you get "filemaker script error" as the status, the script error should be logged. Often you get more "errors" logged than you really want to see when a scheduled script executes as scripts that use Go To Next Record, exit after last log an error when they exit the loop--just to give one example.

              • 4. Re: Exporting to Excel - Server 11, Windows XP
                DanielScott

                Thanks for the help, there must be some small thing I need to tweak. When I run the export with the path hard-coded, the status returns as "OK" and there are no errors in the log. It's just my file never shows up anywhere on the server!

                • 5. Re: Exporting to Excel - Server 11, Windows XP
                  philmodjunk

                  I just spotted one of those picky details that drive us all crazy. Maybe it was a typo when you posted your script, but:

                  4- Export Records[No dialog; "$varpath.xls"]   (with filetype specified as Excel in the dialog box)

                  Should be

                  4- Export Records[No dialog; "$varpath"]   (with filetype specified as Excel in the dialog box)

                  And the only quotes araound the variable should be those that appear in the script editor after you specify the options for the step (Don't type them in).

                  • 6. Re: Exporting to Excel - Server 11, Windows XP
                    DanielScott

                    Thank you, I think that was part of the problem.  When I run it with that method, it still gets a "FileMaker Script Error."

                    Looking at the log, it appears to be Error 800, "Unable to create file on disk."

                    2010-10-27 13:33:05.529 -0600 Information 146 SPECED01 Schedule "Daniel ProComp Export" run now by "fmadmin [164.92.12.87]".
                    2010-10-27 13:33:05.529 -0600 Information 689 SPECED01 Schedule "Daniel ProComp Export" has started FileMaker script "Daniel Export ProComp Data".
                    2010-10-27 13:33:05.732 -0600 Information 645 SPECED01 Schedule "Daniel ProComp Export" scripting error (800) at "Personnel 2010-11 : Daniel Export ProComp Data : Export Records".
                    2010-10-27 13:33:05.794 -0600 Information 644 SPECED01 Schedule "Daniel ProComp Export" completed; last scripting error (800).

                    When I create the schedule, I fill in the "Use the following account to access the database" of the account for that particular database -- that is, the account used to login to that particular Personnel database.  However, the script seems to be running as fmadmin, the administrator name on the server, based on the log.  I would think fmadmin would be the account with rights on the C:\Program Files\FileMaker\FileMaker Server\Data\Documents, but does anyone know if it may be trying to use the particular database login?

                    The same fmadmin account happily creates backup schedules on C:\Program Files\FileMaker\FileMaker Server\Data\Backups, so I'm not sure what to do.

                    Thanks again!

                    • 7. Re: Exporting to Excel - Server 11, Windows XP
                      philmodjunk

                      That appears to confirm my original suspicion--that your documents directory doesn't have the correct permissions set to allow creating files in the directory. You should be able to find this directory on the server and check/change the permissions so that fmadmin has write permissions. I suppose if your C partition is full you might also get this error, but that seems unlikely given that your systems are backing up successfully.

                      • 8. Re: Exporting to Excel - Server 11, Windows XP
                        Mastema

                        i'm kinda having the same problem, but on a mac.

                        I also get the 800 error code, but i've already did a chmod 777, so it seems unlikely that FileMaker Server  doens't have write access to this directory...