Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

print field used for find on report

Featured Replies

Is there any way to print the field used to perform a find as the title of a report?

I have a layout called Demographics that displays information like work address, work phone, position, district, etc.

the user prints from this layout often, and would like a title on it so she can keep track of who the people are she's looking at.

For instance, if she does a find for Superintendents, she wants the printout to say "Superintendents" at the top. But if she looks for Grad Standards Committee (a different field), she wants that at top.

Thanks for your help.

Susan

You need to fake the find by actually having the user fill in the find criteria while in browse mode. The find criteria would entered into global fields rather than the fields themselves. Then before you actually perform the find, store which of the global fields has data in them. Here's an example script with two search fields.

#Clear the global fields of any existing data

Set Field [ gSuperintendent, "" ]

Set Field [ gGradStandardsCommittee, "" ]

Go to Layout [ Search ]

#Pause to allow the user to enter the search criteria

Pause/Resume Script

#Clear out the gReportTitle field

Set Field [ gReportTitle, "" ]

If [ not IsEmpty( gSuperintendent ) ]

  Set Field [ gReportTitle, "Superintendent" ]

End If

If [ not IsEmpty( gGradStandardsCommittee ) ]

  Set Field [ gReportTitle, Case( IsEmpty( gReportTitle ), "", ", " ) & "Grad Standards Committee" ]

End If

Enter Find Mode []

Set Field [ Superintendent, gSuperintendent ]

Set Field [ GradStandardsCommittee, gGradStandardsCommittee ]

Perform Find []

If you are scripting your finds, then the find criteria will be entered in a global field, which is then used to set the required field as part of the script. This global field can then be displayed in the header of the found records ot the printed/previewed report. If multiple find criteria are used, then you will need to combine thse into a text string for display.

You would also need to script a "Show All Records" button, which cleared this global field (or set it to "All Records Visible") so that the user is aware of the status of the curretn data.

If she is only using the CTRL-F method of finding, then this global field issue won't work.

Give me a yell if you want any more help with setting the scripts up.

  • Author

Chuck...

this makes sense, except I don't understand what the Case function does in the last If statement. (I've never used that function so don't know it's results, although someone told me once that you can use it instead of nesting If functions....?) Can you enlighten me? :-)

  • Author

Russ...

I'm not sure I understand why I need to Show All Records, and how it's related to clearing the global field...

thanks..

Susan

Susan,

The Show All Records would be an additional scripted button - in case the user, once they had finished looking at the superintendents, wanted to look at the whole set of records.

The reason you would do this using a script (instead of the Records Menu option), is that if the user did a "Show All Records" from the Menu - the descriptor would still say that they were looking at the found set for "superintendents", so you need to clear it or change it to something that reflected the set of records being viewed. Your scripted button for "Show All Records" would then be something like:

Show All Records

Set Field[g_Find Descriptor,""]

or

Show All Records

Set Field[g_Find Descriptor,"All Records Visible"]

Which tells the user what records they are viewing.

  • Author

Ah, yes...thank you.

Here the Case function could be replaced by the If function. I just always use the Case function instead because then I don't have to worry about changing it later if there's more than one test. The following two lines are equivelant.

Case( IsEmpty( gReportTitle ), "", ", " )

If( IsEmpty( gReportTitle ), "", ", " )




Case is meant to be used when there is more than one test.




Case( test1, result1, test2, result2, test3, result3, defaultresult )

However, when there's only one test, it works just like the If function. I've also read, but have not experimented with the idea, that the Case function is faster than the If function.

Chuck

  • 2 weeks later...
  • Author

Chuck,

I'm just now getting around to deploying the script you posted a few weeks ago...and I discovered a problem I'm hoping has a work-around.

On the search screen most of the information a user will search for is displayed from a Value List using Check Boxes. The script works great, but the gReportTitle field displays the last value of the value list, regardless of what was searched for.

Is there a way to display the value that was selected?

Thanks!

Susan

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.