Jump to content
Server Maintenance This Week. ×

Print in both Portrait and Landscape


Joe  A

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

Recommended Posts

That's what I had thought at the time, I had one print script with one page setup (portrait), and another script with another page setup (landscape), but whenever I printed, it would use the page orientation from the most recent print operation, not the one supposedly saved with the script. I was using FM5.5 on Mac OS9 at that time. However, I just tried it again with FM 6 on OSX and it works okay now. So, it may have just been a problem in older versions.

Link to comment
Share on other sites

The page setup script step does work in all versions, but ... you must have separate scripts for portrait and landscape, AND separate scripts for OS9, OSX, and Windows. That's a total of 6. Use "status (current platform)" to run the right one

I read once that "page setup" is able to save both mac and windows setups in the same script, but I have found this not to work

Link to comment
Share on other sites

I am glad someone knows this inside and out, because I have a follow up question:

I need to make a runtime. Both Page Setup and Print have to be performed without dialog. Specifically, the page size and orientation and the number of copies printed must not be interfered with.

Can I distribute such solution by email, when I don't know in advance which printer the user has (and some may have multiple printers)?

This will be in v.4 on Windows.

Link to comment
Share on other sites

You should be able to, as long as each Print step includes a Print Setup in the same script. The Print settings are stored with the Print Setup, so having a Print step by itself in a script leads to chaos.

What I do is create separate scripts for each Setup-Print combination--one for Portrait - Records Being Browsed - 1 copy, Portrait - Records Being Browsed - 10 copies, Portrait - Current Record, Landscape - Records Being Browsed, etc. Each script looks like

If [not global]

Print Setup [Restore, No dialog]

Else

Print [No dialog]

End If

Then, all other scripts set global to 0 and call the appropriate script when they want to perform a Print Setup, then set global to 1 and call it again.

Also, if you include a script that only contains a Print Setup [ ] step and attach it to a 'Change Printer' button in your prefs file, users can change their default FM printer before running a particular report, and you can keep the No dialog portion of Print in your Setup/Print scripts, so that they cannot accidentally change the settings and screw themselves up.

Link to comment
Share on other sites

Ahhh yes, now Comment's question reminds me of the source of my original problem. I had to distribute my solution to users who had different printers. There was no way for FM to remember the page orientation when the printer was different from the one originally configured and saved with the script. The only way around this was to have page setup scripts for every different brand of printer that may be used. Don't know if that was ever fixed with version 7.

Link to comment
Share on other sites

I haven't had that problem on Windows, unless you're referring to detailed setups, where one printer may have more capabilities than another (e.g., scaling) and using a less capable printer results in a default value for that printer. Otherwise, we've had no problems installing new printers of varying brands at 10 satellite locations and using them immediately. I would have shot myself a long time ago if that were the case.

Was it only a problem for you on Macs?

Link to comment
Share on other sites

I've always thought the solution to this problem is to have some scriptable way to save the current page setup, without users having to edit the scripts in Scriptmaker itself. Then when a solution is first installed a "calibration" process is run where users setup the tall and wide page orientations for their preferred printer.

Link to comment
Share on other sites

Upon re-read, I am not sure I get it:

If [not global]

Print Setup [Restore, No dialog]

Else

Print [No dialog]

End If

Then, all other scripts set global to 0 and call the appropriate script when they want to perform a Print Setup, then set global to 1 and call it again.

So the first call does:

Print Setup [Restore, No dialog]

Then the second call does:

Print [No dialog]

How is that different from plain:

Print Setup [Restore, No dialog]

Print [No dialog]

Link to comment
Share on other sites

If you don't want your users to preview the printout or set the total number of pages in a global, etc., then there is no difference. This just gives you the flexibility to do whatever you like in between the steps instead of being forced to perform them consecutively.

Link to comment
Share on other sites

"Vaughan: can you elaborate on "some scriptable way to save the current page setup"? I don't quite see how that would work with a runtime."

I'm mixing requirements with interface here, which I know the engineering people *hate* but... for the exercise:

An enhanced Page Setup script step, with an option to "update stored page setup" based on a calculation. You can then have a field that saved the current page setup into the Page setup script step, without needing developer access or needing to edit the script in Scriptmaker.

Link to comment
Share on other sites

Is this a Windows thing? Ignoring for the moment the fact that this will be in version 4 - even in v.7 I don't see "enhanced Page Setup script step", and no option to "update stored page setup".

Or did I misunderstand completely (again!), and you are talking about a requested feature?

Link to comment
Share on other sites

It would be a global number field that you treat as a boolean. When a script sets the global to zero, the If [not global] test returns true and performs the Print Setup. When a script sets the global to one, If [not global] is false, and the Print step is then performed.

Link to comment
Share on other sites

It would be a global number field that you treat as a boolean. When a script sets the global to zero, the If [not global] test returns true and performs the Print Setup. When a script sets the global to one, If [not global] is false, and the Print step is then performed.

At the last step but stuck. Created a boolean global field but I don't know how to make the script use it in the "if" condition. Do you place the global field on the layout and enter either 1 or 0? I only want to print a report layout in landscape and the other layouts in portrait.

P.S. Great SV site

Link to comment
Share on other sites

The script that is calling the print setup/print sub-script would set the global to the necessary value (0 or 1) and then call the sub-script. This may be more complicated than you need, but it should work.

Link to comment
Share on other sites

This topic is 7002 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.