- Daniel Vivier
- PowerBuilder
- Tuesday, 14 July 2020 02:23 PM UTC
We have some reports in an application that were designed for landscape mode. However, we realized that in some circumstances (program options) they can be changed to portrait mode, which we think most people prefer.
So we added a bunch of DW expressions for objects' X positions, widths, etc., based on a retrieval argument for portrait Y/N.
Unfortunately when we ran that, passing in the argument for portrait mode, we got an entirely blank page after every page of the report. It's not that any objects were actually extending onto that page - we checked carefully.
Rather, what I eventually figured out is that PB determines how wide a report needs to be based on the initial values for those X positions etc. (the ones that appear before the tab and the expression in Edit Source), not on the calculated expression values. If that implies the report is wider than 8" (I guess), you get extra blank pages. So what we had to do to make the problem go away was change all of those initial values to the ones that fit in portrait mode.
I also tried to trick PB (to avoid all of that detailed editing of the initial values) by hacking the expressions for those X values etc. at runtime, before the retrieve. So for instance if an X value was "2000~tif (PORTRAIT = ~"Y~", 1500, 2000)" I wrote code that would analyze that and resave it as "1500~tif (PORTRAIT = ~"Y~", 1500, 2000)". For whatever reason, that didn't work to avoid the blank pages - the change had to be made in the original saved DW code, not at runtime.
Interesting (and quite frustrating until I got it all figured out)!
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.