Posted by: Michael
1 Inch = 1000 mil = 1/12 ft = 1/36 yd = 25,4 mm = 2,54 cm = 0,254 dm = 0,0254 m.
Online Help TD5.2:
bOk = SalReportSetPrinterSettings (hWndReport, strPrinterName, nOrientation, nPaperType, nWidth, nHeight)
Sets the printer properties at runtime. The function should be called in the message action of SAM_ReportStart message.
In most cases, passing an invalid value in a parameter causes that parameter to be ignored, and the default printer setting is retained instead.
hWndReport Report window handle. The handle of a report window.
strPrinterName String. Friendly name of the printer. eg: "HP LasertJet 5", "\\\\machinename\\HP DeskJet 610C" (for network printers). Pass STRING_Null or an empty string if you do not want to switch the printer. If you pass an invalid name in this parameter, the function will fail. If you use a network printer name in conjunction with a call to SalReportView, your changes are ignored when the user presses Print from the report viewing window. To ensure that your changes take effect, use a network printer name in conjunction with SalReport Print instead.
nOrientation Number. Paper Orientation. This can be one of the following constants:
RPT_Portrait for portrait mode.
RPT_Landscape for landscape mode.
Use -1 if you do not want to change the orientation.
nPaperType Number. Paper type. This can be one of the following constants
Use -1 if you do not want to change the paper type
nWidth Number. Paper width in milli-inches. This value is ignored for all paper types except for custom.
nHeight Number. Paper height in milli-inches. This value is ignored for all paper types except for custom.
bOk is TRUE if the function succeeds and FALSE if it fails.
The following code will set the report to print on the printer "HP LaserJet 5", with orientation as Portrait, paper type as A4, first page tray as "Upper Paper tray" and other pages tray as "Lower Paper tray"
Call SalReportSetPrinterSettings( SalNumberToWindowHandle(wParam), "HP LaserJet 5", RPT_Portrait, RPT_PaperA4, 0, 0)