Type search words and press enter
"Use Edit Log for transactions/masters, and digital signature for invoices/reports with Release 2.1. Download NOW!"
https://help.tallysolutions.com/docs/td9rel54/faq/8860.html

Setting print orientation within TDL

It is possible to set the print orientation within TDL from Tally.ERP9 Series A Release 3.6 onwards. Variable SVPrintOrientation has been introduced to set the required Printer Orientation, that is, ‘Portrait’ or ‘Landscape’, within a Report.

It is recommended to declare a local variable within the function or report and set the variable value, to avoid the system Printer Configuration changes to be effected globally. This is useful where a Report needs to printed in a different orientation, e.g., Landscape. For e.g., if one needs to print the cheques in ‘Landscape’ mode and other reports in ‘Portrait’ mode, then there is no need to keep switching the printer settings from Portrait to Landscape, and vice versa, based on the report getting printed. For Cheque Printing Report, one can default Landscape Orientation.

For example ,

[#Report: Balance Sheet]

;; Local Variable Declaration

Variable  : SVPrintOrientation  : String

Set         : SVPrintOrientation  : “Landscape”

Since the variable is locally declared and updated within the Report Balance Sheet, the same will not affect the global printer settings.

Multiple Orientation Support for Printing

This will be very useful in scenarios where multiple forms are being printed from a single report. For example, from a Payment Voucher, one needs to print both Voucher and Payment Advice. However, the Payment Voucher needs to be printed in ‘Portrait’ form, and the Payment Advice in ‘Landscape’.

To achieve this behaviour, the local declaration of the Variable ‘SVPrintOrientation’ at ‘Report’ level is mandatory, and its value must be set using the form level attribute ‘Set Always’ in individual forms.

Example:

[Report: TSPL Smp VarSVPrintOrientation Extended]

Form:TSPLSmpVarSVPrintOrientationFrm,TSPLSmpVarSVPrintOrientationFrm2

;; Mandatory Local declaration of Variable SV Print Orientation

Variable : SV Print Orientation : String

[Form: TSPL Smp VarSVPrintOrientation Frm1]

;; Orientation of this Form is set to ‘Portrait’

Set Always : SV Print Orientation : "Portrait"

[Form: TSPL Smp VarSVPrintOrientation Frm2]

Use : TSPL Smp VarSVPrintOrientation Frm1

;; Orientation of this Form is set to ‘Landscape’

Set Always: SV Print Orientation: "Landscape"

In this example, the report ‘TSPLSmpVarSVPrintOrientation Extended‘ has two forms, viz.TSPLSmpVarSVPrintOrientationFrm1 and TSPLSmpVarSVPrintOrientationFrm2.  Based on the value set to the variable ‘SV Print Orientation’, both the forms will be printed in the respective orientation.