When I set the Page Setup to print a report in Landscape, all reports are likewise changed even though they should not be affected.
The Help page for info("pagesetuporientation")
says it:
This function returns the printing page orientation for the current database (as specified by the Page Setup command). The returned value is either “Portrait” or “Landscape” .
It thus appears you can only have a one current setting of Landscape vs Portrait for any PanX database. IIRC Jim has said that is an Apple limitation. So if you want some reports to print as one and some as the other you’ll need to include specifying which way in whatever routines lead up to printing each report.
This is by design. You are correct, however, that it is different from Panorama 6. In Panorama 6, each form had a separate Page Setup configuration, and the data sheet also had a separate configuration.
In Panorama X this was changed for two reasons.
- As @JohnB mentioned, Apple’s NSDocument class supports a single page setup per document. Basically, we get that for free. To implement a separate page setup for different components of a document (i.e. different forms) the code would basicallly have to “fight” Apple’s code every step of the way. I’m sure it could be done, but it would be a significant investment.
- Equally important, having separate page setup configurations for different views caused a lot of customer confusion. Many customers expected the page setup configuration to be database wide and were confused and frustrated that they had to set up the Page Setup over and over again for each different view. This generated a significant number of support questions. The number of support questions about this has dropped to almost zero since making this change.
Greg, I understand why you would want separate configurations for each form, honestly, that’s how I would prefer it myself. But I’m a power user, and it’s clear that a majority of users prefer the simpler approach, which is also much much simpler to implement. When you add up these two factors, I made the decision to follow Apple’s lead on this.
As so often in Panorama X — there is a way around this problem:
Inspite of its name this statement is not only usable for creating PDF files, it gives you full printing power combined with choice of printer, orientation, paper size, page order, scale factor.
Greg, I feel your frustration on this topic as I have dozens of printable forms in several linked databases using different page setups.
In case it saves you time, my solution was to create a group of procedures called things like .Set Printer Tray 1 Envelope or .Set Printer Landscape
Then I put the statement that Kurt mentioned in the procedure. Here’s the Envelope example:
printtopdf “”, “onerecord”, “true”, “Printer”, “Back Office Envelope”, “Orientation”, “Landscape”, “Height”, 4.12, “Width”, 9.5
Here’s the detailed part if you use a printer with multiple trays, like I do. ie envelopes, insurance claim form blanks, and plain paper. I set up separate instances of the printer with names like Tray 2 Claims or Plain Paper. The last step is to create a Preset with the desired tray and paper info and have it be the default (and only) option for that printer.
Then, when I call .Set Printer Plain Paper, it sends the printtopdf command to the Plain Paper printer, which is using a preset for Tray 3, Plain Paper.
You may have to figure some other things out if you have employees who print stuff outside of Panorama and change the presets. We run into that occasionally when the printer suddenly prints on the wrong paper and has to be re-set to its proper preset. Not too big of a deal for our small office
I added the PageSetup statement to my procedure right before the Print statement. I have done this in previous Pan procedures to account for different printers over the years. My procedure gave the beach ball when I clicked on Landscape and required a forced quit. This shouldn’t happen.