Printer paper size in Powerbuilder

I am trying to print some W2 forms. The form in the printer is for 2 W2s per page. The first one prints properly. The second is always off despite all the manipulations to the datawindow. So I want to set the paper page size to 8 1/2 by 5 1/2. Is it possible to change the paper size? I tried this but I was getting an error:
dw_1.Object.DataWindow.Print.Size = 256
dw_1.Object.DataWindow.Print.CustomPage.Length = 139.7
dw_1.Object.DataWindow.Print.CustomePage.Width = 215.9
I got an error on the second line: incompatible data type.
Help
PlacideAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
sandeep_patelConnect With a Mentor Commented:
Hi,

you can assign only Long value to Length and width property. Cannot assign decimal. See PB help for more detail.

This should work

dw_1.Object.DataWindow.Print.paper.Size = 256
dw_1.Object.DataWindow.Print.CustomPage.Length = 139
dw_1.Object.DataWindow.Print.CustomPage.Width = 215


Regards,
Sandeep
0
 
sandeep_patelCommented:
Hi,

I think you can also use the paper.size = 6 without any length and width modification. You may need to select either portrait or landscape based on your format and paper.

see PB help

dw_1.Object.DataWindow.Print.paper.Size = 6
dw_1.Object.DataWindow.Print.orientation = 1 or 2
0
All Courses

From novice to tech pro — start learning today.