Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5097 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi

I Have a script which exports a layout(Report) to a pdf file, and within the script I am using the set variable function to generate the file path of the exported file.

If I type in the file path manually all works fine:-

"filewin:/C:/Keibudo Karate/Reports/Grading History Reports/" & Students::c_Student Name & " " & Get ( LayoutName ) & ".pdf"

I have also created a separate table which I will use to set up the database default file locations, however when I use the following in the script it doesn't work:-

conf_File Locations::cGrading Reports & Students::c_Student Name & " " & Get ( LayoutName ) & ".pdf"

I am new to fmp so would greatly appreciate any advice on what i am doing wrong.

Regards

Dave

Posted

I think that you might be victim of a context issue. Your script runs from the context of whatever layout you specify. So, you need a relationship to your conf_File Locations TO in order to use the field cGrading Reports and Students::c_Student Name (that's two different TOs and without a relationship from where you are, FM will not be able to grab that data).

The idea of devoting a table to default export paths is terrific. In fact, I use a one record table SYS, and there I put all my system-wide defaults. Often, rather than building a relationship from every TO to SYS, I "publish" the preference values to global variables or global fields so that I can use that value from any context without a relationship. I name the fields in pairs, for example, p_exportPath and p_exportPath_g, so that they list together nicely in field definitions.

hth,

Barbara

  • Like 1
Posted

I think that you might be victim of a context issue. Your script runs from the context of whatever layout you specify. So, you need a relationship to your conf_File Locations TO in order to use the field cGrading Reports and Students::c_Student Name (that's two different TOs and without a relationship from where you are, FM will not be able to grab that data).

The idea of devoting a table to default export paths is terrific. In fact, I use a one record table SYS, and there I put all my system-wide defaults. Often, rather than building a relationship from every TO to SYS, I "publish" the preference values to global variables or global fields so that I can use that value from any context without a relationship. I name the fields in pairs, for example, p_exportPath and p_exportPath_g, so that they list together nicely in field definitions.

hth,

Barbara

Thank you for your response Barbara.

In my config table I have setup multiple fields for different parts of the file path and now set my filepath calculation field as global storage and it works perfectly!!!

Many Thanks

Dave

This topic is 5097 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.