Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
pkelly
Specialist
Specialist

Changing Printer Orientation through Code

Hopefully I have the correct forum for this question...

I have a button pointing to the following script…

sub ReportPrint

ActiveDocument.ActiveSheet.Print()

end sub

This is working great.

I am working on a new report and want to print tab 1 portrait with tab 2 being printed in landscape mode.

I know how to change the orientation through the print set up but this applies to every tab.

What I would like to is have to different sub routines…

One which forces the printout to landscape and one which forces the printout to portrait…

So would have something like….

sub ReportPrintLandscape

Force Print Settings to Landscape

ActiveDocument.ActiveSheet.Print()

end sub

sub ReportPrintPortrait

Force Print Settings to Portrait

ActiveDocument.ActiveSheet.Print()

end sub

I am struggling with the command line for changing the print orientation…

Any help greatly appreciated...

1 Solution

Accepted Solutions
pkelly
Specialist
Specialist
Author

Thanks Oleg

Have come up with a workaround...

I am opening the print dialog box and the user can select the orientation they want...

ActiveDocument.ActiveSheet.DialogPrint



View solution in original post

4 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure how you can do it using VBScript functions - perhaps there is something (outside of QlikView).

As an alternative solution - you can define a QlikView Reports (using "Reports" menu option) and in the report you can declare one page as Landscape and another page as Portrait. Then, instead of Printing Sheet, you can print a Report.

good luck!

Oleg

Ask me about Qlik Sense Expert Class!
pkelly
Specialist
Specialist
Author

Thanks Oleg...

I am new to QlikView and have no experience of the "Reports" menu option.

I have searched for support documentation (manual) for this with no success...

Do you know of any support documentation that would help?

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

There is a brief description of Reports Menu in Chapter 17 of the Reference Manual (should be installed under \QlikVIew\Documentation as part of the Complete installation)

Oleg

Ask me about Qlik Sense Expert Class!
pkelly
Specialist
Specialist
Author

Thanks Oleg

Have come up with a workaround...

I am opening the print dialog box and the user can select the orientation they want...

ActiveDocument.ActiveSheet.DialogPrint