Hi,
Is it possible to set 'Fit All Columns on One Page' print mode from code behind?
Look like PrintOptions.ScalingType enum contains only UseScalingFactor and FitToPages values. Setting PrintOptions.ScalingType = ScalingType.FitToPages forces the whole worksheet to be printed on a single page, which does not work for large files. UseScalingFactor option also does not look useful.
Please advise.
Thank you.
Yes, it is possible. Setting the ScalingType to FitToPages is correct. After that, you need to set MaxPagesHorizontally and/or MaxPagesVertically. By default they are 1, which is why the whole worksheet is printed on a single page. If you set the MaxPagesVertically to 0, it will allow an unlimited number of pages. This will force a one page constraint for all columns, but leave the rows unconstrained.